Datacenter

The datacenter model represents a DataStax Enterprise datacenter and is the parent (owner) of all ref:api:cluster-info.adoc#response-node[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 a list of datacenters

Get nodes in a datacenter

Create a datacenter

Update a datacenter

Delete a datacenter

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 to which this datacenter belongs.

machine-credential-id

The ID of the Cluster 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 Machine Credentials 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. This field is deprecated, and only used to disable Hadoop prior to upgrading to OpsCenter 6.1.

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 lifecyclemanager-jobs.

comment

GET /api/v2/lcm/datacenters/{id}

Gets a specific datacenter record by ID.

Path arguments: id: A Datacenter ID.

Returns a Datacenter object.

Example:

 curl http://localhost:8888/api/v2/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/v2/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/v2/lcm/clusters/6fae4354-e73c-40db-8d1b-4904764a68f3",
                "nodes": "http://localhost:8888/api/v2/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd/nodes/"
            },
            "solr-enabled": false,
            "spark-enabled": false,
            "ssh-management-port": null,
            "type": "datacenter"
        }

GET /api/v2/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/v2/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/v2/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/v2/lcm/clusters/591ae107-2ef8-4c0f-b603-3b9f2d722d2f",
                "nodes": "http://localhost:8888/api/v2/lcm/datacenters/a9f20bb5-c0c9-4d7e-8e3f-ed993807926b/nodes/"
            },
            "solr-enabled": false,
            "spark-enabled": false,
            "ssh-management-port": null,
            "type": "datacenter"
        }
    ]
}

GET /api/v2/lcm/datacenters/{id}/nodes/

Gets a list of nodes associated with a specific datacenter record using the datacenter ID. This endpoint performs a 302 redirect, which api clients must follow.

Path arguments: id: A Datacenter 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 -L http://localhost:8888/api/v2/lcm/datacenters/1e14eebc-d30c-4076-a7b1-194be9b33098/nodes/

Output:

        {
            "count": 1,
            "current": 1,
            "last": 1,
            "next": null,
            "per-page": 50,
            "previous": null,
            "results": [
                {
                    "ssh-management-port" : null,
                    "name" : "cert-node",
                    "native-transport-broadcast-address" : null,
                    "datacenter-id" : "1e14eebc-d30c-4076-a7b1-194be9b33098",
                    "machine-credential-id" : null,
                    "job-status" : "COMPLETE",
                    "config-profile-id" : null,
                    "seed" : true,
                    "native-transport-address" : null,
                    "type" : "node",
                    "rack" : "rack1",
                    "created-on" : "2017-09-19T19:54:15.911Z",
                    "listen-address" : null,
                    "comment" : null,
                    "broadcast-address" : null,
                    "last-job-id" : "6d7dd985-e911-4632-8f4c-5a92be014904",
                    "modified-on" : "2017-09-19T20:10:11.293Z",
                    "href" : "http://127.0.0.1:8888/api/v2/lcm/nodes/9a561776-b468-4d2c-8bf7-2a1765300ce3",
                    "ssh-management-address" : "10.191.206.171",
                    "id" : "9a561776-b468-4d2c-8bf7-2a1765300ce3",
                    "related-resources" : {
                        "datacenter" : "http://127.0.0.1:8888/api/v2/lcm/datacenters/1e14eebc-d30c-4076-a7b1-194be9b33098"
                    }
                }
            ]
        }

POST /api/v2/lcm/datacenters/

Creates 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/v2/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/v2/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/v2/lcm/clusters/6fae4354-e73c-40db-8d1b-4904764a68f3",
                "nodes": "http://localhost:8888/api/v2/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd/nodes/"
            },
            "solr-enabled": false,
            "spark-enabled": false,
            "ssh-management-port": null,
            "type": "datacenter"
        }

PUT /api/v2/lcm/datacenters/{id}

Updates 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/v2/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/v2/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/v2/lcm/clusters/6fae4354-e73c-40db-8d1b-4904764a68f3",
                "nodes": "http://localhost:8888/api/v2/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd/nodes/"
            },
            "solr-enabled": false,
            "spark-enabled": false,
            "ssh-management-port": null,
            "type": "datacenter"
        }

DELETE /api/v2/lcm/datacenters/{id}

Deletes 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/v2/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd

Output:

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

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com