Update classes endpoint

Use update classes endpoint to trigger the node classifier to update class and environment definitions from the primary server.

POST /v1/update-classes

Use the /v1/update-classes endpoint to trigger the node classifier to update class and environment definitions from the primary server. The classifier service uses this endpoint when you refresh classes in the console.

Note: If you don't use Code Manager and you changed the default value of the environment-class-cache-enabled server setting, you must manually delete the environment cache before using this endpoint.

Query parameters

The request accepts the following optional parameter:

Parameter Value
environment If provided, fetches classes for only the specified environment.

For example:

cert="$(puppet config print hostcert)"
cacert="$(puppet config print localcacert)"
key="$(puppet config print hostprivkey)"
uri="https://$(puppet config print server):4433/classifier-api/v1/update-classes?environment=production"

curl --cert "$cert" --cacert "$cacert" --key "$key" --request POST "$uri"

See Usage notes for curl examples for information about forming curl commands.

Response

For a successful update, the service returns a 201 response with an empty body.

Error responses

If the primary server returns an unexpected status to the node classifier, the service returns a 500: Server Error response with the following keys:

Key Definition
kind "unexpected-response"
msg Describes the error
details A JSON object, which has url, status, headers, and body keys describing the response the classifier received from the primary server