Skip to content

Commit b0860fc

Browse files
lcawlleemthompo
andauthored
[OpenAPI] Edits the autoscaling APIs (#3081)
Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
1 parent 30a4739 commit b0860fc

21 files changed

+161
-67
lines changed

docs/overlays/elasticsearch-openapi-overlays.yaml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,52 @@ actions:
267267
examples:
268268
indicesOpenResponseExample1:
269269
$ref: "../../specification/indices/open/indicesOpenResponseExample1.yaml"
270-
270+
- target: "$.paths['/_autoscaling/policy/{name}']['delete']"
271+
description: "Add examples for delete autoscaling policy response"
272+
update:
273+
responses:
274+
200:
275+
content:
276+
application/json:
277+
examples:
278+
deleteAutoscalingPolicyResponseExample1:
279+
$ref: "../../specification/autoscaling/delete_autoscaling_policy/autoscalingApisDeleteAutoscalingPolicyResponseExample1.yaml"
280+
- target: "$.paths['/_autoscaling/capacity']['get']"
281+
description: "Add examples for get autoscaling capacity response"
282+
update:
283+
responses:
284+
200:
285+
content:
286+
application/json:
287+
examples:
288+
getAutoscalingCapacityResponseExample1:
289+
$ref: "../../specification/autoscaling/get_autoscaling_capacity/autoscalingApisGetAutoscalingCapacityResponseExample1.yaml"
290+
- target: "$.paths['/_autoscaling/policy/{name}']['get']"
291+
description: "Add examples for get autoscaling policy response"
292+
update:
293+
responses:
294+
200:
295+
content:
296+
application/json:
297+
examples:
298+
getAutoscalingPolicyResponseExample1:
299+
$ref: "../../specification/autoscaling/get_autoscaling_policy/autoscalingApisGetAutoscalingPolicyResponseExample1.yaml"
300+
- target: "$.paths['/_autoscaling/policy/{name}']['put']"
301+
description: "Add examples for create autoscaling policy operation"
302+
update:
303+
update:
304+
requestBody:
305+
content:
306+
application/json:
307+
examples:
308+
createAutoscalingPolicyRequestExample1:
309+
$ref: "../../specification/autoscaling/put_autoscaling_policy/autoscalingApisPutAutoscalingPolicyRequestExample1.yaml"
310+
createAutoscalingPolicyRequestExample2:
311+
$ref: "../../specification/autoscaling/put_autoscaling_policy/autoscalingApisPutAutoscalingPolicyRequestExample2.yaml"
312+
responses:
313+
200:
314+
content:
315+
application/json:
316+
examples:
317+
createAutoscalingPolicyResponseExample1:
318+
$ref: "../../specification/autoscaling/put_autoscaling_policy/autoscalingApisPutAutoscalingPolicyResponseExample1.yaml"

output/openapi/elasticsearch-openapi.json

Lines changed: 24 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 24 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ api-date-math-index-names,https://www.elastic.co/guide/en/elasticsearch/referenc
1010
append-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/append-processor.html
1111
async-search,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/async-search.html
1212
attachment,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/attachment.html
13+
autoscaling,https://www.elastic.co/guide/en/cloud/current/ec-autoscaling.html
14+
autoscaling-deciders,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/autoscaling-deciders.html
1315
autoscaling-delete-autoscaling-policy,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/autoscaling-delete-autoscaling-policy.html
1416
autoscaling-get-autoscaling-capacity,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/autoscaling-get-autoscaling-capacity.html
1517
autoscaling-get-autoscaling-policy,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/autoscaling-get-autoscaling-policy.html

specification/autoscaling/_types/AutoscalingPolicy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2222

2323
export class AutoscalingPolicy {
2424
roles: string[]
25-
/** Decider settings */
25+
/**
26+
* Decider settings.
27+
* @ext_doc_id autoscaling-deciders
28+
*/
2629
deciders: Dictionary<string, UserDefinedValue>
2730
}

specification/autoscaling/delete_autoscaling_policy/DeleteAutoscalingPolicyRequest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ import { RequestBase } from '@_types/Base'
2121
import { Name } from '@_types/common'
2222

2323
/**
24+
* Delete an autoscaling policy.
25+
*
26+
* NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.
2427
* @rest_spec_name autoscaling.delete_autoscaling_policy
2528
* @availability stack since=7.11.0 stability=stable
2629
* @doc_id autoscaling-delete-autoscaling-policy
30+
* @ext_doc_id autoscaling
2731
*/
2832
export interface Request extends RequestBase {
2933
path_parts: {

specification/autoscaling/delete_autoscaling_policy/autoscalingApisDeleteAutoscalingPolicyResponseExample1.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
summary: A successful response of deleting one or more autoscaling policy.
2+
description: >
3+
This may be a response to either `DELETE /_autoscaling/policy/my_autoscaling_policy` or `DELETE /_autoscaling/policy/*`.
4+
# type: "response"
5+
# response_code: 200
6+
value: "{\n \"acknowledged\": true\n}"

specification/autoscaling/get_autoscaling_capacity/GetAutoscalingCapacityRequest.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,23 @@
2020
import { RequestBase } from '@_types/Base'
2121

2222
/**
23+
* Get the autoscaling capacity.
24+
*
25+
* NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.
26+
*
27+
* This API gets the current autoscaling capacity based on the configured autoscaling policy.
28+
* It will return information to size the cluster appropriately to the current workload.
29+
*
30+
* The `required_capacity` is calculated as the maximum of the `required_capacity` result of all individual deciders that are enabled for the policy.
31+
*
32+
* The operator should verify that the `current_nodes` match the operator’s knowledge of the cluster to avoid making autoscaling decisions based on stale or incomplete information.
33+
*
34+
* The response contains decider-specific information you can use to diagnose how and why autoscaling determined a certain capacity was required.
35+
* This information is provided for diagnosis only.
36+
* Do not use this information to make autoscaling decisions.
2337
* @rest_spec_name autoscaling.get_autoscaling_capacity
2438
* @availability stack since=7.11.0 stability=stable
2539
* @doc_id autoscaling-get-autoscaling-capacity
40+
* @ext_doc_id autoscaling
2641
*/
2742
export interface Request extends RequestBase {}

specification/autoscaling/get_autoscaling_capacity/autoscalingApisGetAutoscalingCapacityResponseExample1.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
summary: 'A successful response for retrieving the current autoscaling capacity.'
2+
description: 'This may be a response to `GET /_autoscaling/capacity`.'
3+
# type: "response"
4+
# response_code: 200
5+
value: "{\n policies: {}\n}"

specification/autoscaling/get_autoscaling_policy/GetAutoscalingPolicyRequest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ import { RequestBase } from '@_types/Base'
2121
import { Name } from '@_types/common'
2222

2323
/**
24+
* Get an autoscaling policy.
25+
*
26+
* NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.
2427
* @rest_spec_name autoscaling.get_autoscaling_policy
2528
* @availability stack since=7.11.0 stability=stable
2629
* @doc_id autoscaling-get-autoscaling-capacity
30+
* @ext_doc_id autoscaling
2731
*/
2832
export interface Request extends RequestBase {
2933
path_parts: {

0 commit comments

Comments
 (0)