Retrieve all nodes
GET api/nodes
Retrieves all nodes from all node groups. The response includes all system properties and their respective virtual nodes for each node, as well as all dynamic properties.
Request syntax
get api/nodes
Request parameters
The request accepts the following data in JSON format.
| Parameter | Type | Description | Required | Default value |
|---|---|---|---|---|
page | Integer | The page number to be retrieved. | No | 1 |
page_size | Integer | The number of nodes to return per page. The maximum value is 1000. | No | 1000 |
resolve_refs | Boolean | This resolves property references. | No | true |
properties | String | By default, only system properties are returned. Specifying the properties reference along with a list of dynamic properties allows you to retrieve dynamic property values. | No | By default, only system properties are returned. |
Response syntax
{
"page": number,
"page_size": number,
"pages_total": number,
"items_total": number,
"nodes": [
{
"id": number,
"created_at": "timestamp",
"updated_at": "timestamp",
"instance_number": number,
"store_number": number,
"node_name": "string",
"node_group_id": number,
"hostname": "string",
"serialno": "string",
"node_id": number,
"virtual": boolean,
"type_of_server": "string",
"hierarchy_field_id": "string",
"puppet_profiles_order": [
],
"rje_environment": "string",
"available_docker_images": {
"images": [
{
"ID": "string",
"Tag": "string",
"Size": "string",
"Digest": "string",
"CreatedAt": "string",
"Containers": "string",
"Repository": "string",
"SharedSize": "string",
"UniqueSize": "string",
"VirtualSize": "string",
"CreatedSince": "string"
}
],
"last_checked": timestamp
},
"puppet_masterless": boolean,
"puppet_environment": "string",
"status": "string",
"last_online": "string",
"keepalive_timestamp": number,
"installation_status": "string",
"installation_status_message": "string",
"installation_status_updated_at": timestamp
}
]
}
Response parameters
If the action is successful, an HTTP 200 response is returned. The following data is returned in JSON format.
| Field | Type | Description |
|---|---|---|
page | Integer | The page number for the response. |
page_size | Integer | The number of nodes returned on the page. The maximum number of nodes that can be returned per page is 1000. |
pages_total | Integer | The total number of pages required to display all nodes. |
items_total | Integer | The total number of nodes. |
nodes | Array of objects | The details of each node. |
nodes[].status | String | The node's monitoring status: online, offline, or unknown. A node is unknown when the SC//Reliant Platform Manager has no current keepalive status for it, for example a node that has never reported or hasn't reported for a long time. This is the status shown by the node's status indicator. |
nodes[].last_online | String | The time the last keepalive was received from the node, or unknown if no keepalive has been recorded for the node. |
Errors
The following are common errors returned by this API.
| Code | Message | Cause |
|---|---|---|
| 400 | Invalid page number given: 0. Must be 1 or greater. | The request included a page value lower than 1. |
| 404 | Invalid page size given: -1. Must be 1 or greater. | The request specified a page_size value lower than 1. |
Examples
Example: Return all nodes
This example returns all nodes for a specified customer.
ruby api.rb <customer_code> get api/nodes/
Response
{
"page": 1,
"page_size": 1000,
"pages_total": 8,
"items_total": 7917,
"nodes": [
{
"id": 369,
"node_group_id": 1,
"store_number": 93,
"node_name": "hws Velit 0",
"instance_number": 0,
"hostname": "sit0000red0",
"serialno": null,
"virtual": false,
"type_of_server": null,
"hierarchy_field_id": null,
"status": "online",
"created_at": "2019-06-18T18:49:31.511Z",
"updated_at": "2019-06-18T18:49:31.530Z",
"virtual_nodes": [
{
"id": 372,
"node_group_id": 3,
"store_number": 93,
"node_name": null,
"instance_number": 0,
"hostname": "sit0000eye0",
"serialno": null,
"virtual": true,
"type_of_server": null,
"hierarchy_field_id": null,
"parent_node": "sit0000red0",
"virtual_type": "openvz",
"status": "online",
"created_at": "2019-06-18T18:49:31.592Z",
"updated_at": "2019-06-18T18:49:31.592Z",
"properties": {
"my_logip": "1.1.1.1"
}
},
{
"id": 371,
"node_group_id": 7,
"store_number": 93,
"node_name": null,
"instance_number": 0,
"hostname": "sit0000pay0",
"serialno": null,
"virtual": true,
"type_of_server": null,
"hierarchy_field_id": null,
"parent_node": "sit0000red0",
"virtual_type": "kvm",
"status": "offline",
"created_at": "2019-06-18T18:49:31.573Z",
"updated_at": "2019-06-18T18:49:31.573Z",
"properties": {
"my_logip": "1.1.1.1"
}
},
{
"id": 370,
"node_group_id": 2,
"store_number": 93,
"node_name": null,
"instance_number": 0,
"hostname": "sit0000log0",
"serialno": null,
"virtual": true,
"type_of_server": null,
"hierarchy_field_id": null,
"parent_node": "sit0000red0",
"virtual_type": "openvz",
"status": "online",
"created_at": "2019-06-18T18:49:31.554Z",
"updated_at": "2019-06-18T18:49:31.554Z",
"properties": {
"my_logip": "1.1.1.1"
}
}
],
"puppet_environment": null,
"puppet_masterless": null,
"service_checks": {
"docker_versions": [
{
"property": "my_another_docker_service_check",
"service_name": "DockerVersion",
"service_image": "registry.reliant.io/clients/sit/mysql",
"running_version": "latest",
"container_status": "Up 2 weeks",
"value": "2.1.4",
"last_checked_at": "2021-05-05T20:07:42+00:00",
"error": null,
"last_error_at": null
}
]
},
"available_docker_images": {
"images": [
{
"ID": "211f88f2c454",
"Tag": "latest",
"Size": "89.7MB",
"Digest": "<none>",
"CreatedAt": "2021-01-29 00:07:33 -0500 EST",
"Containers": "N/A",
"Repository": "adminer",
"SharedSize": "N/A",
"UniqueSize": "N/A",
"VirtualSize": "89.72MB",
"CreatedSince": "6 weeks ago"
}
],
"last_checked": "2021-05-05T20:07:42Z"
}
}
]
}
Example: Return all nodes using paginated results
This example returns all nodes from page 2 of the results.
ruby api.rb <customer_code> get api/nodes?page=2
If you specify a page value greater than the total number of pages available, the response will return the nodes from the last available page.
Response
{
"page": 2,
"page_size": 1000,
"pages_total": 8,
"items_total": 7917,
"nodes": [
{
....
}
]
}
Example: Return all nodes and include a specified dynamic property
This example returns all nodes and includes one or more dynamic properties you specify in the request. You must prefix all dynamic property names with my_ and specify the name in all lowercase. For example, if you have a dynamic property named Lan1 Ip, you would specify that as my_lan1_ip in the request.
ruby api.rb <customer_code> get api/nodes?properties=*my_property1*,*my_property2*,*my_property3*
If you specify a dynamic property that is not associated with the node, the property won't be returned. If the dynamic property exists but has no value, the response will return a null value.
Response
{
"page": 1,
"page_size": 1000,
"pages_total": 8,
"items_total": 7917,
"nodes": [
{
"id": 369,
"node_group_id": 1,
...
"my_property1": null,
"my_property2": "10.0.0.2",
"my_property3": "Text property"
}
]
}