.. _lcm-overview: Cluster Lifecycle Management ============================ The Lifecycle Manager (LCM) API provides tools for provisioning and configuring DSE on existing hardware or virtual machines. This is a RESTful API that supports everything provided by the OpsCenter LCM user interface and allows for greater control and automation by API users. Lifecycle Manager implements a centralized approach to configuration management and installation. The OpsCenter server maintains what the state of the cluster should be and :ref:`lcm-jobs` are what *make it so*. With the exception of a cluster import, LCM always *pushes* configuration to the nodes. It does not attempt to reconcile differences between configuration state on the nodes and what it thinks the state should be. Thus, any local hand-made changes to configs on the nodes will be overwritten by the next configure job. * :ref:`lcm-repository` yum/apt repository information for access to DSE packages. * :ref:`lcm-machine-credential` SSH credentials and privilege escalation (sudo/su). * :ref:`lcm-config-profile` configuration settings for DSE components (cassandra.yaml, dse.yaml, etc...) * :ref:`lcm-definitions` config file definitions - describing the structure, properties, and rendering options for config files. * :ref:`lcm-cluster` information about the DSE cluster. Contains datacenters. * :ref:`lcm-datacenter` information about DSE datacenters. Contains nodes. * :ref:`lcm-node` information about individual DSE nodes. * :ref:`lcm-jobs` information about the job system. * :ref:`lcm-walkthru` a step-by-step walk-through for defining and installing a DSE cluster. .. _lcm-common-response-properties: Common Response Properties -------------------------- Most objects returned by API endpoints share a set of common properties, many of which are transient or read-only. These include: ==================== ==================================================== Property Description of Value ==================== ==================================================== id A UUID surrogate key for the object. Used in URLs to identify the object. type The object type. created-on A timestamp indicating when the object was created. created-by Who created the object. [#f1]_ modified-on A timestamp indicating the last time the object was changed. modified-by Who changed the object. [#f1]_ href The full URL to the object. related-resources A map of resource name (i.e., "datacenters") to a full URL to the resource. ==================== ==================================================== **Example**: .. code-block:: js { "id": "ba908cb4-9116-4cf9-abe6-694ad75b70d3", "type": "machine-credential", "created-on": "2016-06-20T21:00:41.405Z", "created-by": "system", "modified-on": "2016-06-20T21:00:41.405Z", "modified-by": "system", "href": "http://localhost:8888/api/v1/lcm/machine_credentials/ba908cb4-9116-4cf9-abe6-694ad75b70d3", "related-resources": { "datacenters": "http://localhost:8888/api/v1/lcm/machine_credentials/ba908cb4-9116-4cf9-abe6-694ad75b70d3/datacenters/", "nodes": "http://localhost:8888/api/v1/lcm/machine_credentials/ba908cb4-9116-4cf9-abe6-694ad75b70d3/nodes/", "clusters": "http://localhost:8888/api/v1/lcm/machine_credentials/ba908cb4-9116-4cf9-abe6-694ad75b70d3/clusters/" }, // type-specific properties... "name": "my cluster creds", "use-ssh-keys": false, "login-user": "johndoe" } .. _lcm-pagination: Paginated Results ----------------- There are a number of API endpoints that return listings of objects. All of these return a *paginated* list of results, with each *page* limited to a certain [configurable] number of objects to avoid very large response sizes. All paginated results have the following properties: ==================== ==================================================== Properties Description of Value ==================== ==================================================== results The list of objects in the current page. count The total number of results (across all pages). per-page Limits the number of objects per page. current The current page number. previous The previous page number. Will be null when on the first page. next The next page number. Will be null when on the last page. ==================== ==================================================== **Example**: .. code-block:: js { "next": null, "previous": null, "last": 1, "count": 1, "per-page": 50, "current": 1, "results": [ { "created-on": "2016-06-20T21:00:41.405Z", "type": "machine-credential", "related-resources": { "datacenters": "http://localhost:8888/api/v1/lcm/machine_credentials/ba908cb4-9116-4cf9-abe6-694ad75b70d3/datacenters/", "nodes": "http://localhost:8888/api/v1/lcm/machine_credentials/ba908cb4-9116-4cf9-abe6-694ad75b70d3/nodes/", "clusters": "http://localhost:8888/api/v1/lcm/machine_credentials/ba908cb4-9116-4cf9-abe6-694ad75b70d3/clusters/" }, "modified-on": "2016-06-20T21:00:41.405Z", "name": "my cluster creds", "login-user": "johndoe", "id": "ba908cb4-9116-4cf9-abe6-694ad75b70d3", "href": "http://localhost:8888/api/v1/lcm/machine_credentials/ba908cb4-9116-4cf9-abe6-694ad75b70d3" } ] } All endpoints with paginated results support the following query string parameters, in addition to supporting object-specific field filters for most fields [#f2]_. ==================== ==================================================== Query String Param Description of Value ==================== ==================================================== per-page Changes the page-size limit (up to 300 max). page The page number to fetch. Not required for page 1. order An object field to order by. Only 1 order field is supported at this time. direction Sort direction: ASC or DESC for ascending (default) or descending. Filter results by field value. Multiple field filters are supported, and are ANDed together. There are some limitations [#f2]_. ==================== ==================================================== **Example**: .. code-block:: bash curl http://localhost:8888/api/v1/lcm/machine_credentials/?login-user=johndoe&page=5&per-page=10&order=created-on&direction=DESC .. rubric:: Footnotes .. [#f1] Currently only 'system' is used for ``created-by`` and ``modified-by``. This will support user names for auditing in a future release. .. [#f2] Field filter support is currently very simple and has the following limitations: * timestamp fields are not currently supported (``created-on``, ``modified-on``), although they can be used as an ``order`` field. * multiple filters are ANDed. OR is not supported. * only equality is supported, no ranges or inequalities. * IN and LIKE are not supported.