Delete a node
DELETE api/nodes/hostname
Deletes a node.
Request syntax
delete api/nodes/<hostname>
Request parameters
The request accepts no parameters.
Response syntax
{
"exporter_job": integer,
"id": integer,
"installation_token": {
"uuid": "string",
"state": "string",
"expires_at": "string"
},
"node_name": "string",
"node_group_id": integer,
"store_number": integer,
"instance_number": integer,
"hostname": "string",
"serialno": "string",
"virtual": boolean,
"type_of_server": "string",
"hierarchy_field_id": "string",
"status": "string",
"keepalive_timestamp": integer,
"last_online": "string",
"created_at": "timestamp",
"updated_at": "timestamp",
"virtual_nodes": [],
"puppet_environment": "string",
"puppet_masterless": boolean,
"service_checks": {
"docker_versions": []
},
"available_docker_images": object
}
Response parameters
If the action is successful, an HTTP 200 response is returned. The following data is returned in JSON format.
| Field | Type | Description |
|---|---|---|
exporter_job | Integer | The ID of the job that exports the configuration change for the deleted node. |
id | Integer | The ID of the node. |
installation_token | Object | Details about the installation token. After deletion, state is inactive. |
node_name | String | The name of the node. |
node_group_id | Integer | The ID of the node group the node was a member of. |
store_number | Integer | The store number the node was associated with. |
instance_number | Integer | The instance number of the node. |
hostname | String | The hostname of the node. |
serialno | String | The serial number of the physical host of the node, in lowercase. |
virtual | Boolean | Whether or not this was a virtual node. |
type_of_server | String | The type associated with the server. If no type is associated, a null value is returned. |
hierarchy_field_id | Integer | The ID associated with the level of hierarchy field. |
status | String | The current status of the node. |
keepalive_timestamp | Integer | The UNIX epoch timestamp of the last keepalive transmission. Returns 0 if the node never sent one. |
last_online | String | The timestamp of the last time the node was confirmed online, or unknown if the node never checked in. |
created_at | Timestamp | The timestamp of when the node was created. |
updated_at | Timestamp | The timestamp of when the node was last updated. |
virtual_nodes | Array of objects | The virtual nodes associated with the node. |
puppet_environment | String | The Puppet environment associated with the node. This field relates to the Puppet agent. If no value is specified, a value of Production is used. |
puppet_masterless | Boolean | Whether or not Puppet is run in masterless mode. By default, this is disabled. |
service_checks | String array | The details about the service checks run on the node. |
available_docker_images | Array | The list of Docker images available to the node. |
Errors
The following are common errors returned by this API.
| Code | Message | Cause |
|---|---|---|
404 | Not found | No node exists with the specified hostname, or the node was already deleted. |
Examples
Example: Delete a node
This example deletes a node with hostname sit0000red1.
ruby api.rb <customer_code> delete api/nodes/sit0000red1
Response
{
"exporter_job": 1544782,
"id": 119996,
"installation_token": {
"uuid": null,
"state": "inactive",
"expires_at": null
},
"node_name": "sit0000red1",
"node_group_id": 2235,
"store_number": 2235,
"instance_number": 1,
"hostname": "sit0000red1",
"serialno": null,
"virtual": false,
"type_of_server": null,
"hierarchy_field_id": null,
"status": "unknown",
"keepalive_timestamp": 1726501979,
"last_online": "unknown",
"created_at": "2024-09-16T15:39:48.192Z",
"updated_at": "2024-09-16T15:56:03.824Z",
"virtual_nodes": [],
"puppet_environment": null,
"puppet_masterless": null,
"service_checks": {
"docker_versions": []
},
"available_docker_images": null
}