diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index dc12465f68..fa4678adeb 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -12663,7 +12663,7 @@ "required": true, "deprecated": false, "schema": { - "$ref": "#/components/schemas/indices.add_block.IndicesBlockOptions" + "$ref": "#/components/schemas/indices._types.IndicesBlockOptions" }, "style": "simple" }, @@ -12735,7 +12735,7 @@ "indices": { "type": "array", "items": { - "$ref": "#/components/schemas/indices.add_block.IndicesBlockStatus" + "$ref": "#/components/schemas/indices.add_block.AddIndicesBlockStatus" } } }, @@ -12757,6 +12757,123 @@ }, "x-state": "Generally available; Added in 7.9.0", "x-product-feature": "elasticsearch" + }, + "delete": { + "tags": [ + "indices" + ], + "summary": "Remove an index block", + "description": "Remove an index block from an index.\nIndex blocks limit the operations allowed on an index by blocking specific operation types.\n\n## Required authorization\n\n* Index privileges: `manage`\n", + "operationId": "indices-remove-block", + "parameters": [ + { + "in": "path", + "name": "index", + "description": "A comma-separated list or wildcard expression of index names used to limit the request.\nBy default, you must explicitly name the indices you are removing blocks from.\nTo allow the removal of blocks from indices with `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to `false`.\nYou can update this setting in the `elasticsearch.yml` file or by using the cluster update settings API.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "style": "simple" + }, + { + "in": "path", + "name": "block", + "description": "The block type to remove from the index.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/indices._types.IndicesBlockOptions" + }, + "style": "simple" + }, + { + "in": "query", + "name": "allow_no_indices", + "description": "If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "expand_wildcards", + "description": "The type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nIt supports comma-separated values, such as `open,hidden`.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.ExpandWildcards" + }, + "style": "form" + }, + { + "in": "query", + "name": "ignore_unavailable", + "description": "If `false`, the request returns an error if it targets a missing or closed index.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "master_timeout", + "description": "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + }, + { + "in": "query", + "name": "timeout", + "description": "The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.\nIf no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.\nIt can also be set to `-1` to indicate that the request should never timeout.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + }, + "indices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/indices.remove_block.RemoveIndicesBlockStatus" + } + } + }, + "required": [ + "acknowledged", + "indices" + ] + }, + "examples": { + "IndicesRemoveBlockResponseExample1": { + "description": "A successful response from `DELETE /my-index-000001/_block/write`, which removes an index block from an index.'", + "value": "{\n \"acknowledged\" : true,\n \"indices\" : [ {\n \"name\" : \"my-index-000001\",\n \"unblocked\" : true\n } ]\n}" + } + } + } + } + } + }, + "x-state": "Generally available; Added in 9.1.0", + "x-product-feature": "elasticsearch" } }, "/_analyze": { @@ -79429,7 +79546,7 @@ "phase" ] }, - "indices.add_block.IndicesBlockOptions": { + "indices._types.IndicesBlockOptions": { "type": "string", "enum": [ "metadata", @@ -79438,7 +79555,7 @@ "write" ] }, - "indices.add_block.IndicesBlockStatus": { + "indices.add_block.AddIndicesBlockStatus": { "type": "object", "properties": { "name": { @@ -80856,6 +80973,23 @@ "reloaded_node_ids" ] }, + "indices.remove_block.RemoveIndicesBlockStatus": { + "type": "object", + "properties": { + "name": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "unblocked": { + "type": "boolean" + }, + "exception": { + "$ref": "#/components/schemas/_types.ErrorCause" + } + }, + "required": [ + "name" + ] + }, "indices.resolve_cluster.ResolveClusterInfo": { "description": "Provides information about each cluster request relevant to doing a cross-cluster search.", "type": "object", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 7f6f69f6a1..ec4a2e6f25 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -6628,7 +6628,7 @@ "required": true, "deprecated": false, "schema": { - "$ref": "#/components/schemas/indices.add_block.IndicesBlockOptions" + "$ref": "#/components/schemas/indices._types.IndicesBlockOptions" }, "style": "simple" }, @@ -6700,7 +6700,7 @@ "indices": { "type": "array", "items": { - "$ref": "#/components/schemas/indices.add_block.IndicesBlockStatus" + "$ref": "#/components/schemas/indices.add_block.AddIndicesBlockStatus" } } }, @@ -6722,6 +6722,123 @@ }, "x-state": "Generally available", "x-product-feature": "elasticsearch" + }, + "delete": { + "tags": [ + "indices" + ], + "summary": "Remove an index block", + "description": "Remove an index block from an index.\nIndex blocks limit the operations allowed on an index by blocking specific operation types.\n\n## Required authorization\n\n* Index privileges: `manage`\n", + "operationId": "indices-remove-block", + "parameters": [ + { + "in": "path", + "name": "index", + "description": "A comma-separated list or wildcard expression of index names used to limit the request.\nBy default, you must explicitly name the indices you are removing blocks from.\nTo allow the removal of blocks from indices with `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to `false`.\nYou can update this setting in the `elasticsearch.yml` file or by using the cluster update settings API.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "style": "simple" + }, + { + "in": "path", + "name": "block", + "description": "The block type to remove from the index.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/indices._types.IndicesBlockOptions" + }, + "style": "simple" + }, + { + "in": "query", + "name": "allow_no_indices", + "description": "If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "expand_wildcards", + "description": "The type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nIt supports comma-separated values, such as `open,hidden`.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.ExpandWildcards" + }, + "style": "form" + }, + { + "in": "query", + "name": "ignore_unavailable", + "description": "If `false`, the request returns an error if it targets a missing or closed index.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, + { + "in": "query", + "name": "master_timeout", + "description": "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + }, + { + "in": "query", + "name": "timeout", + "description": "The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.\nIf no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.\nIt can also be set to `-1` to indicate that the request should never timeout.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Duration" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean" + }, + "indices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/indices.remove_block.RemoveIndicesBlockStatus" + } + } + }, + "required": [ + "acknowledged", + "indices" + ] + }, + "examples": { + "IndicesRemoveBlockResponseExample1": { + "description": "A successful response from `DELETE /my-index-000001/_block/write`, which removes an index block from an index.'", + "value": "{\n \"acknowledged\" : true,\n \"indices\" : [ {\n \"name\" : \"my-index-000001\",\n \"unblocked\" : true\n } ]\n}" + } + } + } + } + } + }, + "x-state": "Generally available", + "x-product-feature": "elasticsearch" } }, "/_analyze": { @@ -51269,7 +51386,7 @@ "weight" ] }, - "indices.add_block.IndicesBlockOptions": { + "indices._types.IndicesBlockOptions": { "type": "string", "enum": [ "metadata", @@ -51278,7 +51395,7 @@ "write" ] }, - "indices.add_block.IndicesBlockStatus": { + "indices.add_block.AddIndicesBlockStatus": { "type": "object", "properties": { "name": { @@ -52074,6 +52191,23 @@ } } }, + "indices.remove_block.RemoveIndicesBlockStatus": { + "type": "object", + "properties": { + "name": { + "$ref": "#/components/schemas/_types.IndexName" + }, + "unblocked": { + "type": "boolean" + }, + "exception": { + "$ref": "#/components/schemas/_types.ErrorCause" + } + }, + "required": [ + "name" + ] + }, "indices.resolve_index.ResolveIndexItem": { "type": "object", "properties": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 4efe6dce4d..1ffea1f517 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -8995,17 +8995,33 @@ }, { "availability": { - "stack": { + "serverless": { "stability": "stable", "visibility": "public" + }, + "stack": { + "since": "9.1.0", + "stability": "stable" } }, - "description": "Removes a block from an index.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-blocks.html", + "description": "Remove an index block.\n\nRemove an index block from an index.\nIndex blocks limit the operations allowed on an index by blocking specific operation types.", + "docId": "index-block-remove", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-remove-block", "name": "indices.remove_block", - "request": null, + "privileges": { + "index": [ + "manage" + ] + }, + "request": { + "name": "Request", + "namespace": "indices.remove_block" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "indices.remove_block" + }, "responseMediaType": [ "application/json" ], @@ -141837,7 +141853,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L423-L425" + "specLocation": "indices/_types/IndexSettings.ts#L434-L436" }, { "kind": "interface", @@ -142855,7 +142871,7 @@ "name": "IndexCheckOnStartup", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L272-L279" + "specLocation": "indices/_types/IndexSettings.ts#L283-L290" }, { "kind": "enum", @@ -144268,7 +144284,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L335-L341" + "specLocation": "indices/_types/IndexSettings.ts#L346-L352" }, { "kind": "interface", @@ -144386,7 +144402,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L286-L325" + "specLocation": "indices/_types/IndexSettings.ts#L297-L336" }, { "kind": "interface", @@ -144408,7 +144424,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L327-L333" + "specLocation": "indices/_types/IndexSettings.ts#L338-L344" }, { "kind": "interface", @@ -144440,7 +144456,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L343-L346" + "specLocation": "indices/_types/IndexSettings.ts#L354-L357" }, { "kind": "interface", @@ -144861,7 +144877,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L281-L284" + "specLocation": "indices/_types/IndexSettings.ts#L292-L295" }, { "kind": "interface", @@ -144882,7 +144898,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L579-L581" + "specLocation": "indices/_types/IndexSettings.ts#L590-L592" }, { "kind": "interface", @@ -144904,7 +144920,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L583-L590" + "specLocation": "indices/_types/IndexSettings.ts#L594-L601" }, { "kind": "interface", @@ -144958,7 +144974,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L592-L597" + "specLocation": "indices/_types/IndexSettings.ts#L603-L608" }, { "kind": "interface", @@ -144982,7 +144998,33 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L599-L606" + "specLocation": "indices/_types/IndexSettings.ts#L610-L617" + }, + { + "kind": "enum", + "members": [ + { + "description": "Disable metadata changes, such as closing the index.", + "name": "metadata" + }, + { + "description": "Disable read operations.", + "name": "read" + }, + { + "description": "Disable write operations and metadata changes.", + "name": "read_only" + }, + { + "description": "Disable write operations. However, metadata changes are still allowed.", + "name": "write" + } + ], + "name": { + "name": "IndicesBlockOptions", + "namespace": "indices._types" + }, + "specLocation": "indices/_types/IndexSettings.ts#L272-L281" }, { "kind": "enum", @@ -145128,7 +145170,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L427-L441" + "specLocation": "indices/_types/IndexSettings.ts#L438-L452" }, { "kind": "interface", @@ -145151,7 +145193,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L462-L469" + "specLocation": "indices/_types/IndexSettings.ts#L473-L480" }, { "kind": "interface", @@ -145173,7 +145215,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L499-L505" + "specLocation": "indices/_types/IndexSettings.ts#L510-L516" }, { "kind": "interface", @@ -145195,7 +145237,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L490-L497" + "specLocation": "indices/_types/IndexSettings.ts#L501-L508" }, { "kind": "interface", @@ -145218,7 +145260,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L471-L479" + "specLocation": "indices/_types/IndexSettings.ts#L482-L490" }, { "kind": "interface", @@ -145241,7 +145283,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L481-L488" + "specLocation": "indices/_types/IndexSettings.ts#L492-L499" }, { "kind": "interface", @@ -145262,7 +145304,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L507-L509" + "specLocation": "indices/_types/IndexSettings.ts#L518-L520" }, { "kind": "interface", @@ -145322,7 +145364,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L443-L460" + "specLocation": "indices/_types/IndexSettings.ts#L454-L471" }, { "kind": "interface", @@ -145343,7 +145385,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L348-L350" + "specLocation": "indices/_types/IndexSettings.ts#L359-L361" }, { "kind": "interface", @@ -145393,7 +145435,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L352-L355" + "specLocation": "indices/_types/IndexSettings.ts#L363-L366" }, { "kind": "interface", @@ -145451,7 +145493,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L419-L421" + "specLocation": "indices/_types/IndexSettings.ts#L430-L432" }, { "kind": "interface", @@ -146097,7 +146139,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L517-L522" + "specLocation": "indices/_types/IndexSettings.ts#L528-L533" }, { "kind": "interface", @@ -146151,7 +146193,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L529-L534" + "specLocation": "indices/_types/IndexSettings.ts#L540-L545" }, { "kind": "interface", @@ -146183,7 +146225,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L524-L527" + "specLocation": "indices/_types/IndexSettings.ts#L535-L538" }, { "kind": "interface", @@ -146237,7 +146279,7 @@ "name": "SourceMode", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L511-L515" + "specLocation": "indices/_types/IndexSettings.ts#L522-L526" }, { "kind": "interface", @@ -146282,7 +146324,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L536-L547" + "specLocation": "indices/_types/IndexSettings.ts#L547-L558" }, { "kind": "enum", @@ -146309,7 +146351,7 @@ "name": "StorageType", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L549-L577" + "specLocation": "indices/_types/IndexSettings.ts#L560-L588" }, { "kind": "interface", @@ -146466,7 +146508,7 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L357-L379" + "specLocation": "indices/_types/IndexSettings.ts#L368-L390" }, { "kind": "enum", @@ -146490,7 +146532,7 @@ "name": "TranslogDurability", "namespace": "indices._types" }, - "specLocation": "indices/_types/IndexSettings.ts#L381-L396" + "specLocation": "indices/_types/IndexSettings.ts#L392-L407" }, { "kind": "interface", @@ -146526,38 +146568,12 @@ } } ], - "specLocation": "indices/_types/IndexSettings.ts#L398-L417" - }, - { - "kind": "enum", - "members": [ - { - "description": "Disable metadata changes, such as closing the index.", - "name": "metadata" - }, - { - "description": "Disable read operations.", - "name": "read" - }, - { - "description": "Disable write operations and metadata changes.", - "name": "read_only" - }, - { - "description": "Disable write operations. However, metadata changes are still allowed.", - "name": "write" - } - ], - "name": { - "name": "IndicesBlockOptions", - "namespace": "indices.add_block" - }, - "specLocation": "indices/add_block/IndicesAddBlockRequest.ts#L91-L100" + "specLocation": "indices/_types/IndexSettings.ts#L409-L428" }, { "kind": "interface", "name": { - "name": "IndicesBlockStatus", + "name": "AddIndicesBlockStatus", "namespace": "indices.add_block" }, "properties": [ @@ -146657,7 +146673,7 @@ "kind": "instance_of", "type": { "name": "IndicesBlockOptions", - "namespace": "indices.add_block" + "namespace": "indices._types" } } } @@ -146729,7 +146745,7 @@ } } ], - "specLocation": "indices/add_block/IndicesAddBlockRequest.ts#L24-L89" + "specLocation": "indices/add_block/IndicesAddBlockRequest.ts#L25-L90" }, { "kind": "response", @@ -146766,7 +146782,7 @@ "value": { "kind": "instance_of", "type": { - "name": "IndicesBlockStatus", + "name": "AddIndicesBlockStatus", "namespace": "indices.add_block" } } @@ -158738,6 +158754,238 @@ }, "specLocation": "indices/reload_search_analyzers/ReloadSearchAnalyzersResponse.ts#L22-L25" }, + { + "kind": "interface", + "name": { + "name": "RemoveIndicesBlockStatus", + "namespace": "indices.remove_block" + }, + "properties": [ + { + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + }, + { + "name": "unblocked", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "exception", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ErrorCause", + "namespace": "_types" + } + } + } + ], + "specLocation": "indices/remove_block/IndicesRemoveBlockResponse.ts#L30-L34" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Remove an index block.\n\nRemove an index block from an index.\nIndex blocks limit the operations allowed on an index by blocking specific operation types.", + "examples": { + "IndicesRemoveBlockRequestExample1": { + "alternatives": [ + { + "code": "resp = client.indices.remove_block(\n index=\"my-index-000001\",\n block=\"write\",\n)", + "language": "Python" + }, + { + "code": "const response = await client.indices.removeBlock({\n index: \"my-index-000001\",\n block: \"write\",\n});", + "language": "JavaScript" + }, + { + "code": "response = client.indices.remove_block(\n index: \"my-index-000001\",\n block: \"write\"\n)", + "language": "Ruby" + }, + { + "code": "$resp = $client->indices()->removeBlock([\n \"index\" => \"my-index-000001\",\n \"block\" => \"write\",\n]);", + "language": "PHP" + }, + { + "code": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/my-index-000001/_block/write\"", + "language": "curl" + }, + { + "code": "client.indices().removeBlock(a -> a\n .block(IndicesBlockOptions.Write)\n .index(\"my-index-000001\")\n);\n", + "language": "Java" + } + ], + "method_request": "DELETE /my-index-000001/_block/write" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "indices.remove_block" + }, + "path": [ + { + "description": "A comma-separated list or wildcard expression of index names used to limit the request.\nBy default, you must explicitly name the indices you are removing blocks from.\nTo allow the removal of blocks from indices with `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to `false`.\nYou can update this setting in the `elasticsearch.yml` file or by using the cluster update settings API.", + "name": "index", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndexName", + "namespace": "_types" + } + } + }, + { + "description": "The block type to remove from the index.", + "name": "block", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IndicesBlockOptions", + "namespace": "indices._types" + } + } + } + ], + "query": [ + { + "description": "If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.", + "name": "allow_no_indices", + "required": false, + "serverDefault": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "The type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nIt supports comma-separated values, such as `open,hidden`.", + "name": "expand_wildcards", + "required": false, + "serverDefault": "open", + "type": { + "kind": "instance_of", + "type": { + "name": "ExpandWildcards", + "namespace": "_types" + } + } + }, + { + "description": "If `false`, the request returns an error if it targets a missing or closed index.", + "name": "ignore_unavailable", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "description": "The period to wait for the master node.\nIf the master node is not available before the timeout expires, the request fails and returns an error.\nIt can also be set to `-1` to indicate that the request should never timeout.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata.\nIf no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged.\nIt can also be set to `-1` to indicate that the request should never timeout.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "indices/remove_block/IndicesRemoveBlockRequest.ts#L25-L91" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "acknowledged", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "indices", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "RemoveIndicesBlockStatus", + "namespace": "indices.remove_block" + } + } + } + } + ] + }, + "examples": { + "IndicesRemoveBlockResponseExample1": { + "description": "A successful response from `DELETE /my-index-000001/_block/write`, which removes an index block from an index.'", + "value": "{\n \"acknowledged\" : true,\n \"indices\" : [ {\n \"name\" : \"my-index-000001\",\n \"unblocked\" : true\n } ]\n}" + } + }, + "name": { + "name": "Response", + "namespace": "indices.remove_block" + }, + "specLocation": "indices/remove_block/IndicesRemoveBlockResponse.ts#L23-L28" + }, { "kind": "request", "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 46545aba03..2384b7e5da 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11808,6 +11808,8 @@ export interface IndicesIndexingSlowlogTresholds { index?: IndicesSlowlogTresholdLevels } +export type IndicesIndicesBlockOptions = 'metadata' | 'read' | 'read_only' | 'write' + export type IndicesManagedBy = 'Index Lifecycle Management' | 'Data stream lifecycle' | 'Unmanaged' export interface IndicesMappingLimitSettings { @@ -12006,16 +12008,14 @@ export interface IndicesTranslogRetention { age?: Duration } -export type IndicesAddBlockIndicesBlockOptions = 'metadata' | 'read' | 'read_only' | 'write' - -export interface IndicesAddBlockIndicesBlockStatus { +export interface IndicesAddBlockAddIndicesBlockStatus { name: IndexName blocked: boolean } export interface IndicesAddBlockRequest extends RequestBase { index: IndexName - block: IndicesAddBlockIndicesBlockOptions + block: IndicesIndicesBlockOptions allow_no_indices?: boolean expand_wildcards?: ExpandWildcards ignore_unavailable?: boolean @@ -12026,7 +12026,7 @@ export interface IndicesAddBlockRequest extends RequestBase { export interface IndicesAddBlockResponse { acknowledged: boolean shards_acknowledged: boolean - indices: IndicesAddBlockIndicesBlockStatus[] + indices: IndicesAddBlockAddIndicesBlockStatus[] } export interface IndicesAnalyzeAnalyzeDetail { @@ -13025,6 +13025,27 @@ export interface IndicesReloadSearchAnalyzersRequest extends RequestBase { export type IndicesReloadSearchAnalyzersResponse = IndicesReloadSearchAnalyzersReloadResult +export interface IndicesRemoveBlockRemoveIndicesBlockStatus { + name: IndexName + unblocked?: boolean + exception?: ErrorCause +} + +export interface IndicesRemoveBlockRequest extends RequestBase { + index: IndexName + block: IndicesIndicesBlockOptions + allow_no_indices?: boolean + expand_wildcards?: ExpandWildcards + ignore_unavailable?: boolean + master_timeout?: Duration + timeout?: Duration +} + +export interface IndicesRemoveBlockResponse { + acknowledged: boolean + indices: IndicesRemoveBlockRemoveIndicesBlockStatus[] +} + export interface IndicesResolveClusterRequest extends RequestBase { name?: Names allow_no_indices?: boolean diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 9cdcf32a82..205b0f9fb3 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -284,6 +284,7 @@ ilm-start,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation- ilm-stop,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-stop,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/ilm-stop.html important-settings,https://www.elastic.co/docs/deploy-manage/deploy/self-managed/important-settings-configuration, index-block-add,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-add-block, +index-block-remove,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-remove-block, index-modules-blocks,https://www.elastic.co/docs/reference/elasticsearch/index-settings/index-block, index-modules-settings,https://www.elastic.co/docs/reference/elasticsearch/index-settings/index-modules, index-modules-slowlog-slowlog,https://www.elastic.co/docs/reference/elasticsearch/index-settings/slow-log#index-slow-log, diff --git a/specification/indices/_types/IndexSettings.ts b/specification/indices/_types/IndexSettings.ts index 531062ffc0..9705a7c786 100644 --- a/specification/indices/_types/IndexSettings.ts +++ b/specification/indices/_types/IndexSettings.ts @@ -269,6 +269,17 @@ export class IndexSettingBlocks { metadata?: Stringified } +export enum IndicesBlockOptions { + /** Disable metadata changes, such as closing the index. */ + metadata, + /** Disable read operations. */ + read, + /** Disable write operations and metadata changes. */ + read_only, + /** Disable write operations. However, metadata changes are still allowed. */ + write +} + /** * @es_quirk This is a boolean that evolved into an enum. ES also accepts plain booleans for true and false. */ diff --git a/specification/indices/add_block/IndicesAddBlockRequest.ts b/specification/indices/add_block/IndicesAddBlockRequest.ts index 4e553ccb3e..8b4768931d 100644 --- a/specification/indices/add_block/IndicesAddBlockRequest.ts +++ b/specification/indices/add_block/IndicesAddBlockRequest.ts @@ -20,6 +20,7 @@ import { RequestBase } from '@_types/Base' import { ExpandWildcards, IndexName } from '@_types/common' import { Duration } from '@_types/Time' +import { IndicesBlockOptions } from '@indices/_types/IndexSettings' /** * Add an index block. @@ -87,14 +88,3 @@ export interface Request extends RequestBase { timeout?: Duration // default: 30s } } - -export enum IndicesBlockOptions { - /** Disable metadata changes, such as closing the index. */ - metadata, - /** Disable read operations. */ - read, - /** Disable write operations and metadata changes. */ - read_only, - /** Disable write operations. However, metadata changes are still allowed. */ - write -} diff --git a/specification/indices/add_block/IndicesAddBlockResponse.ts b/specification/indices/add_block/IndicesAddBlockResponse.ts index b6b89b827f..35caca4736 100644 --- a/specification/indices/add_block/IndicesAddBlockResponse.ts +++ b/specification/indices/add_block/IndicesAddBlockResponse.ts @@ -23,11 +23,11 @@ export class Response { body: { acknowledged: boolean shards_acknowledged: boolean - indices: IndicesBlockStatus[] + indices: AddIndicesBlockStatus[] } } -export class IndicesBlockStatus { +export class AddIndicesBlockStatus { name: IndexName blocked: boolean } diff --git a/specification/indices/remove_block/IndicesRemoveBlockRequest.ts b/specification/indices/remove_block/IndicesRemoveBlockRequest.ts new file mode 100644 index 0000000000..027c3aa75d --- /dev/null +++ b/specification/indices/remove_block/IndicesRemoveBlockRequest.ts @@ -0,0 +1,91 @@ +/* + * 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 { ExpandWildcards, IndexName } from '@_types/common' +import { Duration } from '@_types/Time' +import { IndicesBlockOptions } from '@indices/_types/IndexSettings' + +/** + * Remove an index block. + * + * Remove an index block from an index. + * Index blocks limit the operations allowed on an index by blocking specific operation types. + * @rest_spec_name indices.remove_block + * @availability stack since=9.1.0 stability=stable + * @availability serverless stability=stable visibility=public + * @doc_id index-block-remove + * @index_privileges manage + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/{index}/_block/{block}' + methods: ['DELETE'] + } + ] + path_parts: { + /** + * A comma-separated list or wildcard expression of index names used to limit the request. + * By default, you must explicitly name the indices you are removing blocks from. + * To allow the removal of blocks from indices with `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to `false`. + * You can update this setting in the `elasticsearch.yml` file or by using the cluster update settings API. + */ + index: IndexName + /** + * The block type to remove from the index. + */ + block: IndicesBlockOptions + } + query_parameters: { + /** + * If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. + * This behavior applies even if the request targets other open indices. + * For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. + * @server_default true + */ + allow_no_indices?: boolean // default: true + /** + * The type of index that wildcard patterns can match. + * If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + * It supports comma-separated values, such as `open,hidden`. + * @server_default open + */ + expand_wildcards?: ExpandWildcards // default: open + /** + * If `false`, the request returns an error if it targets a missing or closed index. + * @server_default false + */ + ignore_unavailable?: boolean // default: false + /** + * The period to wait for the master node. + * If the master node is not available before the timeout expires, the request fails and returns an error. + * It can also be set to `-1` to indicate that the request should never timeout. + * @server_default 30s + */ + master_timeout?: Duration // default: 30s + /** + * The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata. + * If no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged. + * It can also be set to `-1` to indicate that the request should never timeout. + * @server_default 30s + */ + timeout?: Duration // default: 30s + } +} diff --git a/specification/indices/remove_block/IndicesRemoveBlockResponse.ts b/specification/indices/remove_block/IndicesRemoveBlockResponse.ts new file mode 100644 index 0000000000..48777e175e --- /dev/null +++ b/specification/indices/remove_block/IndicesRemoveBlockResponse.ts @@ -0,0 +1,34 @@ +/* + * 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 { IndexName } from '@_types/common' +import { ErrorCause } from '@_types/Errors' + +export class Response { + body: { + acknowledged: boolean + indices: RemoveIndicesBlockStatus[] + } +} + +export class RemoveIndicesBlockStatus { + name: IndexName + unblocked?: boolean + exception?: ErrorCause +} diff --git a/specification/indices/remove_block/examples/request/IndicesRemoveBlockRequestExample1.yaml b/specification/indices/remove_block/examples/request/IndicesRemoveBlockRequestExample1.yaml new file mode 100644 index 0000000000..d68070eadd --- /dev/null +++ b/specification/indices/remove_block/examples/request/IndicesRemoveBlockRequestExample1.yaml @@ -0,0 +1,34 @@ +method_request: DELETE /my-index-000001/_block/write +alternatives: + - language: Python + code: |- + resp = client.indices.remove_block( + index="my-index-000001", + block="write", + ) + - language: JavaScript + code: |- + const response = await client.indices.removeBlock({ + index: "my-index-000001", + block: "write", + }); + - language: Ruby + code: |- + response = client.indices.remove_block( + index: "my-index-000001", + block: "write" + ) + - language: PHP + code: |- + $resp = $client->indices()->removeBlock([ + "index" => "my-index-000001", + "block" => "write", + ]); + - language: curl + code: 'curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/my-index-000001/_block/write"' + - language: Java + code: | + client.indices().removeBlock(a -> a + .block(IndicesBlockOptions.Write) + .index("my-index-000001") + ); diff --git a/specification/indices/remove_block/examples/response/IndicesRemoveBlockResponseExample1.yaml b/specification/indices/remove_block/examples/response/IndicesRemoveBlockResponseExample1.yaml new file mode 100644 index 0000000000..ddedd83f48 --- /dev/null +++ b/specification/indices/remove_block/examples/response/IndicesRemoveBlockResponseExample1.yaml @@ -0,0 +1,12 @@ +# summary: '' +description: A successful response from `DELETE /my-index-000001/_block/write`, which removes an index block from an index.' +# type: response +# response_code: 200 +value: |- + { + "acknowledged" : true, + "indices" : [ { + "name" : "my-index-000001", + "unblocked" : true + } ] + }