Node

List Nodes

Lists all nodes, optionally filtered by name, or role.

GET /api/v1/nodes/
Query Parameters:
 
  • id -- Filter responses by id
  • enabled -- Filter responses by enabled state
  • hostname -- Filter responses by hostname
  • cluster -- Filter responses by cluster
  • node_role -- Filter responses by node role
  • cpu_cores -- Filter responses by number of CPU cores
  • ram_gb -- Filter responses by amount of RAM
  • uuid -- Filter responses by node UUID
Status:

200 OK

Status:

400 Bad Request

Status:

404 Not Found

Example request:

curl -1 'https://platform.swiftstack.com/api/v1/nodes/?cluster__id=<cluster_id>&format=json' -H 'Authorization: apikey <user>:<api_key>'

Example response:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
    "meta": {
        "limit": 20,
        "next": null,
        "offset": 0,
        "previous": null,
        "total_count": 2
    },
    "objects": [
        {
             "cluster": "/api/v1/clusters/3/",
             "cpu_cores": 1,
             "enabled": true,
             "hostname": "node1",
             "id": 9,
             "node_role": {
                 "id": 7,
                 "resource_uri": "/api/v1/node_roles/7/",
                 "runs_account_container": true,
                 "runs_gateway": false,
                 "runs_object": true,
                 "runs_proxy": true,
                 "runs_proxyfs": false,
             },
             "ram_gb": 0.479362487792969,
             "resource_uri": "/api/v1/nodes/9/",
             "uuid": "95cc2abd-f7f0-11e3-984c-080027449a29",
             "cluster_facing_ip": "192.168.22.5",
             "outward_facing_ip": "192.168.23.5",
             "replication_facing_ip": "192.168.24.5",
             "other_ips": ["10.0.0.5"],
             "rrdns_vips": {
                 "192.168.22.42": 2,
                 "192.168.22.43": 1
             },
             "region": {"name": "Region 1", "id": 1, "number": 1},
             "zone": {"name": "Zone 1", "id": 1, "number": 1}
        },
        {
             "cluster": "/api/v1/clusters/3/",
             "cpu_cores": 1,
             "enabled": true,
             "hostname": "node2",
             "id": 10,
             "node_role": {
                 "id": 7,
                 "resource_uri": "/api/v1/node_roles/8/",
                 "runs_account_container": false,
                 "runs_gateway": true,
                 "runs_object": false,
                 "runs_proxy": false,
                 "runs_proxyfs": false
             },
             "ram_gb": 0.479362487792969,
             "resource_uri": "/api/v1/nodes/10/",
             "uuid": "95cc2abd-f7f0-11e3-984c-080027449a99",
             "cluster_facing_ip": "192.168.22.6",
             "outward_facing_ip": "192.168.23.6",
             "replication_facing_ip": "192.168.24.6",
             "other_ips": ["10.0.0.6"],
             "rrdns_vips": {
                 "192.168.22.42": 1,
                 "192.168.22.43": 2
             },
             "region": {"name": "Region 1", "id": 1, "number": 1},
             "zone": {"name": "Zone 1", "id": 1, "number": 1}
        }
    ]
}

Enable/Disable Nodes

Enable or Disable multiple nodes.

PATCH /api/v1/nodes/
Form Parameters:
 
  • enabled -- Whether the node is enabled
Status:

202 Accepted

Status:

400 Bad Request

Status:

404 Not Found

Example request:

curl -1 https://platform.swiftstack.com/api/v1/nodes/ -H 'Authorization: apikey <user>:<api_key>' -H 'content-type: application/json' -d '{"objects": [{"resource_uri": "/api/v1/nodes/1/", "enabled": true}]}' -X PATCH

View Node Details

Display information about a node.

GET /api/v1/nodes/<node_id>/
Status:200 OK
Status:400 Bad Request
Status:404 Not Found

Example request:

curl -1 https://platform.swiftstack.com/api/v1/nodes/<node_id>/ -H 'Authorization: apikey <user>:<api_key>'

Example response:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
    "cluster": "/api/v1/clusters/3/",
    "cpu_cores": 1,
    "enabled": true,
    "hostname": "node1",
    "id": 9,
    "node_role": {
        "id": 7,
        "resource_uri": "/api/v1/node_roles/7/",
        "runs_account_container": true,
        "runs_gateway": false,
        "runs_object": true,
        "runs_proxy": true,
        "runs_proxyfs": false
    },
    "ram_gb": 0.479362487792969,
    "resource_uri": "/api/v1/nodes/9/",
    "uuid": "95cc2abd-f7f0-11e3-984c-080027449a29",
    "cluster_facing_ip": "192.168.22.5",
    "outward_facing_ip": "192.168.23.5",
    "replication_facing_ip": "192.168.24.5",
    "other_ips": ["10.0.0.5"],
    "rrdns_vips": {},
    "region": {"name": "Region 1", "id": 1},
    "zone": {"name": "Zone 1", "id": 1}
}

Enable/Disable Node

Enable or Disable a single node.

PATCH /api/v1/node/<node_id>
Form Parameters:
 
  • enabled -- Whether the node is enabled
Status:

202 Accepted

Status:

400 Bad Request

Status:

404 Not Found

Example request:

curl -1 https://platform.swiftstack.com/api/v1/nodes/<node_id>/ -H 'Authorization: apikey <user>:<api_key>' -H 'content-type: application/json' -d '{"enabled": true}' -X PATCH