GetOrg gets the current org from the CLI connection
()
| 18 | |
| 19 | // GetOrg gets the current org from the CLI connection |
| 20 | func (c *CloudFoundryContext) GetOrg() (plugin_models.Organization, error) { |
| 21 | org, err := c.cliConnection.GetCurrentOrg() |
| 22 | if err != nil { |
| 23 | return plugin_models.Organization{}, fmt.Errorf("Could not get current org: %s", err) |
| 24 | } |
| 25 | if org.Name == "" { |
| 26 | return plugin_models.Organization{}, fmt.Errorf("No org and space targeted, use %q to target an org and a space", terminal.CommandColor("cf target -o ORG -s SPACE")) |
| 27 | } |
| 28 | return org, nil |
| 29 | } |
| 30 | |
| 31 | // GetSpace gets the current space from the CLI connection |
| 32 | func (c *CloudFoundryContext) GetSpace() (plugin_models.Space, error) { |
no outgoing calls
no test coverage detected