Skip to content

Commit 9c002bd

Browse files
[Rule based auto tagging] Update 'Create workload group rules' (#10148)
* add delete rule api to 'Create workload group rules' Signed-off-by: Ruirui Zhang <mariazrr@amazon.com> * Apply suggestions from code review Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --------- Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> (cherry picked from commit b50d88a) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent bcf820a commit 9c002bd

File tree

2 files changed

+43
-20
lines changed

2 files changed

+43
-20
lines changed

_tuning-your-cluster/availability-and-recovery/rule-based-autotagging/rule-lifecycle-api.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ POST /_rules/{feature_type}
2929
Use the following endpoint to modify an existing rule by specifying both the feature type and rule ID in the path parameters:
3030

3131
```json
32-
PUT /_rules/{feature_type}/{_id}
33-
POST /_rules/{feature_type}/{_id}
32+
PUT /_rules/{feature_type}/{id}
33+
POST /_rules/{feature_type}/{id}
3434
```
3535

3636
### Get a rule
3737

3838
Use the following endpoint to retrieve either a specific rule by ID or list all rules for a feature type:
3939

4040
```json
41-
GET /_rules/{feature_type}/{_id}
41+
GET /_rules/{feature_type}/{id}
4242
GET /_rules/{feature_type}
4343
```
4444

@@ -47,17 +47,17 @@ GET /_rules/{feature_type}
4747
Use the following endpoint to remove a rule by specifying both the feature type and rule ID:
4848

4949
```json
50-
DELETE /_rules/{feature_type}/{_id}
50+
DELETE /_rules/{feature_type}/{id}
5151
```
5252

5353
## Path parameters
5454

5555
The following table lists the available path parameters.
5656

57-
| Parameter | Data type | Description |
58-
| :--- | :--- | :--- |
57+
| Parameter | Data type | Description |
58+
|:---------------| :--- | :--- |
5959
| `feature_type` | String | The category of the rule that defines the type of feature, such as `workload_group`. |
60-
| `_id` | String | The unique identifier for the rule. Required for `UPDATE`, `GET`, and `DELETE` operations. |
60+
| `id` | String | The unique identifier for the rule. Required for `UPDATE`, `GET`, and `DELETE` operations. |
6161

6262
## Query parameters
6363

@@ -119,7 +119,7 @@ You can't change the `feature_type`. Fields that are not updated can be omitted.
119119
The following request retrieves a rule by ID:
120120

121121
```json
122-
GET /_rules/{feature_type}/{_id}
122+
GET /_rules/{feature_type}/{id}
123123
```
124124
{% include copy-curl.html %}
125125

@@ -157,7 +157,7 @@ The following example continues the search for all rules of the `workload_group`
157157

158158
```json
159159
{
160-
"_id": "wi6VApYBoX5wstmtU_8l",
160+
"id": "wi6VApYBoX5wstmtU_8l",
161161
"description": "description for rule",
162162
"index_pattern": ["log*", "event*"],
163163
"workload_group": "EITBzjFkQ6CA-semNWGtRQ",
@@ -178,7 +178,7 @@ The following example continues the search for all rules of the `workload_group`
178178
{
179179
"rules": [
180180
{
181-
"_id": "z1MJApUB0zgMcDmz-UQq",
181+
"id": "z1MJApUB0zgMcDmz-UQq",
182182
"description": "Rule for tagging workload_group_id to index123",
183183
"index_pattern": ["index123"],
184184
"workload_group": "workload_group_id",
@@ -198,11 +198,11 @@ To retrieve the next page, include the `search_after` value in the next `GET` re
198198

199199
## Response body fields
200200

201-
| Field | Data type | Description |
202-
| :--- | :--- | :--- |
203-
| `_id` | String | The unique identifier for the rule. |
204-
| `description` | String | The explanation or purpose of the rule. |
205-
| `updated_at` | String | The timestamp of the most recent update to the rule in UTC format. |
201+
| Field | Data type | Description |
202+
|:------------------| :--- | :--- |
203+
| `id` | String | The unique identifier for the rule. |
204+
| `description` | String | The explanation or purpose of the rule. |
205+
| `updated_at` | String | The timestamp of the most recent update to the rule in UTC format. |
206206
| `<attribute_key>` | Array | The attribute values used to match incoming queries. |
207-
| `<feature_type>` | String | The value assigned to the feature type if the rule matches. |
208-
| `search_after` | Array | The token for paginating additional results. Present only if more results exist. |
207+
| `<feature_type>` | String | The value assigned to the feature type if the rule matches. |
208+
| `search_after` | Array | The token for paginating additional results. Present only if more results exist. |

_tuning-your-cluster/availability-and-recovery/workload-management/create-workload-group-rules-api.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ You can retrieve rules created using the Create Workload Group Rules API by rule
6262
The following request retrieves a rule by ID for the `workload_group` feature type:
6363

6464
```json
65-
GET /_rules/workload_group/{_id}
65+
GET /_rules/workload_group/{id}
6666
```
6767
{% include copy-curl.html %}
6868

@@ -90,6 +90,15 @@ The following request provides the next page of rules from the same workload gro
9090
```
9191
{% include copy-curl.html %}
9292

93+
### Delete a rule
94+
95+
The following request deletes a rule using the rule's ID:
96+
97+
```json
98+
DELETE /_rules/workload_group/{id}
99+
```
100+
{% include copy-curl.html %}
101+
93102
## Example responses
94103

95104
<details open markdown="block">
@@ -100,7 +109,7 @@ The following request provides the next page of rules from the same workload gro
100109

101110
```json
102111
{
103-
"_id": "wi6VApYBoX5wstmtU_8l",
112+
"id": "wi6VApYBoX5wstmtU_8l",
104113
"description": "description for rule",
105114
"index_pattern": ["log*", "event*"],
106115
"workload_group": "EITBzjFkQ6CA-semNWGtRQ",
@@ -121,7 +130,7 @@ The following request provides the next page of rules from the same workload gro
121130
{
122131
"rules": [
123132
{
124-
"_id": "z1MJApUB0zgMcDmz-UQq",
133+
"id": "z1MJApUB0zgMcDmz-UQq",
125134
"description": "Rule for tagging workload_group_id to index123",
126135
"index_pattern": ["index123"],
127136
"workload_group": "workload_group_id",
@@ -137,3 +146,17 @@ If the `search_after` field is present in the response, more results are availab
137146
To retrieve the next page, include the `search_after` value in the next `GET` request as a query parameter, such as `GET /_rules/{feature_type}?search_after=z1MJApUB0zgMcDmz-UQq`.
138147

139148
</details>
149+
150+
151+
<details markdown="block">
152+
<summary>
153+
Response: Delete rules
154+
</summary>
155+
{: .text-delta }
156+
157+
```json
158+
{ "acknowledged": true }
159+
```
160+
161+
</details>
162+

0 commit comments

Comments
 (0)