From 66572888d4502f29b7585e1b862b68531f4f4312 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 24 Nov 2025 16:56:57 +0400 Subject: [PATCH] Add fleet.secret private APIs --- output/schema/schema.json | 227 +++++++++++++++++- output/typescript/types.ts | 27 +++ .../delete_secret/FleetDeleteSecretRequest.ts | 39 +++ .../FleetDeleteSecretResponse.ts | 24 ++ .../fleet/get_secret/FleetGetSecretRequest.ts | 39 +++ .../get_secret/FleetGetSecretResponse.ts | 25 ++ .../post_secret/FleetPostSecretRequest.ts | 38 +++ .../post_secret/FleetPostSecretResponse.ts | 24 ++ 8 files changed, 434 insertions(+), 9 deletions(-) create mode 100644 specification/fleet/delete_secret/FleetDeleteSecretRequest.ts create mode 100644 specification/fleet/delete_secret/FleetDeleteSecretResponse.ts create mode 100644 specification/fleet/get_secret/FleetGetSecretRequest.ts create mode 100644 specification/fleet/get_secret/FleetGetSecretResponse.ts create mode 100644 specification/fleet/post_secret/FleetPostSecretRequest.ts create mode 100644 specification/fleet/post_secret/FleetPostSecretResponse.ts diff --git a/output/schema/schema.json b/output/schema/schema.json index 5d4331d5dd..f6e274aa78 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -5651,12 +5651,18 @@ "visibility": "private" } }, - "description": "Deletes a secret stored by Fleet", + "description": "Deletes a secret stored by Fleet.", "docUrl": null, "name": "fleet.delete_secret", - "request": null, + "request": { + "name": "Request", + "namespace": "fleet.delete_secret" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "fleet.delete_secret" + }, "responseMediaType": [ "application/json" ], @@ -5676,12 +5682,18 @@ "visibility": "private" } }, - "description": "Retrieves a secret stored by Fleet", + "description": "Retrieves a secret stored by Fleet.", "docUrl": null, "name": "fleet.get_secret", - "request": null, + "request": { + "name": "Request", + "namespace": "fleet.get_secret" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "fleet.get_secret" + }, "responseMediaType": [ "application/json" ], @@ -5794,12 +5806,18 @@ "visibility": "private" } }, - "description": "Creates a secret stored by Fleet", + "description": "Creates a secret stored by Fleet.", "docUrl": null, "name": "fleet.post_secret", - "request": null, + "request": { + "name": "Request", + "namespace": "fleet.post_secret" + }, "requestBodyRequired": true, - "response": null, + "response": { + "name": "Response", + "namespace": "fleet.post_secret" + }, "responseMediaType": [ "application/json" ], @@ -144651,6 +144669,137 @@ } } }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Deletes a secret stored by Fleet.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "fleet.delete_secret" + }, + "path": [ + { + "description": "The ID of the secret", + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "query": [], + "specLocation": "fleet/delete_secret/FleetDeleteSecretRequest.ts#L24-L41" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "deleted", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ] + }, + "name": { + "name": "Response", + "namespace": "fleet.delete_secret" + }, + "specLocation": "fleet/delete_secret/FleetDeleteSecretResponse.ts#L20-L24" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Retrieves a secret stored by Fleet.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "fleet.get_secret" + }, + "path": [ + { + "description": "The ID of the secret", + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "query": [], + "specLocation": "fleet/get_secret/FleetGetSecretRequest.ts#L24-L41" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "value", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ] + }, + "name": { + "name": "Response", + "namespace": "fleet.get_secret" + }, + "specLocation": "fleet/get_secret/FleetGetSecretResponse.ts#L20-L25" + }, { "kind": "request", "attachedBehaviors": [ @@ -145062,6 +145211,66 @@ }, "specLocation": "fleet/msearch/MultiSearchResponse.ts#L25-L29" }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "name": "value", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ] + }, + "description": "Creates a secret stored by Fleet.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "fleet.post_secret" + }, + "path": [], + "query": [], + "specLocation": "fleet/post_secret/FleetPostSecretRequest.ts#L23-L39" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ] + }, + "name": { + "name": "Response", + "namespace": "fleet.post_secret" + }, + "specLocation": "fleet/post_secret/FleetPostSecretResponse.ts#L21-L25" + }, { "kind": "request", "attachedBehaviors": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index b6fc1f0aca..dfcc17edcd 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -11437,6 +11437,23 @@ export interface FeaturesResetFeaturesResponse { export type FleetCheckpoint = long +export interface FleetDeleteSecretRequest extends RequestBase { + id: string +} + +export interface FleetDeleteSecretResponse { + deleted: boolean +} + +export interface FleetGetSecretRequest extends RequestBase { + id: string +} + +export interface FleetGetSecretResponse { + id: string + value: string +} + export interface FleetGlobalCheckpointsRequest extends RequestBase { index: IndexName | IndexAlias wait_for_advance?: boolean @@ -11472,6 +11489,16 @@ export interface FleetMsearchResponse { docs: MsearchResponseItem[] } +export interface FleetPostSecretRequest extends RequestBase { + body?: { + value: string + } +} + +export interface FleetPostSecretResponse { + id: string +} + export interface FleetSearchRequest extends RequestBase { index: IndexName | IndexAlias allow_no_indices?: boolean diff --git a/specification/fleet/delete_secret/FleetDeleteSecretRequest.ts b/specification/fleet/delete_secret/FleetDeleteSecretRequest.ts new file mode 100644 index 0000000000..e31b304253 --- /dev/null +++ b/specification/fleet/delete_secret/FleetDeleteSecretRequest.ts @@ -0,0 +1,39 @@ +/* + * 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' + +/** + * Deletes a secret stored by Fleet. + * + * @rest_spec_name fleet.delete_secret + * @availability stack stability=experimental visibility=private + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_fleet/secret/{id}' + methods: ['DELETE'] + } + ] + path_parts: { + /** The ID of the secret */ + id: string + } +} diff --git a/specification/fleet/delete_secret/FleetDeleteSecretResponse.ts b/specification/fleet/delete_secret/FleetDeleteSecretResponse.ts new file mode 100644 index 0000000000..51d10bac9a --- /dev/null +++ b/specification/fleet/delete_secret/FleetDeleteSecretResponse.ts @@ -0,0 +1,24 @@ +/* + * 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. + */ + +export class Response { + body: { + deleted: boolean + } +} diff --git a/specification/fleet/get_secret/FleetGetSecretRequest.ts b/specification/fleet/get_secret/FleetGetSecretRequest.ts new file mode 100644 index 0000000000..2624de94c2 --- /dev/null +++ b/specification/fleet/get_secret/FleetGetSecretRequest.ts @@ -0,0 +1,39 @@ +/* + * 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' + +/** + * Retrieves a secret stored by Fleet. + * + * @rest_spec_name fleet.get_secret + * @availability stack stability=experimental visibility=private + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_fleet/secret/{id}' + methods: ['GET'] + } + ] + path_parts: { + /** The ID of the secret */ + id: string + } +} diff --git a/specification/fleet/get_secret/FleetGetSecretResponse.ts b/specification/fleet/get_secret/FleetGetSecretResponse.ts new file mode 100644 index 0000000000..f30aae70fc --- /dev/null +++ b/specification/fleet/get_secret/FleetGetSecretResponse.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +export class Response { + body: { + id: string + value: string + } +} diff --git a/specification/fleet/post_secret/FleetPostSecretRequest.ts b/specification/fleet/post_secret/FleetPostSecretRequest.ts new file mode 100644 index 0000000000..e03cba4ccb --- /dev/null +++ b/specification/fleet/post_secret/FleetPostSecretRequest.ts @@ -0,0 +1,38 @@ +/* + * 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' + +/** + * Creates a secret stored by Fleet. + * + * @rest_spec_name fleet.post_secret + * @availability stack stability=experimental visibility=private + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_fleet/secret' + methods: ['POST'] + } + ] + body: { + value: string + } +} diff --git a/specification/fleet/post_secret/FleetPostSecretResponse.ts b/specification/fleet/post_secret/FleetPostSecretResponse.ts new file mode 100644 index 0000000000..c8491cd171 --- /dev/null +++ b/specification/fleet/post_secret/FleetPostSecretResponse.ts @@ -0,0 +1,24 @@ +/* + * 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. + */ + +export class Response { + body: { + id: string + } +}