a9s CF Service Guard API v1
This section describes the API v1 of the a9s CF Service Guard component.
Info
This endpoint exposes general configuration information about the a9s CF Service Guard.
Request
Route
GET /v1/info
cURL
curl "${url}/v1/info"
Response
Body
For success responses, the following fields are defined:
Response Field | Type | Description |
---|---|---|
version | string | The version of the a9s CF Service Guard. |
cloud_foundry | string | The API of the configured Cloud Foundry. |
asg_prefix | string | The prefix for the name of the ASGs created by the a9s CF Service Guard. |
service_brokers | array of strings | The list of configured a9s Service Brokers. |
allowed_consul_nodes | array of strings | The list of allowed Consul node names. |
Example:
{
"version": "2.0.0",
"cloud_foundry": "https://api.cf.example.com",
"asg_prefix": "a9s-asg",
"service_brokers": [
"https://broker1.example.com:3001"
"http://broker2.example.com:3000"
],
"allowed_consul_nodes": [
"^([a-z][a-z0-9]*)?d[a-f0-9]+(-foo-)[0-9]+$",
"^([a-z][a-z0-9]*)?d[a-f0-9]+(-bar-)[0-9]+$"
]
}
For error responses, the following fields are defined:
Response Field | Type | Description |
---|---|---|
error | string | A single word, in camel case, that uniquely identifies the error condition. |
description | string | A user-facing error message explaining why the request failed. |
Status
Status Code | Description |
---|---|
200 OK | Is returned if the request has been processed successfully. |
500 Internal Server Error | Is returned if an unexpected error occurred while handling the request. |
API Status
This endpoint can be used to see if the a9s CF Service Guard API is available.
Request
Route
GET /v1/healthy
cURL
curl "${url}/v1/healthy"
Response
Body
For success responses, the following fields are defined:
Response Field | Type | Description |
---|---|---|
status | string | Is always ok . |
Example:
{
"status": "ok"
}
For error responses, the following fields are defined:
Response Field | Type | Description |
---|---|---|
error | string | A single word, in camel case, that uniquely identifies the error condition. |
description | string | A user-facing error message explaining why the request failed. |
Status
Status Code | Description |
---|---|
200 OK | Is returned if the request has been processed successfully. |
500 Internal Server Error | Is returned if an unexpected error occurred while handling the request. |
Connection Status
This endpoint retrieves the connection status of the components used by the a9s CF Service Guard.
Request
Route
GET /v1/status
cURL
curl -u "${username}:${password}" "${url}/v1/status"
Response
Body
For success responses, the following fields are defined:
Response Field | Type | Description |
---|---|---|
cloud_foundry | string | ok when the configured CF is reachable, failed otherwise. |
service_brokers | array of service broker objects | A list of configured a9s Service Brokers and their respective status, the schema is defined below. |
database | string | ok when database is reachable, failed otherwise. |
Service Broker Object
Response Field | Type | Description |
---|---|---|
api_endpoint | string | The API of the a9s Service Broker. |
status | string | ok when the a9s Service Broker is reachable, failed otherwise. |
Example:
{
"cloud_foundry": "ok",
"service_brokers": [
{
"api_endpoint": "https://broker1.example.com:3001",
"status": "ok"
},
{
"api_endpoint": "http://broker2.example.com:3000",
"status": "failed"
}
],
"database": "ok"
}
For error responses, the following fields are defined:
Response Field | Type | Description |
---|---|---|
error | string | A single word, in camel case, that uniquely identifies the error condition. |
description | string | A user-facing error message explaining why the request failed. |
Status
Status Code | Description |
---|---|
200 OK | Is returned if the request has been processed successfully. |
401 Unauthorized | Is returned if the the authentication fails. |
500 Internal Server Error | Is returned if an unexpected error occurred while handling the request. |