Delete a node

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.

FieldTypeDescription
exporter_jobIntegerThe ID of the job that exports the configuration change for the deleted node.
idIntegerThe ID of the node.
installation_tokenObjectDetails about the installation token. After deletion, state is inactive.
node_nameStringThe name of the node.
node_group_idIntegerThe ID of the node group the node was a member of.
store_numberIntegerThe store number the node was associated with.
instance_numberIntegerThe instance number of the node.
hostnameStringThe hostname of the node.
serialnoStringThe serial number of the physical host of the node, in lowercase.
virtualBooleanWhether or not this was a virtual node.
type_of_serverStringThe type associated with the server. If no type is associated, a null value is returned.
hierarchy_field_idIntegerThe ID associated with the level of hierarchy field.
statusStringThe current status of the node.
keepalive_timestampIntegerThe UNIX epoch timestamp of the last keepalive transmission. Returns 0 if the node never sent one.
last_onlineStringThe timestamp of the last time the node was confirmed online, or unknown if the node never checked in.
created_atTimestampThe timestamp of when the node was created.
updated_atTimestampThe timestamp of when the node was last updated.
virtual_nodesArray of objectsThe virtual nodes associated with the node.
puppet_environmentStringThe 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_masterlessBooleanWhether or not Puppet is run in masterless mode. By default, this is disabled.
service_checksString arrayThe details about the service checks run on the node.
available_docker_imagesArrayThe list of Docker images available to the node.

Errors

The following are common errors returned by this API.

CodeMessageCause
404Not foundNo 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
}