|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Query Group Lifecycle API |
| 4 | +nav_order: 20 |
| 5 | +parent: Workload management |
| 6 | +grand_parent: Availability and recovery |
| 7 | +--- |
| 8 | +# Query Group Lifecycle API |
| 9 | + |
| 10 | +The Query Group Lifecycle API in OpenSearch provides functionality to create, update, get, and delete query groups, enabling users to organize and control sets of related queries under specific groups. |
| 11 | + |
| 12 | +## Create query group |
| 13 | +Creates a new Query group with the specified properties. |
| 14 | + |
| 15 | +#### Path and HTTP method |
| 16 | +```json |
| 17 | +PUT _wlm/query_group |
| 18 | +``` |
| 19 | +#### Example request |
| 20 | +```json |
| 21 | +PUT _wlm/query_group |
| 22 | +{ |
| 23 | + "name": "analytics", |
| 24 | + "resiliency_mode": "enforced", |
| 25 | + "resource_limits": { |
| 26 | + "cpu": 0.4, |
| 27 | + "memory": 0.2 |
| 28 | + } |
| 29 | +} |
| 30 | +``` |
| 31 | +#### Example response |
| 32 | +```json |
| 33 | +{ |
| 34 | + "_id":"preXpc67RbKKeCyka72_Gw", |
| 35 | + "name":"analytics", |
| 36 | + "resiliency_mode":"enforced", |
| 37 | + "resource_limits":{ |
| 38 | + "cpu":0.4, |
| 39 | + "memory":0.2 |
| 40 | + }, |
| 41 | + "updated_at":1726270184642 |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +## Update query group |
| 46 | +Updates the properties of an existing Query Group. |
| 47 | + |
| 48 | +#### Path and HTTP method |
| 49 | +```json |
| 50 | +PUT _wlm/query_group/<name> |
| 51 | +``` |
| 52 | +#### Example request |
| 53 | +```json |
| 54 | +PUT _wlm/query_group/analytics |
| 55 | +{ |
| 56 | + "resiliency_mode": "monitor", |
| 57 | + "resource_limits": { |
| 58 | + "cpu": 0.41, |
| 59 | + "memory": 0.21 |
| 60 | + } |
| 61 | +} |
| 62 | +``` |
| 63 | +#### Example response |
| 64 | +```json |
| 65 | +{ |
| 66 | + "_id":"preXpc67RbKKeCyka72_Gw", |
| 67 | + "name":"analytics", |
| 68 | + "resiliency_mode":"monitor", |
| 69 | + "resource_limits":{ |
| 70 | + "cpu":0.41, |
| 71 | + "memory":0.21 |
| 72 | + }, |
| 73 | + "updated_at":1726270333804 |
| 74 | +} |
| 75 | +``` |
| 76 | +## Get query group |
| 77 | +Retrieves the properties of the provided Query Group. |
| 78 | + |
| 79 | +#### Path and HTTP method |
| 80 | +```json |
| 81 | +GET _wlm/query_group/<name> |
| 82 | +``` |
| 83 | +#### Example request |
| 84 | +```json |
| 85 | +GET _wlm/query_group/analytics |
| 86 | +``` |
| 87 | +#### Example response |
| 88 | +```json |
| 89 | +{ |
| 90 | + "query_groups": [ |
| 91 | + { |
| 92 | + "_id": "preXpc67RbKKeCyka72_Gw", |
| 93 | + "name": "analytics", |
| 94 | + "resiliency_mode": "monitor", |
| 95 | + "resource_limits": { |
| 96 | + "cpu": 0.41, |
| 97 | + "memory": 0.21 |
| 98 | + }, |
| 99 | + "updated_at": 1726270333804 |
| 100 | + } |
| 101 | + ] |
| 102 | +} |
| 103 | +``` |
| 104 | +## Get all query groups |
| 105 | +Retrieves the properties of all Query groups in the cluster. |
| 106 | + |
| 107 | +#### Path and HTTP method |
| 108 | +```json |
| 109 | +GET _wlm/query_group |
| 110 | +``` |
| 111 | +#### Example request |
| 112 | +```json |
| 113 | +GET _wlm/query_group |
| 114 | +``` |
| 115 | +#### Example response |
| 116 | +```json |
| 117 | +{ |
| 118 | + "query_groups": [ |
| 119 | + { |
| 120 | + "_id": "preXpc67RbKKeCyka72_Gw", |
| 121 | + "name": "analytics", |
| 122 | + "resiliency_mode": "monitor", |
| 123 | + "resource_limits": { |
| 124 | + "cpu": 0.41, |
| 125 | + "memory": 0.21 |
| 126 | + }, |
| 127 | + "updated_at": 1726270333804 |
| 128 | + }, |
| 129 | + { |
| 130 | + "_id": "pviC2vuep2Kc84yka43_Np", |
| 131 | + "name": "analytics_2", |
| 132 | + "resiliency_mode": "monitor", |
| 133 | + "resource_limits": { |
| 134 | + "cpu": 0.15, |
| 135 | + "memory": 0.3 |
| 136 | + }, |
| 137 | + "updated_at": 1726270840583 |
| 138 | + } |
| 139 | + ] |
| 140 | +} |
| 141 | +``` |
| 142 | +## Delete query group |
| 143 | +Delete the provided Query group. |
| 144 | + |
| 145 | +#### Path and HTTP method |
| 146 | +```json |
| 147 | +DELETE _wlm/query_group/<name> |
| 148 | +``` |
| 149 | +#### Example request |
| 150 | +```json |
| 151 | +DELETE _wlm/query_group/analytics |
| 152 | +``` |
| 153 | +#### Example response |
| 154 | +```json |
| 155 | +{ |
| 156 | + "acknowledged":true |
| 157 | +} |
| 158 | +``` |
| 159 | + |
| 160 | +## Fields |
| 161 | +The query group lifecycle API contains the following fields. |
| 162 | + |
| 163 | +| Field | Description | |
| 164 | +|:-----------------------|:-------------------------------------------------------------------------------------------| |
| 165 | +| `_id` | The id of the query group. | |
| 166 | +| `name` | The name of the query group. | |
| 167 | +| `resiliency_mode` | The resiliency mode of the query group. Valid modes are `enforced`, `soft`, and `monitor`. | |
| 168 | +| `resource_limits` | The resource limits of the query group. Valid resources are `cpu` and `memory`. | |
| 169 | +| `updated_at` | The last updated time of the query group. | |
0 commit comments