POST /v1/groups/<id>/unpin

Unpin specific nodes from a node group.

Request format

When Forming node classifier API requests to this endpoint, the URI path must contain a node group ID. For example:

POST https://localhost:4433/classifier-api/v1/groups/085e2797-32f3-4920-9412-8e9decf4ef65/unpin

The request must also provide the names of the nodes you want to unpin from the group. There are two ways to do this:

  • Append the node names to the URI path. If you are unpinning more than one node, use encoded comma separation (%2C) between node names. For example, this request unpins the nodes named foo, bar, and baz from the group:
    POST https://localhost:4433/classifier-api/v1/groups/085e2797-32f3-4920-9412-8e9decf4ef65/unpin?nodes=foo%2Cbar%2Cbaz
  • Supply the node names in the request body. For a single node, you can supply this in a simple JSON object. For multiple nodes, supply the node names in an array. For example, this JSON body unpins a single node:
    {"nodes": ["foo"]}

    And this body unpins three nodes:

    {"nodes": ["foo", "bar", "baz"]}

While it's easier to append the nodes to the end of the URI path, if you want to unpin a lot of nodes at once, the URI path might get truncated. Strings are truncated if they exceed 8,000 characters. In this case, you have to supply the nodes in a JSON body, which can be many megabytes in size.

Here is an example of a complete curl request to the POST /v1/groups/<id>/pin endpoint:

type_header='Content-Type: application/json'
auth_header="X-Authentication: $(puppet-access show)"
uri="https://$(puppet config print server):4433/classifier-api/v1/groups/085e2797-32f3-4920-9412-8e9decf4ef65/unpin"
data='{ "nodes": ["example-to-unpin"] }'

curl --header "$type_header" --header "$auth_header" --request POST "$uri" --data "$data"

You can use the POST /v1/commands/unpin-from-all endpoint to unpin specific nodes from all groups they're pinned to.

Response format

If unpinning is successful, the service returns a 204 No Content response with an empty body.

If the request contained a node that is was not pinned to the group, service ignores that node.

Error responses

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

If your request doesn't specify any nodes to unpin, the service returns a 400 Malformed Request response.

If the request body is invalid JSON, is missing the nodes key, or contains any keys other than nodes, the service returns a 400 Malformed Request response.