Node¶
The node model represents an individual node in a DSE cluster.
Managing Nodes | URL |
---|---|
Get a node object by ID | GET /api/v2/lcm/nodes/{id} |
Get a list of nodes | GET /api/v2/lcm/nodes/ |
Create a node | POST /api/v2/lcm/nodes/ |
Update a node | PUT /api/v2/lcm/nodes/{id} |
Delete a node | DELETE /api/v2/lcm/nodes/{id} |
Managing Nodes¶
- Node
{ "id": <value>, "name": <value>, "datacenter-id": <value>, "ssh-management-address": <value>, "ssh-management-port": <value>, "listen-address": <value>, "native-transport-address": <value>, "broadcast-address": <value>, "native-transport-broadcast-address": <value>, "config-profile-id": <value>, "machine-credential-id": <value>, "initial-token": <value>, "facts": {"<key>": <value>}, "seed": <value>, "auto-bootstrap": <value>, "rack": <value>, "job-status": <value>, "last-job-id": <value>, "comment": <value> }
Property Description of Values name A name for the node. datacenter-id The ID of the Datacenter that this node belongs to. ssh-management-address The IP address of the node for access over SSH. Must be reachable from the OpsCenter server. This field is required, and in very simple network setups may be the only address field required. ssh-management-port SSH port on the managed node. Defaults to the value inherited from the Datacenter. listen-address Goes directly into the listen_address property in cassandra.yaml. Defaults to the ssh-management-address. native-transport-address Goes directly into the native_transport_address property (or rpc_address in DSE versions previous to 6.0.0) in cassandra.yaml. Defaults to the ssh-rpc-address. broadcast-address Goes directly into the broadcast_address property in cassandra.yaml. Defaults to the listen-address. native-transport-broadcast-address Goes directly into the native_transport_broadcast_address property (or broadcast_rpc_address in DSE versions previous to 6.0.0) in cassandra.yaml. Defaults to the native-transport-address. config-profile-id The ID of the Config Profile to use for this node. If set, can override values set in the Datacenter profile. machine-credential-id The ID of the Machine Credentials to use for this node. Defaults to the value inherited from the Datacenter. You would only use this if you have nodes with different credentials. initial-token In non-vnode clusters, this specifies the initial_token value in cassandra.yaml. If not set, LCM will auto-calculate initial-tokens at the beginning of the install job. facts When a job runs on a node, the first thing it does is post back relevant facts about the target node, which may include the contents of pre-existing config files (like cassandra.yaml). This is used heavily in cluster import jobs. seed When set to true, forces this node to be a seed. When set to false, prevents it from being a seed. If left unset, will make it available for auto-selection. You can leave this unset on all nodes if you simply want LCM to pick seeds for you. auto-bootstrap Similar to seed, can be set explicitly to populate the auto_bootstrap field in cassandra.yaml. If left unset, LCM will try to set it automatically based on the state of the cluster (if the datacenter was previously converged by LCM, it will set it to true). rack The rack name for this node. job-status The most recent job status for this node. Read-only. last-job-id Read-only field indicating the last job run on this node. See Jobs. comment A generic field for user comments.
- GET /api/v2/lcm/nodes/{id}¶
Gets a specific node record by ID.
Path arguments: id – A Node ID. Returns a Node object.
Example:
curl http://localhost:8888/api/v2/lcm/nodes/1166a7cd-f57b-4453-9592-4582764fd1e4
Output:
{ "auto-bootstrap": null, "broadcast-address": null, "native-transport-broadcast-address": null, "comment": null, "config-profile-id": null, "created-by": "system", "created-on": "2016-06-21T19:07:26.477Z", "datacenter-id": "ea6dbbdf-6ca7-483c-93b1-aff3f6029d5a", "facts": {}, "href": "http://localhost:8888/api/v2/lcm/nodes/1166a7cd-f57b-4453-9592-4582764fd1e4", "id": "1166a7cd-f57b-4453-9592-4582764fd1e4", "initial-token": null, "job-status": null, "last-job-id": null, "listen-address": null, "machine-credential-id": null, "modified-by": "system", "modified-on": "2016-06-21T19:07:26.477Z", "name": "test-node", "rack": "rack1", "related-resources": { "datacenter": "http://localhost:8888/api/v2/lcm/datacenters/ea6dbbdf-6ca7-483c-93b1-aff3f6029d5a" }, "native-transport-address": null, "seed": null, "ssh-management-address": "10.10.10.100", "ssh-management-port": null, "type": "node" }
- GET /api/v2/lcm/nodes/¶
Gets a paginated list of all Node records. See Paginated Results for an overview of the query string parameters that can be used.
Example:
curl http://localhost:8888/api/v2/lcm/nodes/
Output:
{ "count": 4, "current": 1, "last": 1, "next": null, "per-page": 50, "previous": null, "results": [ { "broadcast-address": null, "native-transport-broadcast-address": null, "config-profile-id": null, "created-on": "2016-06-21T19:07:26.477Z", "datacenter-id": "ea6dbbdf-6ca7-483c-93b1-aff3f6029d5a", "href": "http://localhost:8888/api/v2/lcm/nodes/1166a7cd-f57b-4453-9592-4582764fd1e4", "id": "1166a7cd-f57b-4453-9592-4582764fd1e4", "job-status": null, "last-job-id": null, "listen-address": null, "modified-on": "2016-06-21T19:07:26.477Z", "name": "test-node", "rack": "rack1", "related-resources": { "datacenter": "http://localhost:8888/api/v2/lcm/datacenters/ea6dbbdf-6ca7-483c-93b1-aff3f6029d5a" }, "native-transport-address": null, "seed": null, "ssh-management-address": "10.10.10.100", "ssh-management-port": null, "type": "node" } ], }
- POST /api/v2/lcm/nodes/¶
Creates a new node record.
Body: A Node object (with no ID property). Returns the newly created Node object.
Example:
curl -X POST \ -d '{"name": "test-node", "datacenter-id": "ea6dbbdf-6ca7-483c-93b1-aff3f6029d5a", "ssh-management-address": "10.10.10.100"}' \ http://localhost:8888/api/v2/lcm/nodes/
Output:
{ "auto-bootstrap": null, "broadcast-address": null, "native-transport-broadcast-address": null, "comment": null, "config-profile-id": null, "created-by": "system", "created-on": "2016-06-21T19:07:26.477Z", "datacenter-id": "ea6dbbdf-6ca7-483c-93b1-aff3f6029d5a", "facts": {}, "href": "http://localhost:8888/api/v2/lcm/nodes/1166a7cd-f57b-4453-9592-4582764fd1e4", "id": "1166a7cd-f57b-4453-9592-4582764fd1e4", "initial-token": null, "job-status": null, "last-job-id": null, "listen-address": null, "machine-credential-id": null, "modified-by": "system", "modified-on": "2016-06-21T19:07:26.477Z", "name": "test-node", "rack": "rack1", "related-resources": { "datacenter": "http://localhost:8888/api/v2/lcm/datacenters/ea6dbbdf-6ca7-483c-93b1-aff3f6029d5a" }, "native-transport-address": null, "seed": null, "ssh-management-address": "10.10.10.100", "ssh-management-port": null, "type": "node" }
- PUT /api/v2/lcm/nodes/{id}¶
Updates an existing node record by ID.
Path arguments: id – A Node ID. Returns the updated Node object.
Example:
curl -X PUT -d '{"comment": "A new comment."}' http://localhost:8888/api/v2/lcm/nodes/1166a7cd-f57b-4453-9592-4582764fd1e4
Output:
{ "auto-bootstrap": null, "broadcast-address": null, "native-transport-broadcast-address": null, "comment": "A new comment.", "config-profile-id": null, "created-by": "system", "created-on": "2016-06-21T19:07:26.477Z", "datacenter-id": "ea6dbbdf-6ca7-483c-93b1-aff3f6029d5a", "facts": {}, "href": "http://localhost:8888/api/v2/lcm/nodes/1166a7cd-f57b-4453-9592-4582764fd1e4", "id": "1166a7cd-f57b-4453-9592-4582764fd1e4", "initial-token": null, "job-status": null, "last-job-id": null, "listen-address": null, "machine-credential-id": null, "modified-by": "system", "modified-on": "2016-06-21T19:28:11.092Z", "name": "test-node", "rack": "rack1", "related-resources": { "datacenter": "http://localhost:8888/api/v2/lcm/datacenters/ea6dbbdf-6ca7-483c-93b1-aff3f6029d5a" }, "native-transport-address": null, "seed": null, "ssh-management-address": "10.10.10.100", "ssh-management-port": null, "type": "node" }
- DELETE /api/v2/lcm/nodes/{id}¶
Deletes an existing node record by ID. This is subject to foreign key constraint violations.
Path arguments: id – A Node ID. Returns the IDs of the deleted objects.
Example:
curl -X DELETE http://localhost:8888/api/v2/lcm/nodes/400758df-c723-4709-8327-99283b451969
Output:
{"deleted": {"node": ["1166a7cd-f57b-4453-9592-4582764fd1e4"]}}