environments endpoint to retrieve information about environments in the node classifier. The output tells you either which environments are available or whether a named environment exists.
The output can be helpful when creating new node groups, which must be associated with an environment. The node classifier gets its information about environments from
Puppet, so this endpoint should not be used to create, update, or delete them.
/v1/environments endpoint to retrieve a list of all environments known to the node classifier.
The response is a JSON array of environment objects, using the following keys:
|The name of the environment (a string).|
|Whether the environment synched successfully during the last class synchronization (a Boolean).|
No error responses specific to this request are expected.
/v1/environments/\<name\> endpoint to retrieve the environment with the given name. The main use of this endpoint is to check if an environment actually exists.
If the environment exists, the service returns a
200 response with an environment object in JSON format.
If the environment with the given name cannot be found, the service returns a
404: Not Found response with an empty body.
/v1/environments/\<name\> endpoint to create a new environment with the given name.
No further information is required in the request besides the
name portion of the URL.
If the environment is created successfully, the service returns a
201: Created response whose body is the environment object in JSON format.
No error responses specific to this operation are expected.