Adding support for listing and getting manifests in dm client.

pull/138/head
Brendan Melville 9 years ago
parent d0854c6941
commit 0dc882352c

@ -137,6 +137,27 @@ func main() {
path := fmt.Sprintf("deployments/%s", args[1])
action := fmt.Sprintf("get deployment named %s", args[1])
callService(path, "GET", action, nil)
case "manifest":
msg := "Must specify manifest in the form <deployment>/<manifest> or <deployment> to list."
if len(args) < 2 {
fmt.Fprintln(os.Stderr, msg)
usage()
}
s := strings.Split(args[1], "/")
ls := len(s)
if ls < 1 || ls > 2 {
fmt.Fprintln(os.Stderr, fmt.Sprintf("Invalid manifest (%s), %s", args[1], msg))
usage()
}
path := fmt.Sprintf("deployments/%s/manifests", s[0])
if ls == 2 {
path = path + fmt.Sprintf("/%s", s[1])
}
action := fmt.Sprintf("get manifest %s", args[1])
callService(path, "GET", action, nil)
case "delete":
if len(args) < 2 {
fmt.Fprintln(os.Stderr, "No deployment name supplied")

Loading…
Cancel
Save