Update classes endpoint
Use the update-classes endpoint to trigger the node
classifier to get updated class and environment definitions from the primary
server.
environment_class_cache_enabled setting on your primary server to
true
and you don't use Code Manager, you must manually delete the environment cache before using the
update-classes endpoint.To check the last time the node classifier got updated definitions from the primary server, use the Last class update endpoint.
POST /v1/update-classes
Trigger the node classifier to retrieve updated class and environment definitions from the primary server. The classifier service also uses this endpoint when you refresh classes in the console.
Request format
environment parameter to the
URI path. For example, this request only updates definitions for the production
environment: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"
Response format
If the definitions were successfully updated, the service returns a 201 response
with an empty body.
Error responses
If there is an error, Node classifier API errors provide error information in the
kind key.
If the node classifier gets an unexpected status from the primary server, the service
returns 500 Server Error unexpected-response and a copy of the
response from the primary server.