|
| 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 | +} |
0 commit comments