Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions specification/_doc_ids/table.csv
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ behavioral-analytics-event-reference,https://www.elastic.co/guide/en/elasticsear
byte-units,https://www.elastic.co/docs/reference/elasticsearch/rest-apis/api-conventions#byte-units,,
bytes-processor,https://www.elastic.co/docs/reference/enrich-processor/bytes-processor,,
calendar-and-fixed-intervals,https://www.elastic.co/docs/reference/aggregations/search-aggregations-bucket-datehistogram-aggregation#calendar_and_fixed_intervals,,
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,,
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,
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,
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,
Expand Down
75 changes: 75 additions & 0 deletions specification/_global/capabilities/CapabilitiesRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { RequestBase } from '@_types/Base'
import { Duration } from '@_types/Time'

/**
* Checks if the specified combination of method, API, parameters, and arbitrary capabilities are supported.
*
* @rest_spec_name capabilities
* @availability stack stability=experimental visibility=private
* @doc_id capabilities
*/
export interface Request extends RequestBase {
urls: [
{
path: '/_capabilities'
methods: ['GET']
}
]
query_parameters: {
/**
* REST method to check
* @server_default GET
*/
method?: RestMethod
/**
* API path to check
* @server_default /
*/
path?: string
/**
* Comma-separated list of API parameters to check
*/
parameters?: string | string[]
/**
* Comma-separated list of arbitrary API capabilities to check
*/
capabilities?: string | string[]
/**
* True if only the node being called should be considered
* @server_default false
*/
local_only?: boolean
/**
* Period to wait for a response.
* If no response is received before the timeout expires, the request fails and returns an error.
*/
timeout?: Duration
}
}

export enum RestMethod {
GET,
HEAD,
POST,
PUT,
DELETE
}
34 changes: 34 additions & 0 deletions specification/_global/capabilities/CapabilitiesResponse.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? I haven't been able to find the toXContent() code. I've added failures. Not too worried, since it's a private API.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { Id, Name } from '@_types/common'
import { NodeStatistics } from '@_types/Node'

export class Response {
body: {
_nodes: NodeStatistics
cluster_name: Name
supported: boolean | null
failures?: FailedNodeException[]
}
}

export class FailedNodeException {
node_id: Id
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier needs running for formatting, otherwise LGTM!

Loading