You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- **`api_key` (string)**: The credentials of the API key to clone.
12580
+
This is the secret value returned when the key was originally created.
12581
+
- **`name` (Optional, string)**: A name for the cloned API key.
12582
+
If not provided, the name of the source key is used.
12583
+
- **`expiration` (Optional, string \| -1 \| 0)**: The expiration time for the cloned API key.
12584
+
By default, API keys never expire.
12585
+
Set to `null` to explicitly create a key with no expiration.
12586
+
- **`metadata` (Optional, Record<string, User-defined value>)**: Arbitrary metadata to associate with the cloned API key.
12587
+
It supports nested data structure.
12588
+
Within the metadata object, keys beginning with `_` are reserved for system usage.
12589
+
- **`refresh` (Optional, Enum(true \| false \| "wait_for"))**: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.
* Cancel a reindex task. Cancel an ongoing reindex task. If `wait_for_completion` is `true` (the default), the response contains the final task state after cancellation. If `wait_for_completion` is `false`, the response contains only `acknowledged: true`.
38
+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch#TODO | Elasticsearch API documentation}
Copy file name to clipboardExpand all lines: src/api/api/security.ts
+71Lines changed: 71 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,18 @@ export default class Security {
125
125
body: [],
126
126
query: []
127
127
},
128
+
'security.clone_api_key': {
129
+
path: [],
130
+
body: [
131
+
'api_key',
132
+
'name',
133
+
'expiration',
134
+
'metadata'
135
+
],
136
+
query: [
137
+
'refresh'
138
+
]
139
+
},
128
140
'security.create_api_key': {
129
141
path: [],
130
142
body: [
@@ -1273,6 +1285,65 @@ export default class Security {
1273
1285
returnawaitthis.transport.request({ path, method, querystring, body, meta },options)
1274
1286
}
1275
1287
1288
+
/**
1289
+
* Clone an API key. Create a copy of an existing API key with a new ID. The cloned key inherits the role descriptors of the source key. This is intended for applications (such as Kibana) that need to create API keys on behalf of a user using an existing API key credential, since derived API keys (API keys created by API keys) are not otherwise supported.
1290
+
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch#TODO | Elasticsearch API documentation}
returnawaitthis.transport.request({ path, method, querystring, body, meta },options)
1345
+
}
1346
+
1276
1347
/**
1277
1348
* Create an API key. Create an API key for access without requiring basic authentication. IMPORTANT: If the credential that is used to authenticate this request is an API key, the derived API key cannot have any privileges. If you specify privileges, the API returns an error. 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. NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys. The API keys are created by the Elasticsearch API key service, which is automatically enabled. To configure or turn off the API key service, refer to API key service setting documentation.
1278
1349
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key | Elasticsearch API documentation}
0 commit comments