Update a node group
PUT api/node_groups/node-group-id
Updates the details of a node group.
When updating an IP address value, you must specify both the IP address and netmask value. If no netmask value is specified, a default value of /32 is used even if an existing netmask value exists.
Request syntax
put api/node_groups/<node_group_id> '{"name":"<string>","properties":{"<my_property_name>":"<value>"}}'
Request parameters
The request accepts the following data in JSON format.
| Parameter | Type | Description | Required | Default value |
|---|---|---|---|---|
name | String | The name of the node group. | No | N/A |
properties | Object | The properties and values to update. | No | N/A |
Response syntax
{
"exporter_job": integer,
"id": integer,
"name": "string",
"template_name": "string",
"virtual_type": null,
"type_of_server": null,
"created_at": "timestamp",
"updated_at": "timestamp",
"node_group_role_id": integer,
"group_type": "string",
"hierarchy_field_id": null,
"properties": {
}
}
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 exporter job. |
id | Integer | The ID of the node group. |
name | String | The name of the node group. |
template_name | String | The name of the template used to create the node group. |
virtual_type | String | If the server type is virtual, this is the type of virtual server. |
type_of_server | String | The server type for nodes in the node group. |
created_at | Timestamp | The timestamp of when the node group was created. |
updated_at | Timestamp | The timestamp of when the node group was last updated. Upon initial creation, the created_at and updated_at values will be the same. |
node_group_role_id | Integer | The ID of the node group role associated with the node group. |
group_type | String | The type of nodes that will be part of the node group. |
hierarchy_field_id | Integer | The levels of hierarchy attribute for the node group. |
properties | Array of Objects | The properties associated with the node group. |
Errors
The following are common errors returned by this API.
| Code | Message | Cause |
|---|---|---|
| - | - | - |
Examples
Example: Update a property value for a node group
This example updates the Lan1 property value with 1.1.1.1 for node group ID 1953. When specifying an IP address you must also specify the netmask value as well, even if you aren't updating the existing netmask value. If no netmask value is specified, a default value of /32 is used.
Also note that when specifying a dynamic property value, you must add the my_ prefix, for example, the Lan 1 Ip property must be specified as my_lan1_ip when updating.
The property you specify must already exist on the node group.
ruby api.rb <customer_code> put api/node_groups/1953 '{"properties":{"my_lan1_ip": "1.1.1.1/24"}}'
Response
{
"exporter_job": 1538259,
"id": 1953,
"name": "Cluster Lab HA",
"template_name": "cluster_lab_ha",
"virtual_type": null,
"type_of_server": null,
"created_at": "2024-08-28T18:28:12.459Z",
"updated_at": "2024-08-28T18:28:12.459Z",
"node_group_role_id": 1,
"group_type": "regular",
"hierarchy_field_id": null,
"properties": {
"my_lan1_netmask": "24",
"my_lan1_ip": "1.1.1.1"
}
}