MCPcopy Create free account
hub / github.com/cloudfoundry/cli / ListSpacesFromOrg

Method ListSpacesFromOrg

cf/api/spaces/spaces.go:50–58  ·  view source on GitHub ↗
(orgGUID string, callback func(models.Space) bool)

Source from the content-addressed store, hash-verified

48}
49
50func (repo CloudControllerSpaceRepository) ListSpacesFromOrg(orgGUID string, callback func(models.Space) bool) error {
51 return repo.gateway.ListPaginatedResources(
52 repo.config.APIEndpoint(),
53 fmt.Sprintf("/v2/organizations/%s/spaces?order-by=name&inline-relations-depth=1", orgGUID),
54 resources.SpaceResource{},
55 func(resource interface{}) bool {
56 return callback(resource.(resources.SpaceResource).ToModel())
57 })
58}
59
60func (repo CloudControllerSpaceRepository) FindByName(name string) (space models.Space, apiErr error) {
61 return repo.FindByNameInOrg(name, repo.config.OrganizationFields().GUID)

Callers

nothing calls this directly

Calls 4

callbackFuncType · 0.85
APIEndpointMethod · 0.65
ToModelMethod · 0.45

Tested by

no test coverage detected