Skip to content

Instantly share code, notes, and snippets.

@monodot
Last active November 12, 2019 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monodot/f01ace26fa9ce1cd3c5a1a92a07dd2d2 to your computer and use it in GitHub Desktop.
Save monodot/f01ace26fa9ce1cd3c5a1a92a07dd2d2 to your computer and use it in GitHub Desktop.
Extract profiles and containers from Fuse Fabric
# Gets a list of all profiles and containers from a Red Hat JBoss Fuse Fabric topology
# Note this is very rough and probably doesn't work :-)
cd $FUSE_HOME
export JAVA_HOME=/c/extdot/dev/java/jdk1.8.0_92
export FUSE_PASS=mypassword
/path/to/fuse/jboss-fuse-6.3.0.redhat-329/bin/client -a 8101 -h fuse.example.com -u adminmw fabric:container-list -p $FUSE_PASS > containerlist.txt
FIELDWIDTHS=$(head -1 containerlist.txt | grep -Po '.*? (?=\S|$)' | awk -v ORS=' ' '{printf length" "}')
awk -v FIELDWIDTHS="$FIELDWIDTHS" -v OFS=',' '{ print $1,$5 }' containerlist.txt | sed 's/ //' | awk '{$1=$1;print}'
awk -v FIELDWIDTHS="$FIELDWIDTHS" -v OFS=',' '{ print $1,$5 }' containerlist.txt | awk '{$1=$1;print}' | awk -F ',' '$1!="" {print "echo CONTAINER",$1; print "bin/client -a 8101 -h fuse.example.com -u adminmw -p $FUSE_PASS fabric:profile-display",$2} $1=="" { print "bin/client -a 8101 -h fuse.example.com -u adminmw -p $FUSE_PASS fabric:profile-display",$2 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment