GET /v1/environments/<environment>/classes
Retrieve a list of all classes (that the node classifier knows about) in a specific environment.
Request format
The /v1/environments/<environment>/classes
endpoint
returns the node classifier's current class data for the specified environment. The node
classifier periodically retrieves class data from the primary server, and you can check
the last retrieval time with the GET /v1/last-class-update endpoint.
If you want to ensure the response contains the latest data, use the POST /v1/update-classes endpoint to force a retrieval. To get a list of
all classes for all environments, use the GET /v1/classes
endpoint.
When Forming node classifier API requests to this endpoint, the request
is a basic GET
call with authentication. The URI path
must specify an environment, such as production
. For
example:
GET https://localhost:4433/classifier-api/v1/environments/production/classes
You can use the GET /v1/environments endpoint to get a list of known environments.
Response format
A successful response is a JSON array of objects. Each object uses these keys to describe a class:
Key | Definition |
---|---|
name
|
The name of the class, as a string. |
environment
|
The name of the environment that this class exists in. Note that the same class can exist in different environments and can have different parameters in each environment. |
parameters
|
An object describing the parameters and default parameter values for the class. The keys of this object are the parameter names (strings). Each value is the default value for the associated parameter as a string, boolean, number, structured value, or |
This is an example of one class object:
{ "name": "apache", "environment": "production", "parameters": { "default_mods": true, "default_vhost": true, ... } }
For errors, refer to Node classifier API errors.