.. _lcm-datacenter: Datacenter ========== The datacenter model represents a Cassandra *datacenter* and is the parent (owner) of all :ref:`lcm-node` records. It contains information common to all nodes across the datacenter - such as workload types. .. container:: api-toc =============================== ==================================== :ref:`managing-datacenters` URL =============================== ==================================== Get a datacenter object by ID :http:method:`get-datacenter-object` Get a list of datacenters :http:method:`get-datacenter-list` Create a datacenter :http:method:`post-datacenter-object` Update a datacenter :http:method:`put-datacenter-object` Delete a datacenter :http:method:`delete-repository-object` =============================== ==================================== .. _managing-datacenters: Managing Datacenters -------------------- .. http:response:: Datacenter .. code-block:: js { "id": , "name": , "ssh-management-port": , "cluster-id": , "config-profile-id": , "machine-credential-id": , "converged-on": , "graph-enabled": , "hadoop-enabled": , "solr-enabled": , "spark-enabled": , "job-status": , "last-job-id": , "comment": } ============================== ========================================= 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 :ref:`lcm-cluster`. cluster-id The ID of the :ref:`lcm-cluster` that this datacenter belongs to. machine-credential-id The ID of the :ref:`lcm-machine-credential` to use for this datacenter. Defaults to the value inherited from the :ref:`lcm-cluster`. You should only use this if you have datacenters with different sets of credentials. Can be overridden at the :ref:`lcm-node` level. config-profile-id The ID of the :ref:`lcm-config-profile` to use for this datacenter. If set, can override values set in the :ref:`lcm-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 :ref:`lcm-jobs`. comment A comment that describes the Datacenter. ============================== ========================================= .. http:method:: GET /api/v1/lcm/datacenters/{id} :label-name: get-datacenter-object :title: GET /api/v1/lcm/datacenters/{id} Get a specific datacenter record by ID. :arg id: A :http:response:`datacenter` ID. Returns a :http:response:`datacenter` object. **Example**: .. code-block:: bash curl http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd Output: .. code-block:: js { "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" } .. http:method:: GET /api/v1/lcm/datacenters/ :label-name: get-datacenter-list :title: GET /api/v1/lcm/datacenters/ Gets a paginated list of all :http:response:`datacenter` records. See :ref:`lcm-pagination` for an overview of the query string parameters that can be used. **Example**: .. code-block:: bash curl http://localhost:8888/api/v1/lcm/datacenters/ Output: .. code-block:: js { "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" } ] } .. http:method:: POST /api/v1/lcm/datacenters/ :label-name: post-datacenter-object :title: POST /api/v1/lcm/datacenters/ Create a new datacenter record. :body: A :http:response:`datacenter` object (with no ID property). Returns the newly created :http:response:`datacenter` object. **Example**: .. code-block:: bash curl -X POST \ -d '{"name": "test-datacenter-1", \ "cluster-id": "6fae4354-e73c-40db-8d1b-4904764a68f3"}' \ http://localhost:8888/api/v1/lcm/datacenters/ Output: .. code-block:: js { "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" } .. http:method:: PUT /api/v1/lcm/datacenters/{id} :label-name: put-datacenter-object :title: PUT /api/v1/lcm/datacenters/{id} Update an existing datacenter record by ID. :arg id: A :http:response:`datacenter` ID. Returns the updated :http:response:`datacenter` object. **Example**: .. code-block:: bash curl -X PUT -d '{"comment": "A new comment."}' http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd Output: .. code-block:: js { "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" } .. http:method:: DELETE /api/v1/lcm/datacenters/{id} :label-name: delete-datacenter-object :title: DELETE /api/v1/lcm/datacenters/{id} Delete an existing datacenter record by ID. This is subject to foreign key constraint violations. :arg id: A :http:response:`datacenter` ID. Returns the IDs of the deleted objects. **Example**: .. code-block:: bash curl -X DELETE http://localhost:8888/api/v1/lcm/datacenters/eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd Output: .. code-block:: js {"deleted": {"datacenter": ["eb881a6c-75ce-4d43-8f42-0cddaa9b7bbd"]}}