diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index bab2abf964..c28faa7d97 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -27887,6 +27887,82 @@ } } } + }, + "delete": { + "tags": [ + "security.bulk_delete_role" + ], + "summary": "The role management APIs are generally the preferred way to manage roles, rather than using file-based role management", + "description": "The bulk delete roles API cannot delete roles that are defined in roles files.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html" + }, + "operationId": "security-bulk-delete-role", + "parameters": [ + { + "in": "query", + "name": "refresh", + "description": "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.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Refresh" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "names": { + "description": "An array of role names to delete", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "names" + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "deleted": { + "description": "Array of deleted roles", + "type": "array", + "items": { + "type": "string" + } + }, + "not_found": { + "description": "Array of roles that could not be found", + "type": "array", + "items": { + "type": "string" + } + }, + "errors": { + "$ref": "#/components/schemas/security._types:BulkError" + } + } + } + } + } + } + } } }, "/_security/user/{username}/_password": { diff --git a/output/schema/schema.json b/output/schema/schema.json index ad0c5c3e40..d72f82b5f9 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -14841,20 +14841,35 @@ }, { "availability": { - "stack": { + "serverless": { "stability": "stable", - "visibility": "public" + "visibility": "private" + }, + "stack": { + "since": "8.15.0", + "stability": "stable" } }, - "description": "Bulk delete roles in the native realm.", + "description": "The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.\nThe bulk delete roles API cannot delete roles that are defined in roles files.", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html", "name": "security.bulk_delete_role", - "request": null, + "privileges": { + "cluster": [ + "manage_security" + ] + }, + "request": { + "name": "Request", + "namespace": "security.bulk_delete_role" + }, "requestBodyRequired": true, "requestMediaType": [ "application/json" ], - "response": null, + "response": { + "name": "Response", + "namespace": "security.bulk_delete_role" + }, "responseMediaType": [ "application/json" ], @@ -180886,6 +180901,114 @@ ], "specLocation": "security/authenticate/types.ts#L22-L29" }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "description": "An array of role names to delete", + "name": "names", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + } + ] + }, + "description": "The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.\nThe bulk delete roles API cannot delete roles that are defined in roles files.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "security.bulk_delete_role" + }, + "path": [], + "query": [ + { + "description": "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.", + "name": "refresh", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Refresh", + "namespace": "_types" + } + } + } + ], + "specLocation": "security/bulk_delete_role/SecurityBulkDeleteRoleRequest.ts#L23-L41" + }, + { + "body": { + "kind": "properties", + "properties": [ + { + "description": "Array of deleted roles", + "name": "deleted", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "Array of roles that could not be found", + "name": "not_found", + "required": false, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "description": "Present if any deletes resulted in errors", + "name": "errors", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "BulkError", + "namespace": "security._types" + } + } + } + ] + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "security.bulk_delete_role" + }, + "specLocation": "security/bulk_delete_role/SecurityBulkDeleteRoleResponse.ts#L25-L40" + }, { "attachedBehaviors": [ "CommonQueryParameters" diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 4fe394b2a7..c38a3e01af 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1049,12 +1049,6 @@ ], "response": [] }, - "security.bulk_delete_role": { - "request": [ - "Missing request & response" - ], - "response": [] - }, "security.bulk_update_api_keys": { "request": [ "Missing request & response" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 18a8545fdd..e3841b4303 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -17031,6 +17031,19 @@ export interface SecurityAuthenticateToken { type?: string } +export interface SecurityBulkDeleteRoleRequest extends RequestBase { + refresh?: Refresh + body?: { + names: string[] + } +} + +export interface SecurityBulkDeleteRoleResponse { + deleted?: string[] + not_found?: string[] + errors?: SecurityBulkError +} + export interface SecurityBulkPutRoleRequest extends RequestBase { refresh?: Refresh body?: { diff --git a/specification/security/bulk_delete_role/SecurityBulkDeleteRoleRequest.ts b/specification/security/bulk_delete_role/SecurityBulkDeleteRoleRequest.ts new file mode 100644 index 0000000000..05377914b2 --- /dev/null +++ b/specification/security/bulk_delete_role/SecurityBulkDeleteRoleRequest.ts @@ -0,0 +1,41 @@ +/* + * 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 { Refresh } from '@_types/common' + +/** + * The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. + * The bulk delete roles API cannot delete roles that are defined in roles files. + * @rest_spec_name security.bulk_delete_role + * @availability stack since=8.15.0 stability=stable + * @availability serverless stability=stable visibility=private + * @cluster_privileges manage_security + */ +export interface Request extends RequestBase { + query_parameters: { + refresh?: Refresh + } + body: { + /** + * An array of role names to delete + */ + names: string[] + } +} diff --git a/specification/security/bulk_delete_role/SecurityBulkDeleteRoleResponse.ts b/specification/security/bulk_delete_role/SecurityBulkDeleteRoleResponse.ts new file mode 100644 index 0000000000..c0550e3112 --- /dev/null +++ b/specification/security/bulk_delete_role/SecurityBulkDeleteRoleResponse.ts @@ -0,0 +1,40 @@ +/* + * 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 { Dictionary } from '@spec_utils/Dictionary' +import { ErrorCause } from '@_types/Errors' +import { integer } from '@_types/Numeric' +import { BulkError } from '@security/_types/Bulk' + +export class Response { + body: { + /** + * Array of deleted roles + */ + deleted?: string[] + /** + * Array of roles that could not be found + */ + not_found?: string[] + /** + * Present if any deletes resulted in errors + */ + errors?: BulkError + } +}