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

Method GetSpace

util/cf_context.go:32–42  ·  view source on GitHub ↗

GetSpace gets the current space from the CLI connection

()

Source from the content-addressed store, hash-verified

30
31// GetSpace gets the current space from the CLI connection
32func (c *CloudFoundryContext) GetSpace() (plugin_models.Space, error) {
33 space, err := c.cliConnection.GetCurrentSpace()
34 if err != nil {
35 return plugin_models.Space{}, fmt.Errorf("Could not get current space: %s", err)
36 }
37
38 if space.Name == "" || space.Guid == "" {
39 return plugin_models.Space{}, fmt.Errorf("No space targeted, use %q to target a space", terminal.CommandColor("cf target -s SPACE"))
40 }
41 return space, nil
42}
43
44// GetUsername gets the username from the CLI connection
45func (c *CloudFoundryContext) GetUsername() (string, error) {

Callers 2

GetCFTargetMethod · 0.95
cf_context_test.goFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected