Constructor
new ServiceInstances(endPoint, options) → {void}
Parameters:
| Name | Type | Description |
|---|---|---|
endPoint |
String | [CC endpoint] |
options |
Object | [Configuration options] |
Returns:
- Type
- void
Methods
add(instanceOptions, acceptsIncompleteopt) → {Promise}
Create a Service Instance
v2: http://apidocs.cloudfoundry.org/226/service_instances/create_a_service_instance.html
v3: https://v3-apidocs.cloudfoundry.org/#create-a-service-instance
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
instanceOptions |
Object | [Service Instance options] | ||
acceptsIncomplete |
Boolean |
<optional> |
false | [Allow async provisioning] |
Returns:
[Promise resolving to created service instance]
- Type
- Promise
getAllInstances(filteropt) → {Promise.<Array>}
Get ALL service instances across all pages (auto-pagination).
Returns a flat array of every service instance resource.
Results are cached when caching is enabled.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
filter |
Object |
<optional> |
Base filter (merged with pagination params) |
Returns:
Flat array of all service instance resources
- Type
- Promise.<Array>
getInstance(guid) → {Promise}
Get a Service Instance by GUID
v2: http://apidocs.cloudfoundry.org/226/service_instances/retrieve_a_particular_service_instance.html
v3: https://v3-apidocs.cloudfoundry.org/#get-a-service-instance
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Service Instance GUID] |
Returns:
[Promise resolving to service instance]
- Type
- Promise
getInstanceByName(name, spaceGuidopt) → {Promise}
Find a Service Instance by name using server-side filtering.
Returns the first matching resource or null if not found.
Optionally filter by space GUID.
v2: Uses q=name:{name} filter (and q=space_guid:{spaceGuid} if provided)
v3: Uses names={name} filter (and space_guids={spaceGuid} if provided)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
String | [Service Instance name] | |
spaceGuid |
String |
<optional> |
[Optional space GUID to narrow search] |
Returns:
[Promise resolving to service instance resource or null]
- Type
- Promise
getInstanceByNameInSpace(name, spaceGuid) → {Promise}
Get a Service Instance by name within a specific Space.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String | [Service Instance name] |
spaceGuid |
String | [Space GUID] |
Returns:
[Service instance matching name in space]
- Type
- Promise
getInstancePermissions(guid) → {Promise}
Get Service Instance Permissions (v2 only)
http://apidocs.cloudfoundry.org/226/service_instances/retrieving_permissions_on_a_service_instance.html
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Service Instance GUID] |
Returns:
[Promise resolving to permissions]
- Type
- Promise
getInstances(filter) → {Promise}
Get Service Instances (supports both v2 and v3)
v2: http://apidocs.cloudfoundry.org/226/service_instances/list_all_service_instances.html
v3: https://v3-apidocs.cloudfoundry.org/#list-service-instances
Parameters:
| Name | Type | Description |
|---|---|---|
filter |
Object | [Filter options] |
Returns:
[Promise resolving to service instances list]
- Type
- Promise
getInstancesBySpace(spaceGuid, filteropt) → {Promise}
Get Service Instances filtered by Space GUID.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
spaceGuid |
String | [Space GUID] | |
filter |
Object |
<optional> |
[Additional filter options] |
Returns:
[Service instances in the space]
- Type
- Promise
getOperationStatus(guid) → {Promise}
Get the last operation status for a Service Instance.
Useful for polling async operations (accepts_incomplete).
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Service Instance GUID] |
Returns:
[Resolves with last_operation object]
- Type
- Promise
getServiceBindings(guid, filter) → {Promise}
Get service bindings for a Service Instance
v2: http://apidocs.cloudfoundry.org/226/service_instances/list_all_service_bindings_for_the_service_instance.html
v3: https://v3-apidocs.cloudfoundry.org/#list-service-credential-bindings
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | [Service Instance GUID] |
filter |
Object | [Filter options] |
Returns:
[Promise resolving to service bindings list]
- Type
- Promise
remove(guid, deleteOptionsopt, acceptsIncompleteopt) → {Promise}
Delete a Service Instance
v2: http://apidocs.cloudfoundry.org/226/service_instances/delete_a_service_instance.html
v3: https://v3-apidocs.cloudfoundry.org/#delete-a-service-instance
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
guid |
String | [Service Instance GUID] | ||
deleteOptions |
Object |
<optional> |
[Delete options] | |
acceptsIncomplete |
Boolean |
<optional> |
false | [Allow async deletion] |
Returns:
[Promise resolving to delete result]
- Type
- Promise
startInstance(guid) → {Promise}
Start a managed Service Instance (e.g., HANA Cloud DB).
Sends PATCH with serviceStopped=false parameter.
Only works for managed service instances that support lifecycle operations.
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | Service instance GUID |
Returns:
Resolves when start operation is accepted (202)
- Type
- Promise
stopInstance(guid) → {Promise}
Stop a managed Service Instance (e.g., HANA Cloud DB).
Sends PATCH with serviceStopped=true parameter.
Parameters:
| Name | Type | Description |
|---|---|---|
guid |
String | Service instance GUID |
Returns:
Resolves when stop operation is accepted (202)
- Type
- Promise
update(guid, instanceOptions, acceptsIncompleteopt) → {Promise}
Update a Service Instance
v2: http://apidocs.cloudfoundry.org/226/service_instances/updating_a_service_instance.html
v3: https://v3-apidocs.cloudfoundry.org/#update-a-service-instance
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
guid |
String | [Service Instance GUID] | ||
instanceOptions |
Object | [Service Instance options] | ||
acceptsIncomplete |
Boolean |
<optional> |
false | [Allow async update] |
Returns:
[Promise resolving to updated service instance]
- Type
- Promise