summaryrefslogtreecommitdiffstats
path: root/lib/container/list
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-12-11 11:48:02 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-12-11 12:13:00 +0000
commit300ca0186a20beb57ea7c4ca321be09bba42fb87 (patch)
tree8da83e388544a7803a0f2f2b92d6eec2387e1aae /lib/container/list
parentAdding YAML export format to container list command. (diff)
downloadcompute-tools-300ca0186a20beb57ea7c4ca321be09bba42fb87.tar.xz
compute-tools-300ca0186a20beb57ea7c4ca321be09bba42fb87.zip
Adding XML export format to container list command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlib/container/list33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/container/list b/lib/container/list
index 2be55b5..3073853 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -171,6 +171,17 @@ cat << EOF
EOF
;;
+
+ xml)
+
+cat << EOF
+ <container>
+ <name>${CONTAINER}</name>
+ <ipv4Address>${ADDRESS}</ipv4Address>
+ </container>
+EOF
+
+ ;;
esac
}
@@ -281,6 +292,20 @@ container:
EOF
;;
+
+ xml)
+
+cat << EOF
+<container-tools>
+ <version>${VERSION}</version>
+</container-tools>
+<host>
+ <name>${HOST}</name>
+</host>
+<containers>
+EOF
+
+ ;;
esac
CONTAINERS="$(cd "${MACHINES}" 2>/dev/null && find -maxdepth 1 -type d -and -not -name '.container-tools' -and -not -name 'container-tools' -and -not -name 'lost+found' -and -not -name '.snap' -and -not -name '.snapshot' -printf '%P\n' | sort)"
@@ -369,4 +394,12 @@ cat << EOF
EOF
;;
+
+ xml)
+
+cat << EOF
+</containers>
+EOF
+
+ ;;
esac