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

Method showCurrentScale

command/v7/scale_command.go:171–194  ·  view source on GitHub ↗
(userName string, runningErr error)

Source from the content-addressed store, hash-verified

169}
170
171func (cmd ScaleCommand) showCurrentScale(userName string, runningErr error) error {
172 if !shouldShowCurrentScale(runningErr) {
173 return nil
174 }
175
176 cmd.UI.DisplayTextWithFlavor("Showing current scale of app {{.AppName}} in org {{.OrgName}} / space {{.SpaceName}} as {{.Username}}...", map[string]interface{}{
177 "AppName": cmd.RequiredArgs.AppName,
178 "OrgName": cmd.Config.TargetedOrganization().Name,
179 "SpaceName": cmd.Config.TargetedSpace().Name,
180 "Username": userName,
181 })
182
183 cmd.UI.DisplayNewline()
184
185 summary, warnings, err := cmd.Actor.GetDetailedAppSummary(cmd.RequiredArgs.AppName, cmd.Config.TargetedSpace().GUID, false)
186 cmd.UI.DisplayWarnings(warnings)
187 if err != nil {
188 return err
189 }
190
191 appSummaryDisplayer := shared.NewAppSummaryDisplayer(cmd.UI)
192 appSummaryDisplayer.AppDisplay(summary, false)
193 return nil
194}
195
196func shouldShowCurrentScale(err error) bool {
197 if err == nil {

Callers 1

ExecuteMethod · 0.95

Calls 9

AppDisplayMethod · 0.95
NewAppSummaryDisplayerFunction · 0.92
shouldShowCurrentScaleFunction · 0.85
DisplayTextWithFlavorMethod · 0.65
TargetedOrganizationMethod · 0.65
TargetedSpaceMethod · 0.65
DisplayNewlineMethod · 0.65
GetDetailedAppSummaryMethod · 0.65
DisplayWarningsMethod · 0.65

Tested by

no test coverage detected