GetApplicationByNameAndSpace returns the application with the given name in the given space.
(appName string, spaceGUID string)
| 128 | // GetApplicationByNameAndSpace returns the application with the given |
| 129 | // name in the given space. |
| 130 | func (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. |
| 144 | func (actor Actor) GetApplicationsBySpace(spaceGUID string) ([]resources.Application, Warnings, error) { |
no test coverage detected