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

Method Execute

command/v7/space_quota_command.go:17–49  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

15}
16
17func (cmd SpaceQuotaCommand) Execute(args []string) error {
18 err := cmd.SharedActor.CheckTarget(true, false)
19 if err != nil {
20 return err
21 }
22
23 user, err := cmd.Actor.GetCurrentUser()
24 if err != nil {
25 return err
26 }
27
28 quotaName := cmd.RequiredArgs.SpaceQuota
29
30 cmd.UI.DisplayTextWithFlavor(
31 "Getting space quota {{.QuotaName}} for org {{.OrgName}} as {{.Username}}...",
32 map[string]interface{}{
33 "QuotaName": quotaName,
34 "OrgName": cmd.Config.TargetedOrganizationName(),
35 "Username": user.Name,
36 })
37 cmd.UI.DisplayNewline()
38
39 spaceQuota, warnings, err := cmd.Actor.GetSpaceQuotaByName(quotaName, cmd.Config.TargetedOrganization().GUID)
40 cmd.UI.DisplayWarnings(warnings)
41 if err != nil {
42 return err
43 }
44
45 quotaDisplayer := shared.NewQuotaDisplayer(cmd.UI)
46 quotaDisplayer.DisplaySingleQuota(resources.Quota(spaceQuota.Quota))
47
48 return nil
49}

Callers

nothing calls this directly

Calls 11

DisplaySingleQuotaMethod · 0.95
NewQuotaDisplayerFunction · 0.92
QuotaStruct · 0.92
CheckTargetMethod · 0.65
GetCurrentUserMethod · 0.65
DisplayTextWithFlavorMethod · 0.65
DisplayNewlineMethod · 0.65
GetSpaceQuotaByNameMethod · 0.65
TargetedOrganizationMethod · 0.65
DisplayWarningsMethod · 0.65

Tested by

no test coverage detected