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

Method GetOrg

util/cf_context.go:20–29  ·  view source on GitHub ↗

GetOrg gets the current org from the CLI connection

()

Source from the content-addressed store, hash-verified

18
19// GetOrg gets the current org from the CLI connection
20func (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
32func (c *CloudFoundryContext) GetSpace() (plugin_models.Space, error) {

Callers 2

GetCFTargetMethod · 0.95
cf_context_test.goFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected