Cluster requests

Cluster settings requests

Method Path Description
GET /v1/cluster Get cluster info
PUT /v1/cluster Update cluster settings

Get cluster info

GET /v1/cluster

Get cluster info.

Required permissions

Permission name
view_cluster_info

Request

Example HTTP request

GET /cluster 

Request headers

Key Value Description
Host cnm.cluster.fqdn Domain name
Accept application/json Accepted media type

Response

Returns a cluster object.

Example JSON body

{
   "name": "my-rlec-cluster",
   "alert_settings": { "..." },
   "created_time": "2015-04-29T09:09:25Z",
   "email_alerts": false,
   "email_from": "",
   "rack_aware": false,
   "smtp_host": "",
   "smtp_password": "",
   "smtp_port": 25,
   "smtp_tls_mode": "none",
   "smtp_username": ""
}

Status codes

Code Description
200 OK No error

Update cluster settings

PUT /v1/cluster

Update cluster settings.

If called with the dry_run URL query string, the function will validate the cluster object, but will not apply the requested changes.

Required permissions

Permission name
update_cluster

Request

Example HTTP request

PUT /cluster 

Example JSON body

{
    "email_alerts": true,
    "alert_settings": {
        "node_failed": true,
        "node_memory": {
            "enabled": true,
            "threshold": "80"
        }
    }
}

The above request will enable email alerts and alert reporting for node failures and node removals.

Request headers

Key Value Description
Host cnm.cluster.fqdn Domain name
Accept application/json Accepted media type

URL parameters

Field Type Description
dry_run string Validate but don't apply the new cluster settings

Request body

Include a cluster object with updated fields in the request body.

Response

Example JSON body

{
    "name": "mycluster.mydomain.com",
    "email_alerts": true,
    "alert_settings": {
        "node_failed": true,
        "node_memory": {
            "enabled": true,
            "threshold": "80"
        }
    },
    "// additional fields..."
}

Error codes

When errors are reported, the server may return a JSON object with error_code and message field that provide additional information. The following are possible error_code values:

Code Description
bad_nginx_conf • Designated port is already bound.

• nginx configuration is illegal.
bad_debuginfo_path • Debuginfo path doesn't exist.

• Debuginfo path is inaccessible.
config_edit_conflict Cluster config was edited by another source simultaneously.

Status codes

Code Description
200 OK No error.
400 Bad Request Bad content provided.
RATE THIS PAGE
Back to top ↑