cf-node-client
momo auto_awesome BUY CLAUDE KIT WITH 20% OFF coffee BUY ME COFFEE

Class: ServiceInstances

ServiceInstances(endPoint, options) → {void}

Manage Service Instances on Cloud Foundry Supports both Cloud Foundry API v2 and v3

Constructor

new ServiceInstances(endPoint, options) → {void}

Parameters:
Name Type Description
endPoint String [CC endpoint]
options Object [Configuration options]
Source:
Returns:
Type
void

Methods

add(instanceOptions, acceptsIncompleteopt) → {Promise}

Parameters:
Name Type Attributes Default Description
instanceOptions Object [Service Instance options]
acceptsIncomplete Boolean <optional>
false [Allow async provisioning]
Source:
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)
Source:
Returns:
Flat array of all service instance resources
Type
Promise.<Array>

getInstance(guid) → {Promise}

Parameters:
Name Type Description
guid String [Service Instance GUID]
Source:
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]
Source:
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]
Source:
Returns:
[Service instance matching name in space]
Type
Promise

getInstancePermissions(guid) → {Promise}

Parameters:
Name Type Description
guid String [Service Instance GUID]
Source:
Returns:
[Promise resolving to permissions]
Type
Promise

getInstances(filter) → {Promise}

Parameters:
Name Type Description
filter Object [Filter options]
Source:
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]
Source:
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]
Source:
Returns:
[Resolves with last_operation object]
Type
Promise

getServiceBindings(guid, filter) → {Promise}

Parameters:
Name Type Description
guid String [Service Instance GUID]
filter Object [Filter options]
Source:
Returns:
[Promise resolving to service bindings list]
Type
Promise

remove(guid, deleteOptionsopt, acceptsIncompleteopt) → {Promise}

Parameters:
Name Type Attributes Default Description
guid String [Service Instance GUID]
deleteOptions Object <optional>
[Delete options]
acceptsIncomplete Boolean <optional>
false [Allow async deletion]
Source:
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
Source:
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
Source:
Returns:
Resolves when stop operation is accepted (202)
Type
Promise

update(guid, instanceOptions, acceptsIncompleteopt) → {Promise}

Parameters:
Name Type Attributes Default Description
guid String [Service Instance GUID]
instanceOptions Object [Service Instance options]
acceptsIncomplete Boolean <optional>
false [Allow async update]
Source:
Returns:
[Promise resolving to updated service instance]
Type
Promise