Cluster
The cluster model is the parent (owner) of all other objects related to a DSE cluster, whether the cluster physically exists yet or not. In order to be valid for installation and/or configuration, the cluster must have the following:
-
A reference to Repository.
-
A reference to Machine Credentials.
-
A reference to Config Profile.
Managing Clusters | URL |
---|---|
Get a cluster object by ID |
|
Get a list of clusters |
|
Get nodes in a cluster |
|
Get datacenters in a cluster |
|
Get jobs run on a cluster |
|
Get the cacert for a cluster |
|
Create a cluster |
|
Update a cluster |
|
Delete a cluster |
Managing Clusters
Cluster
{
"id" : <value>,
"name" : <value>,
"comment" : <value>,
"repository-id" : <value>,
"machine-credential-id" : <value>,
"config-profile-id" : <value>,
"ssh-management-port" : <value>,
"managed" : <value>,
"opsc-cluster-id" : <value>,
"last-job-id" : <value>,
"job-status" : <value>
}
Property | Description of Values |
---|---|
id |
A UUID for the cluster. |
name |
The name of the cluster. The normal rules for value cluster names apply. |
ssh-management-port |
SSH port on managed nodes. This defaults to 22 and can be overridden at the Datacenter and/or Node level. |
config-profile-id |
The ID of the Config Profile to use for this cluster. Can be overridden at the |
machine-credential-id |
The ID of the Machine Credentials to use for this cluster. Can be overridden at the Datacenter and/or Node level. |
repository-id |
The ID of the Repository to use for this cluster. |
managed |
Does LCM manage this cluster and configuration file - should always be set to |
last-job-id |
The ID of the last job run on this cluster. See Jobs. |
opsc-cluster-id |
A unique ID to link the LCM cluster model with the OpsCenter cluster configuration. This is set automatically at the end of the first successful install job. |
comment |
A generic field for user comments. |
old-password |
When internal authentication is enabled, LCM automatically changes the password for the built-in CQL user named |
new-password |
The desired password for the user named |
ldap-username |
For DSE clusters using LDAP for CQL authentication, this value is the username for the LDAP account used by OpsCenter for CQL access to the DSE cluster. |
GET /api/v2/lcm/clusters/{id}
Gets a specific cluster record by ID.
Path arguments: id: A Cluster ID.
Returns a Cluster object.
Example:
curl http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a
Output:
{
"id" : "108f74ab-0c5c-4bf7-8527-695e3e630e1a",
"name" : "test-cluster-01",
"comment" : null,
"repository-id" : "7db37bd2-c23a-4ea6-a415-e9faaeb2060f",
"machine-credential-id" : "0f03dff7-1874-4c17-a823-ff79dba6e694",
"config-profile-id" : "4ff7a9ae-257c-4a6c-bfb0-b47299f39795",
"ssh-management-port" : 22
"managed" : true,
"opsc-cluster-id" : null,
"last-job-id" : null,
"modified-on" : "2016-06-21T14:33:11.859Z",
"type" : "cluster",
"job-status" : null,
"datacenter" : [],
"created-on" : "2016-06-21T14:33:11.859Z",
"created-by" : "system",
"modified-by" : "system",
"href" : "http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a",
"related-resources" : {
"datacenters" : "http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a/datacenters/"
},
}
GET /api/v2/lcm/clusters/{id}/nodes/
Gets a list of nodes associated with a specific cluster record using the cluster ID.
Path arguments: id: A Cluster ID.
Returns a paginated list of all relevant Node records. See Paginated Results for an overview of the query string parameters that can be used.
Example:
curl http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a/nodes/
Output:
{
"previous" : null,
"current" : 1,
"next" : null,
"last" : 1,
"count" : 1,
"per-page" : 50,
"results" : [
{
"ssh-management-address" : "10.110.110.143",
"datacenter-id" : "42f611b7-44ef-4fda-8903-b6aa75862ac2",
"href" : "http://127.0.0.1:8888/api/v2/lcm/nodes/211c7598-70e3-4c50-9c29-bad2aacff127",
"modified-on" : "2016-10-11T00:08:27.456Z",
"machine-credential-id" : null,
"comment" : null,
"listen-address" : null,
"native-transport-address" : null,
"id" : "211c7598-70e3-4c50-9c29-bad2aacff127",
"rack" : "rack1",
"created-on" : "2016-07-07T22:18:48.239Z",
"broadcast-address" : null,
"last-job-id" : "a6e88a46-bcec-46ab-9fdb-71ba32a14c59",
"job-status" : "TERMINATED",
"type" : "node",
"native-transport-broadcast-address" : null,
"name" : "501-node",
"ssh-management-port" : null,
"config-profile-id" : null,
"seed" : true,
"related-resources" : {
"datacenter" : "http://127.0.0.1:8888/api/v2/lcm/datacenters/42f611b7-44ef-4fda-8903-b6aa75862ac2"
}
}
]
}
GET /api/v2/lcm/clusters/{id}/datacenters/
Gets a list of datacenters associated with a specific cluster record using the cluster ID. This endpoint performs a 302 redirect
, which api clients must follow.
Path arguments: id: A Cluster ID.
Returns a paginated list of all relevant Datacenter records. See Paginated Results for an overview of the query string parameters that can be used.
Example:
curl -L http://localhost:8888/api/v2/lcm/clusters/716c1c44-4cc9-4080-9025-aea0a6bafb9d/datacenters/
Output:
{
"last" : 1,
"per-page" : 50,
"previous" : null,
"current" : 1,
"count" : 1,
"next" : null,
"results" : [
{
"modified-on" : "2016-07-07T22:26:40.087Z",
"solr-enabled" : false,
"job-status" : "TERMINATED",
"last-job-id" : null,
"cluster-id" : "716c1c44-4cc9-4080-9025-aea0a6bafb9d",
"hadoop-enabled" : false,
"spark-enabled" : false,
"graph-enabled" : false,
"comment" : null,
"created-on" : "2016-07-07T22:16:28.217Z",
"id" : "42f611b7-44ef-4fda-8903-b6aa75862ac2",
"type" : "datacenter",
"name" : "501-dc",
"machine-credential-id" : null,
"converged-on" : "2016-07-07T22:26:40.084Z",
"href" : "http://127.0.0.1:8888/api/v2/lcm/datacenters/42f611b7-44ef-4fda-8903-b6aa75862ac2",
"ssh-management-port" : null,
"config-profile-id" : null,
"related-resources" : {
"cluster" : "http://127.0.0.1:8888/api/v2/lcm/clusters/716c1c44-4cc9-4080-9025-aea0a6bafb9d",
"nodes" : "http://127.0.0.1:8888/api/v2/lcm/datacenters/42f611b7-44ef-4fda-8903-b6aa75862ac2/nodes/"
}
}
]
}
GET /api/v2/lcm/clusters/{id}/jobs/
Gets a list of jobs associated with a specific cluster record using the cluster ID. This endpoint performs a 302 redirect
, which api clients must follow.
Path arguments: id: A Cluster ID.
Returns a paginated list of all relevant Job records. See Paginated Results for an overview of the query string parameters that can be used.
Example:
curl -L http://localhost:8888/api/v2/lcm/clusters/716c1c44-4cc9-4080-9025-aea0a6bafb9d/jobs/
Output:
{
"current" : 1,
"next" : null,
"results" : [
{
"cluster-id" : "716c1c44-4cc9-4080-9025-aea0a6bafb9d",
"id" : "f0a56ab3-1ec9-4f5a-8f53-cb4c683f2179",
"modified-on" : "2016-10-07T22:00:19.854Z",
"created-on" : "2016-07-07T22:19:00.860Z",
"href" : "http://127.0.0.1:8888/api/v2/lcm/jobs/f0a56ab3-1ec9-4f5a-8f53-cb4c683f2179",
"job-type" : "install",
"dry-run" : false,
"datacenter-name" : null,
"status" : "FAILED",
"node-name" : null,
"datacenter-id" : null,
"type" : "job",
"description" : null,
"node-id" : null,
"cluster-name" : "501cl-01",
"related-resources" : {
"job-nodes" : "http://127.0.0.1:8888/api/v2/lcm/jobs/f0a56ab3-1ec9-4f5a-8f53-cb4c683f2179/job_nodes/",
"cluster" : "http://127.0.0.1:8888/api/v2/lcm/clusters/716c1c44-4cc9-4080-9025-aea0a6bafb9d",
"job-events" : "http://127.0.0.1:8888/api/v2/lcm/jobs/f0a56ab3-1ec9-4f5a-8f53-cb4c683f2179/job_events/"
}
}
]
}
GET /api/v2/lcm/clusters/{id}/cacert
Gets the certificate-authority certificate that has been automatically generated for the cluster by LCM. This certificate will only be available if internode or client encryption has been enabled for the cluster, and a job has been successfully executed. If the cluster is not configured to require a certificate, or if it has not yet been created, this endpoint returns 404 not found
.
Path arguments: id: A Cluster ID.
Returns a PEM encoded x509 certificate with an http content-type of
application/x-x509-ca-cert
. Unlike most endpoints, this does not return JSON
, but a bare certificate.
Example:
curl http://localhost:8888/api/v2/lcm/clusters/716c1c44-4cc9-4080-9025-aea0a6bafb9d/cacert
Output:
-----BEGIN CERTIFICATE-----
MIIDnzCCAoegAwIBAgIJAJf/lm+zpp9SMA0GCSqGSIb3DQEBCwUAMGUxFjAUBgNV
BAMMDTEzMDA0LWNlcnQtY2wxETAPBgNVBAoMCERhdGFTdGF4MQ0wCwYDVQQLDARg
RFNFMQswCQYDVQQGEwJVUzEL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sFCsnXLs+DjHN
nvZDSyW09JeTrbml3zECuFiVVw==
-----END CERTIFICATE-----
GET /api/v2/lcm/clusters/
Gets a paginated list of all Cluster records. See Paginated Results for an overview of the query string parameters that can be used.
Example:
curl http://localhost:8888/api/v2/lcm/clusters/
Output:
{
"last" : 1,
"per-page" : 50,
"previous" : null,
"next" : null,
"current" : 1,
"count": 1,
"results": [
{
"type" : "cluster",
"opsc-cluster-id" : null,
"id" : "591ae107-2ef8-4c0f-b603-3b9f2d722d2f",
"href" : "http://localhost:8888/api/v2/lcm/clusters/591ae107-2ef8-4c0f-b603-3b9f2d722d2f",
"config-profile-id" : "4ff7a9ae-257c-4a6c-bfb0-b47299f39795",
"managed" : true,
"ssh-management-port" : 22,
"job-status" : "COMPLETE",
"modified-on" : "2016-06-06T17:12:00.738Z",
"created-on" : "2016-06-02T14:33:59.700Z",
"last-job-id" : "0370f668-3f53-478f-b29e-78d6bcc778d6",
"related-resources" : {
"datacenters" : "http://localhost:8888/api/v2/lcm/clusters/591ae107-2ef8-4c0f-b603-3b9f2d722d2f/datacenters/"
}
}
]
}
POST /api/v2/lcm/clusters/
Creates a new cluster record.
Body: A Cluster object (with no ID property).
When authentication is enabled for the configuration profile associated with the cluster, as is the case by default, it is necessary to provide old-password
and new-password
fields so that LCM can set a secure password on installation. For initial install, the old-password
should be set to cassandra
, which is the default out-of-the box password.
Returns the newly created Cluster object.
Example:
curl -X POST \
-d '{"name": "test-cluster-01", \
"machine-credential-id": "0f03dff7-1874-4c17-a823-ff79dba6e694", \
"repository-id": "7db37bd2-c23a-4ea6-a415-e9faaeb2060f", \
"old-password": "cassandra", \
"new-password": "datastax", \
"config-profile-id": "4ff7a9ae-257c-4a6c-bfb0-b47299f39795"}' \
http://localhost:8888/api/v2/lcm/clusters/
Output:
{
"created-by": "system",
"created-on": "2016-06-21T14:33:11.859Z",
"datacenter": [],
"type": "cluster",
"job-status": null,
"config-profile-id": "4ff7a9ae-257c-4a6c-bfb0-b47299f39795",
"modified-by": "system",
"opsc-cluster-id": null,
"ssh-management-port": 22,
"managed": true,
"repository-id": "7db37bd2-c23a-4ea6-a415-e9faaeb2060f",
"modified-on": "2016-06-21T14:33:11.859Z",
"machine-credential-id": "0f03dff7-1874-4c17-a823-ff79dba6e694",
"name": "test-cluster-01",
"comment": null,
"last-job-id": null,
"id": "108f74ab-0c5c-4bf7-8527-695e3e630e1a",
"href": "http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a",
"related-resources": {"datacenters": "http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a/datacenters/"}
}
PUT /api/v2/lcm/clusters/{id}
Updates an existing cluster record by ID. The cluster password can be changed by including old-password
and new-password
in the request body. The password change does not take effect until the next configure or upgrade job.
Path arguments: id: A Cluster ID.
Returns the updated Cluster object.
Example:
curl -X PUT -d '{"comment": "This is my new comment."}' http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a
Output:
{
"id": "108f74ab-0c5c-4bf7-8527-695e3e630e1a",
"name": "test-cluster-01",
"comment": "This is my new comment.",
"repository-id": "7db37bd2-c23a-4ea6-a415-e9faaeb2060f",
"machine-credential-id": "0f03dff7-1874-4c17-a823-ff79dba6e694",
"config-profile-id": "4ff7a9ae-257c-4a6c-bfb0-b47299f39795",
"datacenter": [],
"type": "cluster",
"job-status": null,
"related-resources": {
"datacenters": "http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a/datacenters/"
},
"modified-by": "system",
"created-on": "2016-06-21T14:33:11.859Z",
"opsc-cluster-id": null,
"ssh-management-port": 22,
"managed": true,
"modified-on": "2016-06-21T15:10:06.635Z",
"last-job-id": null,
"href": "http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a",
"created-by": "system"
}
DELETE /api/v2/lcm/clusters/{id}
Deletes an existing cluster record by ID. This is subject to foreign key constraint violations.
Path arguments: id: A Cluster ID.
Returns the IDs of the deleted objects.
Example:
curl -X DELETE http://localhost:8888/api/v2/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a
Output:
{"deleted": {"cluster": ["108f74ab-0c5c-4bf7-8527-695e3e630e1a"]}}