MCPcopy Create free account
hub / github.com/cloudfoundry/multiapps-cli-plugin / executeInternal

Method executeInternal

commands/mtas_command.go:43–71  ·  view source on GitHub ↗
(positionalArgs []string, dsHost string, flags *flag.FlagSet, cfTarget util.CloudFoundryTarget)

Source from the content-addressed store, hash-verified

41}
42
43func (c *MtasCommand) executeInternal(positionalArgs []string, dsHost string, flags *flag.FlagSet, cfTarget util.CloudFoundryTarget) ExecutionStatus {
44 // Print initial message
45 ui.Say("Getting multi-target apps in org %s / space %s as %s...",
46 terminal.EntityNameColor(cfTarget.Org.Name), terminal.EntityNameColor(cfTarget.Space.Name),
47 terminal.EntityNameColor(cfTarget.Username))
48
49 // Create new REST client
50 mtaV2Client := c.NewMtaV2Client(dsHost, cfTarget)
51
52 // Get all deployed components
53 mtas, err := mtaV2Client.GetMtasForThisSpace(nil, nil)
54 if err != nil {
55 ui.Failed("Could not get deployed components: %s", baseclient.NewClientError(err))
56 return Failure
57 }
58 ui.Ok()
59
60 // Print all deployed MTAs
61 if len(mtas) > 0 {
62 table := ui.Table([]string{"mta id", "version", "namespace"})
63 for _, mta := range mtas {
64 table.Add(mta.Metadata.ID, util.GetMtaVersionAsString(mta), mta.Metadata.Namespace)
65 }
66 table.Print()
67 } else {
68 ui.Say("No multi-target apps found")
69 }
70 return Success
71}

Callers

nothing calls this directly

Calls 8

SayFunction · 0.92
FailedFunction · 0.92
NewClientErrorFunction · 0.92
OkFunction · 0.92
TableFunction · 0.92
GetMtaVersionAsStringFunction · 0.92
NewMtaV2ClientMethod · 0.65
GetMtasForThisSpaceMethod · 0.65

Tested by

no test coverage detected