Datacenter

The datacenter model represents a Cassandra datacenter and is the parent (owner) of all Node records. It contains information common to all nodes across the datacenter - such as workload types.

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

Managing Datacenters

Datacenter
{
    "id": <value>,
    "name": <value>,
    "ssh-management-port": <value>,
    "cluster-id": <value>,
    "config-profile-id": <value>,
    "machine-credential-id": <value>,
    "converged-on": <value>,
    "graph-enabled": <value>,
    "hadoop-enabled": <value>,
    "solr-enabled": <value>,
    "spark-enabled": <value>,
    "job-status": <value>,
    "last-job-id": <value>,
    "comment": <value>
}
Property Description of Values
id A UUID for the Datacenter.
name The name of the Datacenter. Required.
ssh-management-port SSH port on managed nodes. Defaults to the value inherited from the Cluster.
cluster-id The ID of the Cluster that this datacenter belongs to.
machine-credential-id The ID of the Machine Credentials to use for this datacenter. Defaults to the value inherited from the Cluster. You should only use this if you have datacenters with different sets of credentials. Can be overridden at the Node level.
config-profile-id The ID of the Config Profile to use for this datacenter. If set, can override values set in the Cluster profile.
converged-on A read-only timestamp indicating the last time that configuration was pushed successfully to all nodes in this datacenter. This can possibly be used to determine if configuration is dirty.
graph-enabled Enable the Graph workload type. Only affects DSE 5.0+. Defaults to false.
hadoop-enabled Enable the Hadoop workload type. Defaults to false.
solr-enabled Enable the Solr workload type. Defaults to false.
spark-enabled Enable the Spark workload type. Defaults to false.
last-job-id Read-only field indicating the last job run on this datacenter. See Jobs.
comment A comment that describes the Datacenter.
GET /api/v1/lcm/datacenters/{id}

Get a specific datacenter record by ID.

Path arguments:id – A Datacenter ID.

Returns a Datacenter object.

Example:

curl http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd

Output:

{
    "cluster-id": "6fae4354-e73c-40db-8d1b-4904764a68f3",
    "comment": null,
    "config-profile-id": null,
    "converged-on": null,
    "created-by": "system",
    "created-on": "2016-06-21T18:28:50.894Z",
    "graph-enabled": false,
    "hadoop-enabled": false,
    "href": "http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd",
    "id": "eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd",
    "job-status": null,
    "last-job-id": null,
    "machine-credential-id": null,
    "modified-by": "system",
    "modified-on": "2016-06-21T18:28:50.894Z",
    "name": "test-datacenter-1",
    "related-resources": {
        "cluster": "http://localhost:8888/api/v1/lcm/clusters/6fae4354-e73c-40db-8d1b-4904764a68f3",
        "nodes": "http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd/nodes/"
    },
    "solr-enabled": false,
    "spark-enabled": false,
    "ssh-management-port": null,
    "type": "datacenter"
}
GET /api/v1/lcm/datacenters/

Gets a paginated list of all Datacenter records. See Paginated Results for an overview of the query string parameters that can be used.

Example:

curl http://localhost:8888/api/v1/lcm/datacenters/

Output:

{
    "count": 1,
    "current": 1,
    "last": 1,
    "next": null,
    "per-page": 50,
    "previous": null,
    "results": [
        {
            "cluster-id": "591ae107-2ef8-4c0f-b603-3b9f2d722d2f",
            "config-profile-id": null,
            "converged-on": "2016-06-02T14:58:50.444Z",
            "created-on": "2016-06-02T14:35:01.981Z",
            "graph-enabled": false,
            "hadoop-enabled": false,
            "href": "http://localhost:8888/api/v1/lcm/datacenters/a9f20bb5-c0c9-4d7e-8e3f-ed993807926b",
            "id": "a9f20bb5-c0c9-4d7e-8e3f-ed993807926b",
            "job-status": "COMPLETE",
            "last-job-id": null,
            "modified-on": "2016-06-02T14:58:50.444Z",
            "name": "test-dc-1",
            "related-resources": {
                "cluster": "http://localhost:8888/api/v1/lcm/clusters/591ae107-2ef8-4c0f-b603-3b9f2d722d2f",
                "nodes": "http://localhost:8888/api/v1/lcm/datacenters/a9f20bb5-c0c9-4d7e-8e3f-ed993807926b/nodes/"
            },
            "solr-enabled": false,
            "spark-enabled": false,
            "ssh-management-port": null,
            "type": "datacenter"
        }
    ]
}
POST /api/v1/lcm/datacenters/

Create a new datacenter record.

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

Returns the newly created Datacenter object.

Example:

curl -X POST \
     -d '{"name": "test-datacenter-1", \
          "cluster-id": "6fae4354-e73c-40db-8d1b-4904764a68f3"}' \
     http://localhost:8888/api/v1/lcm/datacenters/

Output:

{
    "cluster-id": "6fae4354-e73c-40db-8d1b-4904764a68f3",
    "comment": null,
    "config-profile-id": null,
    "converged-on": null,
    "created-by": "system",
    "created-on": "2016-06-21T18:28:50.894Z",
    "graph-enabled": false,
    "hadoop-enabled": false,
    "href": "http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd",
    "id": "eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd",
    "job-status": null,
    "last-job-id": null,
    "machine-credential-id": null,
    "modified-by": "system",
    "modified-on": "2016-06-21T18:28:50.894Z",
    "name": "test-datacenter-1",
    "related-resources": {
        "cluster": "http://localhost:8888/api/v1/lcm/clusters/6fae4354-e73c-40db-8d1b-4904764a68f3",
        "nodes": "http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd/nodes/"
    },
    "solr-enabled": false,
    "spark-enabled": false,
    "ssh-management-port": null,
    "type": "datacenter"
}
PUT /api/v1/lcm/datacenters/{id}

Update an existing datacenter record by ID.

Path arguments:id – A Datacenter ID.

Returns the updated Datacenter object.

Example:

curl -X PUT -d '{"comment": "A new comment."}' http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd

Output:

{
    "cluster-id": "6fae4354-e73c-40db-8d1b-4904764a68f3",
    "comment": "A new comment.",
    "config-profile-id": null,
    "converged-on": null,
    "created-by": "system",
    "created-on": "2016-06-21T18:28:50.894Z",
    "graph-enabled": false,
    "hadoop-enabled": false,
    "href": "http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd",
    "id": "eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd",
    "job-status": null,
    "last-job-id": null,
    "machine-credential-id": null,
    "modified-by": "system",
    "modified-on": "2016-06-21T18:38:57.680Z",
    "name": "test-datacenter-1",
    "related-resources": {
        "cluster": "http://localhost:8888/api/v1/lcm/clusters/6fae4354-e73c-40db-8d1b-4904764a68f3",
        "nodes": "http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd/nodes/"
    },
    "solr-enabled": false,
    "spark-enabled": false,
    "ssh-management-port": null,
    "type": "datacenter"
}
DELETE /api/v1/lcm/datacenters/{id}

Delete an existing datacenter record by ID. This is subject to foreign key constraint violations.

Path arguments:id – A Datacenter ID.

Returns the IDs of the deleted objects.

Example:

curl -X DELETE http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd

Output:

{"deleted": {"datacenter": ["eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd"]}}