Constructor
new Spaces(endPoint, options) → {void}
Parameters:
| Name | Type | Description |
|---|---|---|
endPoint |
String | [CC endpoint] |
options |
Object | [Configuration options] |
- Source:
Returns:
- Type
- void
Methods
add(spaceOptions) → {Promise}
Add a new Space
v2: http://apidocs.cloudfoundry.org/214/spaces/creating_a_space.html
v3: https://v3-apidocs.cloudfoundry.org/#create-a-space
Parameters:
| Name | Type | Description |
|---|---|---|
spaceOptions |
Object | [Space options] |
- Source:
Returns:
[Promise resolving to created space]
- Type
- Promise
getAllSpaces(filteropt) → {Promise.<Array>}
Get ALL spaces across all pages (auto-pagination).
Returns a flat array of every space resource.
Results are cached when caching is enabled.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
filter |
Object |
<optional> |
Base filter (merged with pagination params) |
- Source:
Returns:
Flat array of all space resources
- Type
- Promise.<Array>
getApps(guid, filter) → {Promise}
Get apps in a Space
v2: http://apidocs.cloudfoundry.org/214/spaces/list_all_apps_for_the_space.html
v3: https://v3-apidocs.cloudfoundry.org/#list-apps
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
filter |
Object | [Filter options] |
- Source:
Returns:
[Promise resolving to apps list]
- Type
- Promise
getAuditors(guid, filter) → {Promise}
Get auditors in a Space
v2: http://apidocs.cloudfoundry.org/214/spaces/list_all_auditors_for_the_space.html
v3: https://v3-apidocs.cloudfoundry.org/#list-space-auditors
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
filter |
Object | [Filter options] |
- Source:
Returns:
[Promise resolving to auditors list]
- Type
- Promise
getDevelopers(guid, filter) → {Promise}
Get developers in a Space
v2: http://apidocs.cloudfoundry.org/214/spaces/list_all_developers_for_the_space.html
v3: https://v3-apidocs.cloudfoundry.org/#list-space-developers
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
filter |
Object | [Filter options] |
- Source:
Returns:
[Promise resolving to developers list]
- Type
- Promise
getManagers(guid, filter) → {Promise}
Get managers in a Space
v2: http://apidocs.cloudfoundry.org/214/spaces/list_all_managers_for_the_space.html
v3: https://v3-apidocs.cloudfoundry.org/#list-space-managers
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
filter |
Object | [Filter options] |
- Source:
Returns:
[Promise resolving to managers list]
- Type
- Promise
getSpace(guid) → {Promise}
Get a specific Space by GUID
v2: http://apidocs.cloudfoundry.org/214/spaces/retrieve_a_particular_space.html
v3: https://v3-apidocs.cloudfoundry.org/#get-a-space
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
- Source:
Returns:
[Promise resolving to space]
- Type
- Promise
getSpaceApps(guid, filter) → {Promise}
Get apps in a Space (alias for getApps — backward compatibility)
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
filter |
Object | [Filter options] |
- Source:
Returns:
[Promise resolving to apps list]
- Type
- Promise
getSpaceByName(name, orgGuidopt) → {Promise}
Find a Space by name using server-side filtering.
Returns the first matching resource or null if not found.
Optionally filter by organization GUID to disambiguate.
v2: Uses q=name:{name} filter (and q=organization_guid:{orgGuid} if provided)
v3: Uses names={name} filter (and organization_guids={orgGuid} if provided)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
String | [Space name] | |
orgGuid |
String |
<optional> |
[Optional organization GUID to narrow search] |
- Source:
Returns:
[Promise resolving to space resource or null]
- Type
- Promise
getSpaces(filter) → {Promise}
Get Spaces (supports both v2 and v3)
v2: http://apidocs.cloudfoundry.org/214/spaces/list_all_spaces.html
v3: https://v3-apidocs.cloudfoundry.org/#list-spaces
Parameters:
| Name | Type | Description |
|---|---|---|
filter |
Object | [Filter options] |
- Source:
Returns:
[Promise resolving to spaces list]
- Type
- Promise
getSummary(guid) → {Promise}
Get summary of a Space (v2 only)
http://apidocs.cloudfoundry.org/214/spaces/get_space_summary.html
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
- Source:
Returns:
[Promise resolving to space summary]
- Type
- Promise
getUsers(guid, filter) → {Promise}
Get users in a Space
v2: http://apidocs.cloudfoundry.org/214/spaces/list_all_users_for_the_space.html
v3: https://v3-apidocs.cloudfoundry.org/#list-space-members
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
filter |
Object | [Filter options] |
- Source:
Returns:
[Promise resolving to users list]
- Type
- Promise
remove(guid, deleteOptions) → {Promise}
Delete a Space
v2: http://apidocs.cloudfoundry.org/214/spaces/delete_a_particular_space.html
v3: https://v3-apidocs.cloudfoundry.org/#delete-a-space
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
deleteOptions |
Object | [Delete options] |
- Source:
Returns:
[Promise resolving to delete result]
- Type
- Promise
update(guid, spaceOptions) → {Promise}
Update a Space
v2: http://apidocs.cloudfoundry.org/214/spaces/updating_a_space.html
v3: https://v3-apidocs.cloudfoundry.org/#update-a-space
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Space GUID] |
spaceOptions |
Object | [Space options] |
- Source:
Returns:
[Promise resolving to updated space]
- Type
- Promise