GetOrganizationSpacesWithLabelSelector returns a list of spaces in the specified org
(orgGUID string, labelSelector string)
| 215 | |
| 216 | // GetOrganizationSpacesWithLabelSelector returns a list of spaces in the specified org |
| 217 | func (actor Actor) GetOrganizationSpacesWithLabelSelector(orgGUID string, labelSelector string) ([]resources.Space, Warnings, error) { |
| 218 | |
| 219 | queries := []ccv3.Query{ |
| 220 | ccv3.Query{Key: ccv3.OrganizationGUIDFilter, Values: []string{orgGUID}}, |
| 221 | ccv3.Query{Key: ccv3.OrderBy, Values: []string{ccv3.NameOrder}}, |
| 222 | } |
| 223 | if len(labelSelector) > 0 { |
| 224 | queries = append(queries, ccv3.Query{Key: ccv3.LabelSelectorFilter, Values: []string{labelSelector}}) |
| 225 | } |
| 226 | |
| 227 | ccv3Spaces, _, warnings, err := actor.CloudControllerClient.GetSpaces(queries...) |
| 228 | if err != nil { |
| 229 | return []resources.Space{}, Warnings(warnings), err |
| 230 | } |
| 231 | |
| 232 | spaces := make([]resources.Space, len(ccv3Spaces)) |
| 233 | for i, ccv3Space := range ccv3Spaces { |
| 234 | spaces[i] = resources.Space(ccv3Space) |
| 235 | } |
| 236 | |
| 237 | return spaces, Warnings(warnings), nil |
| 238 | } |
| 239 | |
| 240 | // GetOrganizationSpaces returns a list of spaces in the specified org |
| 241 | func (actor Actor) GetOrganizationSpaces(orgGUID string) ([]resources.Space, Warnings, error) { |
no test coverage detected