本文整理汇总了Golang中github.com/kumoru/kumoru-sdk-go/pkg/service/application.Application.Show方法的典型用法代码示例。如果您正苦于以下问题:Golang Application.Show方法的具体用法?Golang Application.Show怎么用?Golang Application.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/kumoru/kumoru-sdk-go/pkg/service/application.Application
的用法示例。
在下文中一共展示了Application.Show方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Show
//Show an Application.
func Show(cmd *cli.Cmd) {
uuid := cmd.String(cli.StringArg{
Name: "UUID",
Desc: "Application UUID",
HideValue: true,
})
cmd.Action = func() {
app := application.Application{
UUID: *uuid,
}
application, resp, errs := app.Show()
if errs != nil {
log.Fatalf("Could not retrieve application: %s", errs)
}
if resp.StatusCode != 200 {
log.Fatalf("Could not retrieve application: %s", resp.Status)
}
printAppDetail(application)
}
}
示例2: Deploy
//Deploy an Application
func Deploy(cmd *cli.Cmd) {
uuid := cmd.String(cli.StringArg{
Name: "UUID",
Desc: "Application UUID",
HideValue: true,
})
cmd.Action = func() {
app := application.Application{
UUID: *uuid,
}
application, resp, errs := app.Show() // TODO remove this duplication of application.Show() logic
if errs != nil {
log.Fatalf("Could not retrieve deployment token: %s", errs)
}
if resp.StatusCode != 200 {
log.Fatalf("Could not retrieve deployment token: %s", resp.Status)
}
application, resp, errs = application.Deploy()
if errs != nil {
log.Fatalf("Could not deploy application: %s", errs)
}
if resp.StatusCode != 202 {
log.Fatalf("Could not deploy application: %s", resp.Status)
}
fmt.Printf("Deploying application %s\n", application.UUID)
}
}