(positionalArgs []string, dsHost string, flags *flag.FlagSet, cfTarget util.CloudFoundryTarget)
| 41 | } |
| 42 | |
| 43 | func (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 | } |
nothing calls this directly
no test coverage detected