Skip to content

Commit 106cbfe

Browse files
Add private capabilities API (#5741) (#5757)
* Add private capabilities API * Add failures * Run make spec-format-fix (cherry picked from commit a245ec0) Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
1 parent 3df48ea commit 106cbfe

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

specification/_doc_ids/table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ behavioral-analytics-event-reference,https://www.elastic.co/guide/en/elasticsear
4848
byte-units,https://www.elastic.co/docs/reference/elasticsearch/rest-apis/api-conventions#byte-units,,
4949
bytes-processor,https://www.elastic.co/docs/reference/enrich-processor/bytes-processor,,
5050
calendar-and-fixed-intervals,https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-datehistogram-aggregation#calendar_and_fixed_intervals,,
51+
capabilities,https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/README.asciidoc#require-or-skip-api-capabilities,,
5152
cat-alias,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-aliases,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/cat-alias.html,
5253
cat-allocation,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-allocation,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/cat-allocation.html,
5354
cat-anomaly-detectors,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-jobs,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/cat-anomaly-detectors.html,
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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+
import { RequestBase } from '@_types/Base'
21+
import { Duration } from '@_types/Time'
22+
23+
/**
24+
* Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported.
25+
*
26+
* @rest_spec_name capabilities
27+
* @availability stack stability=experimental visibility=private
28+
* @doc_id capabilities
29+
*/
30+
export interface Request extends RequestBase {
31+
urls: [
32+
{
33+
path: '/_capabilities'
34+
methods: ['GET']
35+
}
36+
]
37+
query_parameters: {
38+
/**
39+
* REST method to check
40+
* @server_default GET
41+
*/
42+
method?: RestMethod
43+
/**
44+
* API path to check
45+
* @server_default /
46+
*/
47+
path?: string
48+
/**
49+
* Comma-separated list of API parameters to check
50+
*/
51+
parameters?: string | string[]
52+
/**
53+
* Comma-separated list of arbitrary API capabilities to check
54+
*/
55+
capabilities?: string | string[]
56+
/**
57+
* True if only the node being called should be considered
58+
* @server_default false
59+
*/
60+
local_only?: boolean
61+
/**
62+
* Period to wait for a response.
63+
* If no response is received before the timeout expires, the request fails and returns an error.
64+
*/
65+
timeout?: Duration
66+
}
67+
}
68+
69+
export enum RestMethod {
70+
GET,
71+
HEAD,
72+
POST,
73+
PUT,
74+
DELETE
75+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
import { Id, Name } from '@_types/common'
21+
import { NodeStatistics } from '@_types/Node'
22+
23+
export class Response {
24+
body: {
25+
_nodes: NodeStatistics
26+
cluster_name: Name
27+
supported: boolean | null
28+
failures?: FailedNodeException[]
29+
}
30+
}
31+
32+
export class FailedNodeException {
33+
node_id: Id
34+
}

0 commit comments

Comments
 (0)