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:

Managing Clusters URL
Get a cluster object by ID GET /api/v1/lcm/clusters/{id}
Get a list of clusters GET /api/v1/lcm/clusters/
Create a cluster POST /api/v1/lcm/clusters/
Update a cluster PUT /api/v1/lcm/clusters/{id}
Delete a cluster DELETE /api/v1/lcm/repositories/{id}

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>,
    "has-default-password" : <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 Datacenter and/or Node level.
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 true. This is used by OpsCenter to support agent installation through LCM without using LCM for DSE installation or configuration.
last-job-id The ID of the last job run on this cluster. See Jobs.
opsc-cluster-id A unique ID to link LCM’s cluster model with OpsCenter’s. This is read-only for API consumers, and is set internally at the tail end of the first install job.
comment A generic field for user comments.
GET /api/v1/lcm/clusters/{id}

Get a specific cluster record by ID.

Path arguments:id – A Cluster ID.

Returns a Cluster object.

Example:

curl http://localhost:8888/api/v1/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",
    "has-default-password" : true,
    "href" : "http://localhost:8888/api/v1/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a",
    "related-resources" : {
       "datacenters" : "http://localhost:8888/api/v1/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a/datacenters/"
    },
}
GET /api/v1/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/v1/lcm/clusters/

Output:

{
    "last" : 1,
    "per-page" : 50,
    "previous" : null,
    "next" : null,
    "current" : 1,
    "count": 1,
    "results": [
        {
            "type" : "cluster",
            "has-default-password" : true,
            "opsc-cluster-id" : null,
            "id" : "591ae107-2ef8-4c0f-b603-3b9f2d722d2f",
            "href" : "http://localhost:8888/api/v1/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/v1/lcm/clusters/591ae107-2ef8-4c0f-b603-3b9f2d722d2f/datacenters/"
            }
        }
    ]
}
POST /api/v1/lcm/clusters/

Create a new cluster record.

Body:A Cluster object (with no ID property).

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", \
          "config-profile-id": "4ff7a9ae-257c-4a6c-bfb0-b47299f39795"}' \
     http://localhost:8888/api/v1/lcm/clusters/

Output:

{
    "created-by": "system",
    "created-on": "2016-06-21T14:33:11.859Z",
    "datacenter": [],
    "type": "cluster",
    "has-default-password": true,
    "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/v1/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a",
    "related-resources": {"datacenters": "http://localhost:8888/api/v1/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a/datacenters/"}
}
PUT /api/v1/lcm/clusters/{id}

Update an existing cluster record by ID.

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/v1/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/v1/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/v1/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a",
    "has-default-password": true,
    "created-by": "system"
}
DELETE /api/v1/lcm/clusters/{id}

Delete 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/v1/lcm/clusters/108f74ab-0c5c-4bf7-8527-695e3e630e1a

Output:

{"deleted": {"cluster": ["108f74ab-0c5c-4bf7-8527-695e3e630e1a"]}}