Skip to main content
Version: Latest

Instance Endpoints

This section describes the usage and specifics of the available instance endpoints of the a9s Public API V1.

info

Before you can access any of the mentioned endpoints, you have to follow the steps mentioned in Accessing the a9s Public API.

Get Instance Overview​

This request gets the Service Instance's overview information.

Route​

GET /v1/instances/:instance_id

cURL​

curl --insecure --header "Authorization: $(bearer_token)" "${url}"

Response​

Body​

For success responses, the following fields are defined:

Response FieldTypeDescription
allowed_update_timehash containing the update settings regarding the blocking of maintenance updatesThe schema of this object is defined below in Allowed Update Time Object
available_updatesarray of available maintenance updates objectsSchema of available maintenance updates objects defined below
created_atdatetimeThe date a Service Instance was created, in ISO 8601 UTC time
idintThe id of a Service Instance within the Data Service
namestringThe given name of a Service Instance
plan_idstringThe id of the plan a Service Instance was created under
service_idstringThe id of the Data Service from which a Service Instance was created
statestringCurrent state of a Service Instance. The following states exist: provisioned, available, deleted, deploying, failed, and stopped
subtenant_idstringThe id of the subtenant (e.g. space in CF)
subtenant_namestringThe name of the subtenant (e.g. space in CF)
tenant_idstringThe id of the tenant (e.g. organization in CF)
tenant_namestringThe name of the tenant (e.g. organization in CF)
updated_atdatetimeThe date when a Service Instance was last updated, in ISO 8601 UTC time
urlsarray of URLs objectsSchema of URLs objects defined below

Allowed Update Time Object​

Response FieldTypeDescription
typestringAn internal specifier for the type of setting. The only available type is default
allowedbooleanA flag indicating whether the updates are allowed or not

Available Maintenance Updates Object​

Response FieldTypeDescription
namestringThe name of the component with available maintenance updates
typestringThe type of update of the component
versionstringThe version of the available maintenance update

URLs Object​

Response FieldTypeDescription
display_namestringThe display name of the URL
idstringThe ID of the URL
linkstringThe full URL string
Example
{
"allowed_update_time": {
"type": "default",
"allowed": true
},
"available_updates": [
{
"name": "keyvalue8",
"type": "release",
"version": "1.0.0"
}
],
"created_at": "2024-12-19T18:32:55.970Z",
"id": 1,
"name": "my-service",
"plan_id": "77f163d4-0879-482d-bc93-085143bce70e",
"service_id": "855887d9-9096-4ddf-a40f-89e6f72da2d1",
"state": "provisioned",
"subtenant_id": "fffd9f2a-45c6-4368-8d7a-afab38c0e594",
"subtenant_name": "manual",
"tenant_id": "68470a75-fd07-4897-b868-16e81fab46a5",
"tenant_name": "system",
"updated_at": "2021-04-22T01:30:06.165Z",
"urls": [
{
"display_name": "KeyValue",
"id": "KeyValue-link",
"link": "https://a9s-keyvalue-dashboard.example.com/service-instances/db8d8ad3-3d72-4f5a-b84a-47aa9df70a7d/keyvalue"
},
{
"display_name": "Service Instance Dashboard",
"id": "Dashboard",
"link": " https://a9s-keyvalue-dashboard.example.com/service-instances/db8d8ad3-3d72-4f5a-b84a-47aa9df70a7d"
}
]
}

For error responses, the following fields are defined:

Response FieldTypeDescription
errorstringA single word in camel case that uniquely identifies the error condition.
descriptionstringA user-facing error message explaining why the request failed.

Status​

Status CodeDescription
200 OKIf the request has been processed successfully.
202 AcceptedThe request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this.
401 UnauthorizedThe user does not have valid authentication credentials for the target resource.
403 ForbiddenThe user does not have the required right to do this request.
404 Not FoundEntity not found.
409 ConflictThere is already such action in progress.
500 Internal Server ErrorAn unexpected error occurred while handling the request.
502 Bad GatewayAn error occurred during upstream communication.
504 Gateway TimeoutA timeout occurred during upstream communication.

Update Instance Settings​

This request updates the Service Instance's settings in the a9s Service Broker. These settings allow you to block or forbid Maintenance Updates.

This is the same functionality as the one offered in the a9s Service Dashboard, described in more detail in Update the Service Instance and its Settings.

info

The Platform Operator controls the availability of this endpoint for Application Developers. If the Platform Operator disallows blocking Maintenance Updates, this API endpoint will no longer be accessible.

Route​

PATCH /v1/instances/:instance_id/broker/edit

Body​

The body must be sent in valid JSON format.

Request FieldTypeDescription
allowed_update_timeA hash containing the settings regarding the blocking of maintenance updatesThe schema of this object is defined below in Allowed Update Time Object

cURL​

curl -X PATCH --insecure --header "Content-Type: application/json" --header "Authorization: $(bearer_token)" \
--data '{"allowed_update_time":{"type":"general", "allowed": <value>}}' \
"${url}/broker/edit"

Response​

Body​

For success responses, the following fields are defined:

