MCPcopy
hub / github.com/cloudfoundry/cli / Execute

Method Execute

cf/commands/application/rename.go:61–81  ·  view source on GitHub ↗
(c flags.FlagContext)

Source from the content-addressed store, hash-verified

59}
60
61func (cmd *RenameApp) Execute(c flags.FlagContext) error {
62 app := cmd.appReq.GetApplication()
63 newName := c.Args()[1]
64
65 cmd.ui.Say(T("Renaming app {{.AppName}} to {{.NewName}} in org {{.OrgName}} / space {{.SpaceName}} as {{.Username}}...",
66 map[string]interface{}{
67 "AppName": terminal.EntityNameColor(app.Name),
68 "NewName": terminal.EntityNameColor(newName),
69 "OrgName": terminal.EntityNameColor(cmd.config.OrganizationFields().Name),
70 "SpaceName": terminal.EntityNameColor(cmd.config.SpaceFields().Name),
71 "Username": terminal.EntityNameColor(cmd.config.Username())}))
72
73 params := models.AppParams{Name: &newName}
74
75 _, err := cmd.appRepo.Update(app.GUID, params)
76 if err != nil {
77 return err
78 }
79 cmd.ui.Ok()
80 return err
81}

Callers

nothing calls this directly

Calls 9

EntityNameColorFunction · 0.92
GetApplicationMethod · 0.65
ArgsMethod · 0.65
SayMethod · 0.65
OrganizationFieldsMethod · 0.65
SpaceFieldsMethod · 0.65
UsernameMethod · 0.65
UpdateMethod · 0.65
OkMethod · 0.65

Tested by

no test coverage detected