MCPcopy Index your code
hub / github.com/cloudfoundry/cli / GetApplicationByNameAndSpace

Method GetApplicationByNameAndSpace

actor/v7action/application.go:130–141  ·  view source on GitHub ↗

GetApplicationByNameAndSpace returns the application with the given name in the given space.

(appName string, spaceGUID string)

Source from the content-addressed store, hash-verified

128// GetApplicationByNameAndSpace returns the application with the given
129// name in the given space.
130func (actor Actor) GetApplicationByNameAndSpace(appName string, spaceGUID string) (resources.Application, Warnings, error) {
131 apps, warnings, err := actor.GetApplicationsByNamesAndSpace([]string{appName}, spaceGUID)
132
133 if err != nil {
134 if _, ok := err.(actionerror.ApplicationsNotFoundError); ok {
135 return resources.Application{}, warnings, actionerror.ApplicationNotFoundError{Name: appName}
136 }
137 return resources.Application{}, warnings, err
138 }
139
140 return apps[0], warnings, nil
141}
142
143// GetApplicationsBySpace returns all applications in a space.
144func (actor Actor) GetApplicationsBySpace(spaceGUID string) ([]resources.Application, Warnings, error) {

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 1

Tested by

no test coverage detected