Response Field.TypeDescription
allowed_update_timehash containing the update settings regarding the blocking of maintenance updatesThe schema of this object is defined below in Allowed Update Time Object
idstring in GUID formatThe ID of the Service Instance itself

Trigger a Recreate​

This request triggers the recreate process of a Service Instance.

Route​

PATCH /v1/instances/:instance_id/recreate

cURL​

curl -X PATCH --insecure --header "Content-Type: application/json" --header "Authorization: $(bearer_token)" \
"${url}/recreate"

Response​

Body​

For error responses, the following fields are defined:

Response FieldTypeDescription
errorstringA single word in camel case that uniquely identifies the error condition.
descriptionstringA user-facing error message explaining why the request failed.

Status​

Status CodeDescription
200 OKIf the request has been processed successfully.
202 AcceptedThe request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this.
401 UnauthorizedThe user does not have valid authentication credentials for the target resource.
403 ForbiddenThe user does not have the required right to do this request.
404 Not FoundEntity not found.
409 ConflictThere is already such action in progress.
500 Internal Server ErrorAn unexpected error occurred while handling the request.
502 Bad GatewayAn error occurred during upstream communication.
504 Gateway TimeoutA timeout occurred during upstream communication.

Trigger a Restart​

Triggers the restart process of a Service Instance.

Route​

PATCH /v1/instances/:instance_id/restart

cURL​

curl -X PATCH --insecure --header "Content-Type: application/json" --header "Authorization: $(bearer_token)" \
"${url}/restart"

Response​

Body​

For error responses, the following fields are defined:

Response FieldTypeDescription
errorstringA single word in camel case that uniquely identifies the error condition.
descriptionstringA user-facing error message explaining why the request failed.

Status​

Status CodeDescription
200 OKIf the request has been processed successfully.
202 AcceptedThe request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this.
401 UnauthorizedThe user does not have valid authentication credentials for the target resource.
403 ForbiddenThe user does not have the required right to do this request.
404 Not FoundEntity not found.
409 ConflictThere is already such action in progress.
500 Internal Server ErrorAn unexpected error occurred while handling the request.
502 Bad GatewayAn error occurred during upstream communication.
504 Gateway TimeoutA timeout occurred during upstream communication.

Trigger an Update​

With a compatible a9s Public API release, this request asks the a9s Service Broker to apply the maintenance version published for the Service Instance's current plan. The a9s Public API reads that version from the a9s Service Broker catalog; it does not read the Cloud Foundry service catalog. If the Service Instance already runs the plan's published maintenance version, the request is a no-op and returns 200 OK with an empty JSON object. Otherwise, the API sends the published maintenance_info to the a9s Service Broker and passes through its asynchronous update response (normally 202 Accepted).

Applying a published maintenance version through Cloud Foundry instead uses cf upgrade-service SERVICE-NAME and requires the Platform Operator to have refreshed the Cloud Foundry broker catalog.

note

This behavior requires an a9s Public API release that includes the maintenance-update implementation. Verify that the deployed component release supports it; earlier API releases may behave differently.

For Data Services supporting Stop/Start (currently a9s PostgreSQL), the a9s Service Broker also accepts this maintenance upgrade for a stopped Service Instance. The deployment is updated without starting its VMs, and the Service Instance remains stopped. Plan changes and custom-parameter updates are not available while the Service Instance is stopped. If the upgrade fails, retry the upgrade before making another update request.

Updating stopped Service Instances

The Stop/Start feature (currently available only for a9s PostgreSQL) introduced the stopped state to the Service Instance's lifecycle. A published maintenance upgrade can be applied while the Service Instance is stopped; it updates the deployment without starting its VMs, and the Service Instance remains stopped. Request the upgrade with cf upgrade-service or through a a9s Public API.

Plan updates and parameter updates are not allowed while a Service Instance is stopped. If the upgrade fails, retry it before starting the Service Instance. A Platform Operator can use the a9s Deployment Updater's optional start-stop strategy after the upgrade to run data migrations that execute when the Service Instance starts.

You can read more about the Stop/Start feature here.

Route​

PATCH /v1/instances/:instance_id/updates

Body​

The body must be sent in valid JSON format.

Request FieldTypeDescription
service_idstringThe ID of the Service Offering in CF from which the Service Instance was created

cURL​

curl -X PATCH --insecure --header "Content-Type: application/json" --header "Authorization: $(bearer_token)" \
--data '{"service_id": "<service_id>"}' "${url}/updates"

Response​

Body​

For error responses, the following fields are defined:

Response FieldTypeDescription
errorstringA single word in camel case that uniquely identifies the error condition.
descriptionstringA user-facing error message explaining why the request failed.

Status​

Status CodeDescription
200 OKIf the request has been processed successfully.
202 AcceptedThe request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this.
401 UnauthorizedThe user does not have valid authentication credentials for the target resource.
403 ForbiddenThe user does not have the required right to do this request.
404 Not FoundEntity not found.
409 ConflictThere is already such action in progress.
500 Internal Server ErrorAn unexpected error occurred while handling the request.
502 Bad GatewayAn error occurred during upstream communication.
504 Gateway TimeoutA timeout occurred during upstream communication.