PUT /v1/groups/<id>
Create a node group with a specific ID.
Request format
When Forming node classifier API requests to this endpoint, the URI path must
contain the ID you want to assign to the new group. The ID must be a valid type-4
(random) UUID. The regular expression used to validate node group UUIDs is [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
.
It is possible to overwrite an existing node group with a new node group definition that contains deleted classes or parameters.
The request body must be a JSON object describing the node group to be created. The request uses these keys (which are required unless otherwise noted):
Key | Definition |
---|---|
name
|
The name of the node group, as a string. |
environment
|
The name of the node group's environment. This is optional. If omitted, the default value is |
environment_trumps
|
When a node belongs to two or more groups, this Boolean indicates whether this node group's environment overrides environments defined by other node groups. This is optional. If omitted, the default value is |
description
|
A string describing the node group. This is optional. If omitted, the node group has no description. |
parent
|
The ID of the node group's parent. This is required. |
rule
|
The condition that must be satisfied for a node to be classified into this node group. For rule formatting assistance, refer to Forming node classifier API requests. |
variables
|
An optional object that defines the names and values of any top-level variables set by the node group. Supply key-value pairs of variable names and corresponding variable values. Variable values can be any type of JSON value. The |
classes
|
A required object that defines the classes to be used by nodes in the node group. The |
Response format
If the node group is successfully created, the service returns a 201 Created response and a JSON body describing the node group.
If the node group already exists, and the existing group is identical to the node group described in the request, then server takes no action, returns a 200 OK response, and a JSON body describing the node group.
Error responses
If there is an error, Node classifier API errors provide error
information in the kind
key, and are similar to the POST /v1/groups error responses. However, 422 responses
to POST
requests can include errors caused by a node
group’s children, but a node group being created with a PUT
request cannot have any children.