Link Search Menu Expand Document Documentation Menu

Workload Group Lifecycle API

The Workload Group Lifecycle API creates, updates, retrieves, and deletes workload groups. The API categorizes queries into specific groups, called workload groups, based on desired resource limits.

Endpoints

Create a workload group

PUT /_wlm/workload_group

Update a workload group

PUT /_wlm/workload_group

Get a workload group

GET /_wlm/workload_group
GET /_wlm/workload_group/{name}

Delete a workload group

PUT /_wlm/workload_group

Request body fields

Field Description
_id The ID of the workload group, which can be used to associate query requests with the group and enforce the group’s resource limits.
name The name of the workload group.
resiliency_mode The resiliency mode of the workload group. Valid modes are enforced, soft, and monitor. For more information about resiliency modes, see Operating modes.
resource_limits The resource limits for query requests in the workload group. Valid resources are cpu and memory.

When creating a workload group, make sure that the sum of the resource limits for a single resource, either cpu or memory, does not exceed 1.

Example requests

The following example requests show how to use the Workload Group Lifecycle API.

Create a workload group

PUT _wlm/workload_group
{
  "name": "analytics",
  "resiliency_mode": "enforced",
  "resource_limits": {
    "cpu": 0.4,
    "memory": 0.2
  }
}

Update a workload group

PUT _wlm/workload_group/analytics
{
  "resiliency_mode": "monitor",
  "resource_limits": {
    "cpu": 0.41,
    "memory": 0.21
  }
}

Example responses

OpenSearch returns responses similar to the following.

Creating a workload group

{
  "_id":"preXpc67RbKKeCyka72_Gw",
  "name":"analytics",
  "resiliency_mode":"enforced",
  "resource_limits":{
    "cpu":0.4,
    "memory":0.2
  },
  "updated_at":1726270184642
}

Updating a workload group

{
  "_id":"preXpc67RbKKeCyka72_Gw",
  "name":"analytics",
  "resiliency_mode":"monitor",
  "resource_limits":{
    "cpu":0.41,
    "memory":0.21
  },
  "updated_at":1726270333804
}

Response body fields

Field Description
_id The ID of the workload group.
name The name of the workload group. Required when creating a new workload group.
resiliency_mode The resiliency mode of the workload group.
resource_limits The resource limits of the workload group.
updated_at The time at which the workload group was last updated.