Last active
November 12, 2019 10:55
-
-
Save monodot/f01ace26fa9ce1cd3c5a1a92a07dd2d2 to your computer and use it in GitHub Desktop.
Extract profiles and containers from Fuse Fabric
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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