From 69a3f538c664136647caf119f1068be482c996eb Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 11 Jul 2025 12:49:18 +0400 Subject: [PATCH] Add refresh to security.grant_api_key --- output/openapi/elasticsearch-openapi.json | 12 ++++++++++++ output/schema/schema.json | 18 ++++++++++++++++-- output/schema/validation-errors.json | 6 ------ output/typescript/types.ts | 1 + .../SecurityGrantApiKeyRequest.ts | 12 +++++++++++- 5 files changed, 40 insertions(+), 9 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index a26ab132a0..48a029e9f6 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -41041,6 +41041,18 @@ "summary": "Grant an API key", "description": "Create an API key on behalf of another user.\nThis API is similar to the create API keys API, however it creates the API key for a user that is different than the user that runs the API.\nThe caller must have authentication credentials for the user on whose behalf the API key will be created.\nIt is not possible to use this API to create an API key without that user's credentials.\nThe supported user authentication credential types are:\n\n* username and password\n* Elasticsearch access tokens\n* JWTs\n\nThe user, for whom the authentication credentials is provided, can optionally \"run as\" (impersonate) another user.\nIn this case, the API key will be created on behalf of the impersonated user.\n\nThis API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.\nThe API keys are created by the Elasticsearch API key service, which is automatically enabled.\n\nA successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.\nIf applicable, it also returns expiration information for the API key in milliseconds.\n\nBy default, API keys never expire. You can specify expiration information when you create the API keys.\n\n## Required authorization\n\n* Cluster privileges: `grant_api_key`\n", "operationId": "security-grant-api-key", + "parameters": [ + { + "in": "query", + "name": "refresh", + "description": "If 'true', Elasticsearch refreshes the affected shards to make this operation\nvisible to search.\nIf 'wait_for', it waits for a refresh to make this operation visible to search.\nIf 'false', nothing is done with refreshes.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Refresh" + }, + "style": "form" + } + ], "requestBody": { "content": { "application/json": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 01a8808580..53776834f4 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -236839,8 +236839,22 @@ "namespace": "security.grant_api_key" }, "path": [], - "query": [], - "specLocation": "security/grant_api_key/SecurityGrantApiKeyRequest.ts#L24-L92" + "query": [ + { + "description": "If 'true', Elasticsearch refreshes the affected shards to make this operation\nvisible to search.\nIf 'wait_for', it waits for a refresh to make this operation visible to search.\nIf 'false', nothing is done with refreshes.", + "name": "refresh", + "required": false, + "serverDefault": "false", + "type": { + "kind": "instance_of", + "type": { + "name": "Refresh", + "namespace": "_types" + } + } + } + ], + "specLocation": "security/grant_api_key/SecurityGrantApiKeyRequest.ts#L24-L102" }, { "kind": "response", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index d6e6277181..0ff06f43e4 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -55,12 +55,6 @@ ], "response": [] }, - "security.grant_api_key": { - "request": [ - "Request: missing json spec query parameter 'refresh'" - ], - "response": [] - }, "snapshot.delete": { "request": [ "Request: missing json spec query parameter 'wait_for_completion'" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index a3d76e433f..b8b0002d1a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -20251,6 +20251,7 @@ export interface SecurityGrantApiKeyGrantApiKey { } export interface SecurityGrantApiKeyRequest extends RequestBase { + refresh?: Refresh body?: { api_key: SecurityGrantApiKeyGrantApiKey grant_type: SecurityGrantApiKeyApiKeyGrantType diff --git a/specification/security/grant_api_key/SecurityGrantApiKeyRequest.ts b/specification/security/grant_api_key/SecurityGrantApiKeyRequest.ts index 5d1e227e80..259a522781 100644 --- a/specification/security/grant_api_key/SecurityGrantApiKeyRequest.ts +++ b/specification/security/grant_api_key/SecurityGrantApiKeyRequest.ts @@ -18,7 +18,7 @@ */ import { RequestBase } from '@_types/Base' -import { Password, Username } from '@_types/common' +import { Password, Refresh, Username } from '@_types/common' import { ApiKeyGrantType, GrantApiKey } from './types' /** @@ -57,6 +57,16 @@ export interface Request extends RequestBase { methods: ['POST'] } ] + query_parameters: { + /** + * If 'true', Elasticsearch refreshes the affected shards to make this operation + * visible to search. + * If 'wait_for', it waits for a refresh to make this operation visible to search. + * If 'false', nothing is done with refreshes. + * @server_default false + */ + refresh?: Refresh + } body: { /** * The API key.