MethodPathDescription
GET/v1/clusterGet cluster info
PUT/v1/clusterUpdate 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

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted 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

CodeDescription
200 OKNo 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

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

URL parameters

FieldTypeDescription
dry_runstringValidate 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:

CodeDescription
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_conflictCluster config was edited by another source simultaneously.

Status codes

CodeDescription
200 OKNo error.
400 Bad RequestBad content provided.