|
| 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 { Metadata, Name } from '@_types/common' |
| 22 | +import { Duration } from '@_types/Time' |
| 23 | + |
| 24 | +/** |
| 25 | + * Create a cross-cluster API key. |
| 26 | + * |
| 27 | + * Create an API key of the `cross_cluster` type for the API key based remote cluster access. |
| 28 | + * A `cross_cluster` API key cannot be used to authenticate through the REST interface. |
| 29 | + * |
| 30 | + * IMPORTANT: To authenticate this request you must use a credential that is not an API key. Even if you use an API key that has the required privilege, the API returns an error. |
| 31 | + * |
| 32 | + * Cross-cluster API keys are created by the Elasticsearch API key service, which is automatically enabled. |
| 33 | + * |
| 34 | + * A successful request returns a JSON structure that contains the API key, its unique ID, and its name. If applicable, it also returns expiration information for the API key in milliseconds. |
| 35 | + * |
| 36 | + * By default, API keys never expire. You can specify expiration information when you create the API keys. |
| 37 | + * |
| 38 | + * Cross-cluster API keys can only be updated with the update cross-cluster API key API. |
| 39 | + * Attempting to update them with the update REST API key API or the bulk update REST API keys API will result in an error. |
| 40 | + * @rest_spec_name security.create_cross_cluster_api_key |
| 41 | + * @availability stack stability=stable |
| 42 | + * @cluster_privileges manage_security |
| 43 | + * @ext_doc_id remote-clusters-api-key |
| 44 | + */ |
| 45 | +export interface Request extends RequestBase { |
| 46 | + body: { |
| 47 | + /** |
| 48 | + * Expiration time for the API key. |
| 49 | + * By default, API keys never expire. |
| 50 | + */ |
| 51 | + expiration?: Duration |
| 52 | + /** |
| 53 | + * Arbitrary metadata that you want to associate with the API key. |
| 54 | + * It supports nested data structure. |
| 55 | + * Within the metadata object, keys beginning with `_` are reserved for system usage. |
| 56 | + */ |
| 57 | + metadata?: Metadata |
| 58 | + /** Specifies the name for this API key. */ |
| 59 | + name?: Name |
| 60 | + } |
| 61 | +} |
0 commit comments