Beispiel #1
0
func Show(cmd *cli.Cmd) {
	applicationUuid := cmd.String(cli.StringArg{
		Name:      "APPLICATION_UUID",
		Desc:      "Application UUID",
		HideValue: true,
	})

	uuid := cmd.String(cli.StringArg{
		Name:      "DEPLOYMENT_UUID",
		Desc:      "Deployment UUID",
		HideValue: true,
	})
	cmd.Action = func() {
		d := deployments.Deployment{}
		deployment, resp, errs := d.Show(*applicationUuid, *uuid)

		if len(errs) > 0 {
			log.Fatalf("Could not retrieve deployment: %s", errs[0])
		}

		if resp.StatusCode != 200 {
			log.Fatalf("Could not retrieve deployment: %s", resp.Status)
		}

		printDeploymentDetail(*deployment)
	}
}
Beispiel #2
0
func List(cmd *cli.Cmd) {
	uuid := cmd.String(cli.StringArg{
		Name:      "UUID",
		Desc:      "Application UUID",
		HideValue: true,
	})

	cmd.Action = func() {
		d := deployments.Deployment{}
		deployments, resp, errs := d.List(*uuid)

		if len(errs) > 0 {
			log.Fatalf("Could not retrieve deployments: %s", errs[0])
		}

		if resp.StatusCode != 200 {
			log.Fatalf("Could not retrieve deployments: %s", resp.Status)
		}

		printDeploymentsBrief(*deployments)
	}
}