Skip to main content
Infrastructure/Agents
POSTAgentSince 1.0SynchronousAuth Required

BatchUpdateLabels

Apply batch label add, remove, or replace operations across a set of selected agents

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • selectorObjectRequired

    Selector for this resource

    • uuidsList

      Uuids for this resource

      Example: item1,item2

    • typeString

      Filter agents by type

      Example: log

    • regionString

      Filter agents by deployment region

      Example: us-east-1

    • labelMatchLinkedHashMap

      Label matching criteria for agent selection

      Example: (nested object)

  • operationStringRequired

    Label operation to perform: add, remove, or replace

    Example: add

  • labelsLinkedHashMapRequired

    Key-value labels attached to this resource

    Example: (nested object)

  • dryRunBooleanRequired

    If true, simulate the operation without applying changes

    Example: false

Responses

200 OK

On success, this API returns the following response structure.

  • affectedCountInteger

    Number of agents whose labels were updated

    Example: 42

  • affectedUuidsList

    Affected uuids

    Example: item1,item2

  • dryRunBoolean

    Whether this was a dry run without actual changes

    Example: false

  • errorsList

    Errors for this resource

    Example: (nested array)

    • agentUuidString

      UUID of the agent where the label operation failed

      Example: agent-abc123-def456

    • errorString

      Description of the error that occurred

      Example: agent not found

Endpoint

POST/api/v1/agent/labels/batch

/api/v1/agent/labels/batch

Operation ID

BatchUpdateLabels

Permalink

Request Example

curl -X POST '{host}/api/v1/agent/labels/batch' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"selector":{"uuids":"item1,item2","type":"log","region":"us-east-1","labelMatch":"(nested object)"},"operation":"add","labels":"(nested object)","dryRun":false}'

Response Example

200
{
  "affectedCount": 42,
  "affectedUuids": [],
  "dryRun": false,
  "errors": [
    {}
  ]
}

Change History

This API has no change history records yet.

View all change history