GET /v1/environments/<environment>/classes/<name>

Retrieve the class with the given name in the given environment.

Request format

The /v1/environments/<environment>/classes/<name> endpoint returns the node classifier's current class data for the specified environment and class. 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 in an environment, use the GET /v1/environments/<environment>/classes endpoint. To get a list of all classes in 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, and a class name. For example:

GET https://localhost:4433/classifier-api/v1/environments/production/classes/apache

Response format

A successful response is a JSON array containing one object that uses these keys to describe the 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 null. If the value is null, the parameter is required.

For example:

{
  "name": "apache",
  "environment": "production",
  "parameters": {
    "default_mods": true,
    "default_vhost": true,
    ...
  }
}

Error responses

If there is an error, Node classifier API errors provide error information in the kind key.

If the endpoint can't find a class with the specified name, the server returns a 404 Not Found response with an empty body.