content/operate/rs/references/rest-api/requests/cluster/_index.md
| Method | Path | Description |
|---|---|---|
| GET | /v1/cluster | Get cluster info |
| PUT | /v1/cluster | Update cluster settings |
GET /v1/cluster
Get cluster info.
| Permission name |
|---|
| [view_cluster_info]({{< relref "/operate/rs/references/rest-api/permissions#view_cluster_info" >}}) |
GET /v1/cluster
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
Returns a [cluster object]({{< relref "/operate/rs/references/rest-api/objects/cluster" >}}).
{
"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": ""
}
| Code | Description |
|---|---|
| 200 OK | No error |
PUT /v1/cluster
Update cluster settings.
If called with the dry_run URL query string, the function will
validate the [cluster object]({{< relref "/operate/rs/references/rest-api/objects/cluster" >}}), but will not apply the requested
changes.
| Permission name |
|---|
| [update_cluster]({{< relref "/operate/rs/references/rest-api/permissions#update_cluster" >}}) |
PUT /v1/cluster
{
"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.
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
| Field | Type | Description |
|---|---|---|
| dry_run | string | Validate but don't apply the new cluster settings |
Include a [cluster object]({{< relref "/operate/rs/references/rest-api/objects/cluster" >}}) with updated fields in the request body.
{
"name": "mycluster.mydomain.com",
"email_alerts": true,
"alert_settings": {
"node_failed": true,
"node_memory": {
"enabled": true,
"threshold": "80"
}
},
"// additional fields..."
}
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. |
| </br>• nginx configuration is illegal. | |
| bad_debuginfo_path | • Debuginfo path doesn't exist. |
| </br>• Debuginfo path is inaccessible. | |
| config_edit_conflict | Cluster config was edited by another source simultaneously. |
| Code | Description |
|---|---|
| 200 OK | No error. |
| 400 Bad Request | Bad content provided. |