Query Group Lifecycle API

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

Paths and HTTP method

  1. PUT _wlm/query_group
  2. PUT _wlm/query_group/<name>
  3. GET _wlm/query_group
  4. GET _wlm/query_group/<name>
  5. DELETE _wlm/query_group/<name>

Request body fields

FieldDescription
_idThe ID of the query group, which can be used to associate query requests with the group and enforce the group’s resource limits.
nameThe name of the query group.
resiliency_modeThe resiliency mode of the query group. Valid modes are enforced, soft, and monitor. For more information about resiliency modes, see Operating modes.
resource_limitsThe resource limits for query requests in the query group. Valid resources are cpu and memory.

When creating a query 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 requests show how to use the Query Group Lifecycle API.

Creating a query group

  1. PUT _wlm/query_group
  2. {
  3. "name": "analytics",
  4. "resiliency_mode": "enforced",
  5. "resource_limits": {
  6. "cpu": 0.4,
  7. "memory": 0.2
  8. }
  9. }

Updating a query group

  1. PUT _wlm/query_group/analytics
  2. {
  3. "resiliency_mode": "monitor",
  4. "resource_limits": {
  5. "cpu": 0.41,
  6. "memory": 0.21
  7. }
  8. }

Getting a query group

  1. GET _wlm/query_group/analytics

Deleting a query group

  1. DELETE _wlm/query_group/analytics

Example responses

OpenSearch returns responses similar to the following.

Creating a query group

  1. {
  2. "_id":"preXpc67RbKKeCyka72_Gw",
  3. "name":"analytics",
  4. "resiliency_mode":"enforced",
  5. "resource_limits":{
  6. "cpu":0.4,
  7. "memory":0.2
  8. },
  9. "updated_at":1726270184642
  10. }

Updating query group

  1. {
  2. "_id":"preXpc67RbKKeCyka72_Gw",
  3. "name":"analytics",
  4. "resiliency_mode":"monitor",
  5. "resource_limits":{
  6. "cpu":0.41,
  7. "memory":0.21
  8. },
  9. "updated_at":1726270333804
  10. }

Response body fields

FieldDescription
_idThe ID of the query group.
nameThe name of the query group. Required when creating a new query group.
resiliency_modeThe resiliency mode of the query group.
resource_limitsThe resource limits of the query group.
updated_atThe time at which the query group was last updated.