本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/models.AppParams.SpaceGuid方法的典型用法代碼示例。如果您正苦於以下問題:Golang AppParams.SpaceGuid方法的具體用法?Golang AppParams.SpaceGuid怎麽用?Golang AppParams.SpaceGuid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/cli/cf/models.AppParams
的用法示例。
在下文中一共展示了AppParams.SpaceGuid方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: createApp
func (cmd *Push) createApp(appParams models.AppParams) (app models.Application) {
spaceGuid := cmd.config.SpaceFields().Guid
appParams.SpaceGuid = &spaceGuid
cmd.ui.Say(T("Creating app {{.AppName}} in org {{.OrgName}} / space {{.SpaceName}} as {{.Username}}...",
map[string]interface{}{
"AppName": terminal.EntityNameColor(*appParams.Name),
"OrgName": terminal.EntityNameColor(cmd.config.OrganizationFields().Name),
"SpaceName": terminal.EntityNameColor(cmd.config.SpaceFields().Name),
"Username": terminal.EntityNameColor(cmd.config.Username())}))
app, apiErr := cmd.appRepo.Create(appParams)
if apiErr != nil {
cmd.ui.Failed(apiErr.Error())
}
cmd.ui.Ok()
cmd.ui.Say("")
return
}
示例2: createApp
func (cmd *Push) createApp(appParams models.AppParams) (app models.Application) {
spaceGuid := cmd.config.SpaceFields().Guid
appParams.SpaceGuid = &spaceGuid
cmd.ui.Say("Creating app %s in org %s / space %s as %s...",
terminal.EntityNameColor(*appParams.Name),
terminal.EntityNameColor(cmd.config.OrganizationFields().Name),
terminal.EntityNameColor(cmd.config.SpaceFields().Name),
terminal.EntityNameColor(cmd.config.Username()),
)
app, apiErr := cmd.appRepo.Create(appParams)
if apiErr != nil {
cmd.ui.Failed(apiErr.Error())
}
cmd.ui.Ok()
cmd.ui.Say("")
return
}