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

Method GetCFTarget

commands/base_command.go:159–174  ·  view source on GitHub ↗

GetCFTarget initializes and retrieves the CF Target with the current user

()

Source from the content-addressed store, hash-verified

157
158// GetCFTarget initializes and retrieves the CF Target with the current user
159func (c *BaseCommand) GetCFTarget() (util.CloudFoundryTarget, error) {
160 cfContext := util.NewCloudFoundryContext(c.cliConnection)
161 username, err := cfContext.GetUsername()
162 if err != nil {
163 return util.CloudFoundryTarget{}, err
164 }
165 org, err := cfContext.GetOrg()
166 if err != nil {
167 return util.CloudFoundryTarget{}, err
168 }
169 space, err := cfContext.GetSpace()
170 if err != nil {
171 return util.CloudFoundryTarget{}, err
172 }
173 return util.NewCFTarget(org, space, username), nil
174}
175
176// ExecuteAction executes the action over the process specified with operationID
177func (c *BaseCommand) ExecuteAction(operationID, actionID string, retries uint, host string, cfTarget util.CloudFoundryTarget) ExecutionStatus {

Callers 2

ExecuteMethod · 0.95

Calls 5

GetUsernameMethod · 0.95
GetOrgMethod · 0.95
GetSpaceMethod · 0.95
NewCloudFoundryContextFunction · 0.92
NewCFTargetFunction · 0.92

Tested by

no test coverage detected