Skip to content

Commit 58fd355

Browse files
[Backport 8.2] Add missing params to shutdown APIs (#1720)
Co-authored-by: Tomas Della Vedova <[email protected]>
1 parent cb3f6b1 commit 58fd355

File tree

7 files changed

+274
-8
lines changed

7 files changed

+274
-8
lines changed

output/schema/schema.json

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

output/schema/validation-errors.json

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export enum Type {
21+
restart,
22+
remove,
23+
replace
24+
}

specification/shutdown/delete_node/ShutdownDeleteNodeRequest.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import { RequestBase } from '@_types/Base'
2121
import { NodeId } from '@_types/common'
22+
import { TimeUnit } from '@_types/Time'
2223

2324
/**
2425
* @rest_spec_name shutdown.delete_node
@@ -29,4 +30,16 @@ export interface Request extends RequestBase {
2930
path_parts: {
3031
node_id: NodeId
3132
}
33+
query_parameters: {
34+
/**
35+
* Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
36+
* @server_default 30s
37+
*/
38+
master_timeout?: TimeUnit
39+
/**
40+
* Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
41+
* @server_default 30s
42+
*/
43+
timeout?: TimeUnit
44+
}
3245
}

specification/shutdown/get_node/ShutdownGetNodeRequest.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import { RequestBase } from '@_types/Base'
2121
import { NodeIds } from '@_types/common'
22+
import { TimeUnit } from '@_types/Time'
2223

2324
/**
2425
* @rest_spec_name shutdown.get_node
@@ -29,4 +30,16 @@ export interface Request extends RequestBase {
2930
path_parts: {
3031
node_id?: NodeIds
3132
}
33+
query_parameters: {
34+
/**
35+
* Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
36+
* @server_default 30s
37+
*/
38+
master_timeout?: TimeUnit
39+
/**
40+
* Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
41+
* @server_default 30s
42+
*/
43+
timeout?: TimeUnit
44+
}
3245
}

specification/shutdown/put_node/ShutdownPutNodeRequest.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
import { RequestBase } from '@_types/Base'
2121
import { NodeId } from '@_types/common'
22+
import { TimeUnit } from '@_types/Time'
23+
import { Type } from '../_types/types'
2224

2325
/**
2426
* @rest_spec_name shutdown.put_node
@@ -29,4 +31,47 @@ export interface Request extends RequestBase {
2931
path_parts: {
3032
node_id: NodeId
3133
}
34+
query_parameters: {
35+
/**
36+
* Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
37+
* @server_default 30s
38+
*/
39+
master_timeout?: TimeUnit
40+
/**
41+
* Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
42+
* @server_default 30s
43+
*/
44+
timeout?: TimeUnit
45+
}
46+
body: {
47+
/**
48+
* Valid values are restart, remove, or replace.
49+
* Use restart when you need to temporarily shut down a node to perform an upgrade, make configuration changes, or perform other maintenance.
50+
* Because the node is expected to rejoin the cluster, data is not migrated off of the node.
51+
* Use remove when you need to permanently remove a node from the cluster.
52+
* The node is not marked ready for shutdown until data is migrated off of the node Use replace to do a 1:1 replacement of a node with another node.
53+
* Certain allocation decisions will be ignored (such as disk watermarks) in the interest of true replacement of the source node with the target node.
54+
* During a replace-type shutdown, rollover and index creation may result in unassigned shards, and shrink may fail until the replacement is complete.
55+
*/
56+
type: Type
57+
/**
58+
* A human-readable reason that the node is being shut down.
59+
* This field provides information for other cluster operators; it does not affect the shut down process.
60+
*/
61+
reason: string
62+
/**
63+
* Only valid if type is restart.
64+
* Controls how long Elasticsearch will wait for the node to restart and join the cluster before reassigning its shards to other nodes.
65+
* This works the same as delaying allocation with the index.unassigned.node_left.delayed_timeout setting.
66+
* If you specify both a restart allocation delay and an index-level allocation delay, the longer of the two is used.
67+
*/
68+
allocation_delay?: string
69+
/**
70+
* Only valid if type is replace.
71+
* Specifies the name of the node that is replacing the node being shut down.
72+
* Shards from the shut down node are only allowed to be allocated to the target node, and no other data will be allocated to the target node.
73+
* During relocation of data certain allocation rules are ignored, such as disk watermarks or user attribute filtering rules.
74+
*/
75+
target_node_name?: string
76+
}
3277
}

0 commit comments

Comments
 (0)