Archive nodes
You can classify a node as archived on Chef 360 Platform, which removes it from active node management and prevents Chef 360 Platform from performing operations on it, while preserving its data for historical reference.
Archived nodes don’t appear in node views, filters, or lists and can’t be targeted for Chef 360 Platform operations.
Archiving a node doesn’t remove its installed skills. If a node checks in with Chef 360 Platform using the Node Management agent, Chef 360 Platform automatically unarchives it and the node resumes normal operations.
Role requirements
To archive or manage archived nodes, you must have a profile with the node-manager or tenant-admin role.
Archive a single node
You can archive a single node using the archive-node command:
chef-node-management-cli management node archive-node \
--nodeId <NODE_ID> \
--profile <NODE_MANAGER_PROFILE_NAME>
The response is similar to the following:
{
"code": 200,
"message": "archive-node successful"
}
Archive multiple nodes
To archive multiple nodes in a single bulk operation, follow these steps:
Create a JSON file with the node IDs:
{ "nodeIds": [ "<NODE_ID_1>", "<NODE_ID_2>" ] }Archive the nodes using the
archive-nodes-bulkcommand:chef-node-management-cli management node archive-nodes-bulk \ --body-file <PATH_TO_FILE> \ --profile <NODE_MANAGER_PROFILE_NAME>The response is similar to the following:
{ "items": [ { "isArchived": true, "nodeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "message": "node archived successfully" }, { "isArchived": true, "nodeId": "7b4c2d91-8e3f-4a1b-9c5e-6f2d8a9b4e3c", "message": "node archived successfully" } ] }
Get the archive status of a single node
To get the archive status of a single node, use the get-archive-status command:
chef-node-management-cli management node get-archive-status \
--nodeId <NODE_ID> \
--profile <NODE_MANAGER_PROFILE_NAME>
The response is similar to the following:
{
"item": {
"isArchived": true
}
}
You can also use the find-one-node command, which includes the isArchived field in its response. For example:
chef-node-management-cli management node find-one-node \
--nodeId <NODE_ID> \
--profile <NODE_MANAGER_PROFILE_NAME>
The response is similar to the following:
{
"item": {
"id": "dc203374-57d6-4e21-83c3-c69c85cc9bfb",
"healthStatus": "online",
"enrollmentLevel": "enrolled",
"isArchived": false,
"attributes": [...],
"installedSkills": [...]
}
}
Get archive status for multiple nodes
To retrieve the archive status for multiple nodes, use the get-archive-status-bulk command:
Create a JSON file with the node IDs:
{ "nodeIds": [ "<NODE_ID_1>", "<NODE_ID_2>", "<NODE_ID_3>" ] }Get the archive status:
chef-node-management-cli management node get-archive-status-bulk \ --body-file <PATH_TO_FILE> \ --profile <NODE_MANAGER_PROFILE_NAME>The response is similar to the following:
[ { "nodeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "isArchived": true, "message": "" }, { "nodeId": "7b4c2d91-8e3f-4a1b-9c5e-6f2d8a9b4e3c", "isArchived": false, "message": "" }, { "nodeId": "9d2a4f7e-1c8b-4e6a-a3d5-8f9b2e4c6d1a", "isArchived": false, "message": "Given nodeId is not Found" } ]
List nodes by archive status
To list nodes based on their archived status, use the find-all-nodes command with the --isArchived flag.
chef-node-management-cli management node find-all-nodes \
--isArchived <true|false> \
--profile <NODE_MANAGER_PROFILE_NAME>
The command accepts the following option:
--isArchived- Returns nodes that are either archived (
true) or not archived (false). Default value:false.
The response is similar to the following:
{
"items": [
{
"id": "dc203374-57d6-4e21-83c3-c69c85cc9bfb",
"healthStatus": "online",
"enrollmentLevel": "enrolled",
"isArchived": false,
"attributes": [...],
"installedSkills": [...]
}
]
}