diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index a84f32b566..51f4142bee 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -35285,6 +35285,42 @@ ] } }, + "/_project/tags": { + "get": { + "tags": [ + "project" + ], + "summary": "Return tags defined for the project", + "description": "\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n", + "operationId": "project-tags", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/project.tags.ProjectTags" + }, + "examples": { + "ProjectTagsResponseExample1": { + "summary": "Project tags", + "description": "A successful response from `GET /_project/tags`", + "value": "{\n \"origin\": {\n \"c56c4f8849c64cc6ae59c261f40bd195\": {\n \"_id\": \"c56c4f8849c64cc6ae59c261f40bd195\"\n \"_type\": \"elasticsearch\",\n \"_alias\": \"project-1\",\n \"_csp\": \"aws\",\n \"_region\": \"us-east-1\"\n \"mytag1\": \"foo\",\n \"mytag2\": \"bar\"\n }\n },\n \"linked_projects\": {\n \"a3b88ea3f195a336ae59c261f40bd195\": {\n \"_id\": \"a3b88ea3f195a336ae59c261f40bd195\"\n \"_type\": \"security\",\n \"_alias\": \"project-2\",\n \"_csp\": \"aws\",\n \"_region\": \"us-east-1\"\n \"mytag1\": \"foo\",\n \"mytag2\": \"bar\"\n },\n \"f40bd195389s3761023ca7aa8a3r0932\": {\n \"_id\": \"f40bd195389s3761023ca7aa8a3r0932\"\n \"_type\": \"observability\",\n \"_alias\": \"project-3\",\n \"_csp\": \"aws\",\n \"_region\": \"us-east-1\"\n \"mytag1\": \"foo\",\n \"mytag2\": \"bar\"\n }\n }\n}" + } + } + } + } + } + }, + "x-state": "Technical preview", + "x-metaTags": [ + { + "content": "Elasticsearch", + "name": "product_name" + } + ] + } + }, "/_scripts/{id}/{context}": { "put": { "tags": [ @@ -117941,6 +117977,51 @@ "aggregations" ] }, + "project.tags.ProjectTags": { + "type": "object", + "properties": { + "origin": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/project.tags.Tags" + }, + "minProperties": 1, + "maxProperties": 1 + }, + "linked_projects": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/project.tags.Tags" + } + } + }, + "required": [ + "origin" + ] + }, + "project.tags.Tags": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_alias": { + "type": "string" + }, + "_type": { + "type": "string" + }, + "_organisation": { + "type": "string" + } + }, + "required": [ + "_id", + "_alias", + "_type", + "_organisation" + ] + }, "query_rules._types.QueryRule": { "type": "object", "properties": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index f9baabcf71..1341524764 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -22361,6 +22361,42 @@ ] } }, + "/_project/tags": { + "get": { + "tags": [ + "project" + ], + "summary": "Return tags defined for the project", + "description": "\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n", + "operationId": "project-tags", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/project.tags.ProjectTags" + }, + "examples": { + "ProjectTagsResponseExample1": { + "summary": "Project tags", + "description": "A successful response from `GET /_project/tags`", + "value": "{\n \"origin\": {\n \"c56c4f8849c64cc6ae59c261f40bd195\": {\n \"_id\": \"c56c4f8849c64cc6ae59c261f40bd195\"\n \"_type\": \"elasticsearch\",\n \"_alias\": \"project-1\",\n \"_csp\": \"aws\",\n \"_region\": \"us-east-1\"\n \"mytag1\": \"foo\",\n \"mytag2\": \"bar\"\n }\n },\n \"linked_projects\": {\n \"a3b88ea3f195a336ae59c261f40bd195\": {\n \"_id\": \"a3b88ea3f195a336ae59c261f40bd195\"\n \"_type\": \"security\",\n \"_alias\": \"project-2\",\n \"_csp\": \"aws\",\n \"_region\": \"us-east-1\"\n \"mytag1\": \"foo\",\n \"mytag2\": \"bar\"\n },\n \"f40bd195389s3761023ca7aa8a3r0932\": {\n \"_id\": \"f40bd195389s3761023ca7aa8a3r0932\"\n \"_type\": \"observability\",\n \"_alias\": \"project-3\",\n \"_csp\": \"aws\",\n \"_region\": \"us-east-1\"\n \"mytag1\": \"foo\",\n \"mytag2\": \"bar\"\n }\n }\n}" + } + } + } + } + } + }, + "x-state": "Technical preview", + "x-metaTags": [ + { + "content": "Elasticsearch", + "name": "product_name" + } + ] + } + }, "/_scripts/{id}/{context}": { "put": { "tags": [ @@ -77438,6 +77474,51 @@ "position" ] }, + "project.tags.ProjectTags": { + "type": "object", + "properties": { + "origin": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/project.tags.Tags" + }, + "minProperties": 1, + "maxProperties": 1 + }, + "linked_projects": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/project.tags.Tags" + } + } + }, + "required": [ + "origin" + ] + }, + "project.tags.Tags": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_alias": { + "type": "string" + }, + "_type": { + "type": "string" + }, + "_organisation": { + "type": "string" + } + }, + "required": [ + "_id", + "_alias", + "_type", + "_organisation" + ] + }, "query_rules._types.QueryRule": { "type": "object", "properties": { diff --git a/output/schema/schema.json b/output/schema/schema.json index f270765ed9..07a915710e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -16512,6 +16512,47 @@ } ] }, + { + "availability": { + "serverless": { + "stability": "experimental", + "visibility": "public" + }, + "stack": { + "stability": "experimental", + "visibility": "public" + } + }, + "description": "Return tags defined for the project", + "docId": "project-tags", + "docUrl": "", + "name": "project.tags", + "privileges": { + "cluster": [ + "monitor" + ] + }, + "request": { + "name": "Request", + "namespace": "project.tags" + }, + "requestBodyRequired": false, + "response": { + "name": "Response", + "namespace": "project.tags" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "GET" + ], + "path": "/_project/tags" + } + ] + }, { "availability": { "serverless": { @@ -226833,6 +226874,199 @@ ], "specLocation": "nodes/usage/NodesUsageResponse.ts#L25-L28" }, + { + "kind": "interface", + "name": { + "name": "ProjectTags", + "namespace": "project.tags" + }, + "properties": [ + { + "name": "origin", + "required": true, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": true, + "value": { + "kind": "instance_of", + "type": { + "name": "Tags", + "namespace": "project.tags" + } + } + } + }, + { + "name": "linked_projects", + "required": false, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "Tags", + "namespace": "project.tags" + } + } + } + } + ], + "specLocation": "project/tags/TagsResponse.ts#L34-L37" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Return tags defined for the project", + "examples": { + "ProjectTagsRequestExample1": { + "method_request": "GET /_project/tags" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "project.tags" + }, + "path": [], + "query": [], + "specLocation": "project/tags/TagsRequest.ts#L22-L35" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "project_tags", + "value": { + "kind": "instance_of", + "type": { + "name": "ProjectTags", + "namespace": "project.tags" + } + } + }, + "examples": { + "ProjectTagsResponseExample1": { + "description": "A successful response from `GET /_project/tags`", + "summary": "Project tags", + "value": "{\n \"origin\": {\n \"c56c4f8849c64cc6ae59c261f40bd195\": {\n \"_id\": \"c56c4f8849c64cc6ae59c261f40bd195\"\n \"_type\": \"elasticsearch\",\n \"_alias\": \"project-1\",\n \"_csp\": \"aws\",\n \"_region\": \"us-east-1\"\n \"mytag1\": \"foo\",\n \"mytag2\": \"bar\"\n }\n },\n \"linked_projects\": {\n \"a3b88ea3f195a336ae59c261f40bd195\": {\n \"_id\": \"a3b88ea3f195a336ae59c261f40bd195\"\n \"_type\": \"security\",\n \"_alias\": \"project-2\",\n \"_csp\": \"aws\",\n \"_region\": \"us-east-1\"\n \"mytag1\": \"foo\",\n \"mytag2\": \"bar\"\n },\n \"f40bd195389s3761023ca7aa8a3r0932\": {\n \"_id\": \"f40bd195389s3761023ca7aa8a3r0932\"\n \"_type\": \"observability\",\n \"_alias\": \"project-3\",\n \"_csp\": \"aws\",\n \"_region\": \"us-east-1\"\n \"mytag1\": \"foo\",\n \"mytag2\": \"bar\"\n }\n }\n}" + } + }, + "name": { + "name": "Response", + "namespace": "project.tags" + }, + "specLocation": "project/tags/TagsResponse.ts#L39-L44" + }, + { + "kind": "interface", + "attachedBehaviors": [ + "AdditionalProperties" + ], + "behaviors": [ + { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ], + "meta": { + "description": "Additional tags defined by user.", + "fieldname": "user_defined_tags" + }, + "type": { + "name": "AdditionalProperties", + "namespace": "_spec_utils" + } + } + ], + "name": { + "name": "Tags", + "namespace": "project.tags" + }, + "properties": [ + { + "name": "_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "_alias", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "_organisation", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "project/tags/TagsResponse.ts#L24-L32" + }, { "kind": "interface", "name": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index de561b77c2..b8e6b80aca 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -19388,6 +19388,25 @@ export interface NodesUsageResponseBase extends NodesNodesResponseBase { nodes: Record } +export interface ProjectTagsProjectTags { + origin: Partial> + linked_projects?: Record +} + +export interface ProjectTagsRequest extends RequestBase { +} + +export type ProjectTagsResponse = ProjectTagsProjectTags + +export interface ProjectTagsTagsKeys { + _id: string + _alias: string + _type: string + _organisation: string +} +export type ProjectTagsTags = ProjectTagsTagsKeys + & { [property: string]: string } + export interface QueryRulesQueryRule { rule_id: Id type: QueryRulesQueryRuleType diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 9fcc724b7b..5c45b9fbc1 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -523,6 +523,7 @@ point-in-time-api,https://www.elastic.co/docs/api/doc/elasticsearch/operation/op prevalidate-node-removal,https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cluster,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/cluster.html, preview-dfanalytics,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-preview-data-frame-analytics,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/preview-dfanalytics.html, preview-transform,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-preview-transform,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/preview-transform.html, +project-tags,,, put-analytics-collection,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put-behavioral-analytics,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-analytics-collection.html, put-dfanalytics,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-data-frame-analytics,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-dfanalytics.html, put-enrich-policy-api,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-put-policy,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-enrich-policy-api.html, diff --git a/specification/_json_spec/project.tags.json b/specification/_json_spec/project.tags.json new file mode 100644 index 0000000000..290c755903 --- /dev/null +++ b/specification/_json_spec/project.tags.json @@ -0,0 +1,21 @@ +{ + "project.tags": { + "documentation": { + "url": "", + "description": "Return tags defined for the project" + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": ["application/json"] + }, + "url": { + "paths": [ + { + "path": "/_project/tags", + "methods": ["GET"] + } + ] + } + } +} diff --git a/specification/project/tags/TagsRequest.ts b/specification/project/tags/TagsRequest.ts new file mode 100644 index 0000000000..3158917439 --- /dev/null +++ b/specification/project/tags/TagsRequest.ts @@ -0,0 +1,35 @@ +/* + * 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' + +/** + * @doc_id project-tags + * @rest_spec_name project.tags + * @availability serverless stability=experimental visibility=public + * @cluster_privileges monitor + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_project/tags' + methods: ['GET'] + } + ] +} diff --git a/specification/project/tags/TagsResponse.ts b/specification/project/tags/TagsResponse.ts new file mode 100644 index 0000000000..78345ae998 --- /dev/null +++ b/specification/project/tags/TagsResponse.ts @@ -0,0 +1,43 @@ +/* + * 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 { AdditionalProperties } from '@spec_utils/behaviors' +import { Dictionary, SingleKeyDictionary } from '@spec_utils/Dictionary' + +/** + * @behavior_meta AdditionalProperties fieldname=user_defined_tags description="Additional tags defined by user." + */ +class Tags implements AdditionalProperties { + _id: string + _alias: string + _type: string + _organisation: string +} + +class ProjectTags { + origin: SingleKeyDictionary + linked_projects?: Dictionary +} + +export class Response { + /** + * @codegen_name project_tags + */ + body: ProjectTags +} diff --git a/specification/project/tags/examples/request/ProjectTagsRequestExample1.yaml b/specification/project/tags/examples/request/ProjectTagsRequestExample1.yaml new file mode 100644 index 0000000000..6747d1a863 --- /dev/null +++ b/specification/project/tags/examples/request/ProjectTagsRequestExample1.yaml @@ -0,0 +1 @@ +method_request: GET /_project/tags diff --git a/specification/project/tags/examples/response/ProjectTagsResponseExample1.yaml b/specification/project/tags/examples/response/ProjectTagsResponseExample1.yaml new file mode 100644 index 0000000000..4be8937862 --- /dev/null +++ b/specification/project/tags/examples/response/ProjectTagsResponseExample1.yaml @@ -0,0 +1,38 @@ +summary: Project tags +description: A successful response from `GET /_project/tags` +# type: response +# response_code: 200 +value: |- + { + "origin": { + "c56c4f8849c64cc6ae59c261f40bd195": { + "_id": "c56c4f8849c64cc6ae59c261f40bd195" + "_type": "elasticsearch", + "_alias": "project-1", + "_csp": "aws", + "_region": "us-east-1" + "mytag1": "foo", + "mytag2": "bar" + } + }, + "linked_projects": { + "a3b88ea3f195a336ae59c261f40bd195": { + "_id": "a3b88ea3f195a336ae59c261f40bd195" + "_type": "security", + "_alias": "project-2", + "_csp": "aws", + "_region": "us-east-1" + "mytag1": "foo", + "mytag2": "bar" + }, + "f40bd195389s3761023ca7aa8a3r0932": { + "_id": "f40bd195389s3761023ca7aa8a3r0932" + "_type": "observability", + "_alias": "project-3", + "_csp": "aws", + "_region": "us-east-1" + "mytag1": "foo", + "mytag2": "bar" + } + } + } diff --git a/specification/tsconfig.json b/specification/tsconfig.json index 867d8f0655..a3e164744e 100644 --- a/specification/tsconfig.json +++ b/specification/tsconfig.json @@ -42,6 +42,7 @@ "@ml/*": ["ml/*"], "@monitoring/*": ["monitoring/*"], "@nodes/*": ["nodes/*"], + "@project/*": ["project/*"], "@query_ruleset/*": ["query_ruleset/*"], "@rollup/*": ["rollup/*"], "@searchable_snapshots/*": ["searchable_snapshots/*"],