From ab0ae684892d3ea3fef80163670f43a648476573 Mon Sep 17 00:00:00 2001 From: Red Hat Application Services CI <84090353+app-services-ci@users.noreply.github.com> Date: Mon, 9 Jan 2023 16:38:43 +0000 Subject: [PATCH] fix(kafka-mgmt/v1): update for kafka-mgmt/v1 SDK (#612) Co-authored-by: app-services-ci --- .openapi/kas-fleet-manager.yaml | 88 ++++++++++++++++- .../api/enterprise-dataplane-clusters-api.ts | 96 +++++++++++++++++++ 2 files changed, 180 insertions(+), 4 deletions(-) diff --git a/.openapi/kas-fleet-manager.yaml b/.openapi/kas-fleet-manager.yaml index f198c585..298619f7 100644 --- a/.openapi/kas-fleet-manager.yaml +++ b/.openapi/kas-fleet-manager.yaml @@ -977,8 +977,8 @@ paths: examples: 400InvalidClusterIdExample: $ref: '#/components/examples/400InvalidClusterIdExample' - 400MInvalidExternalClusterIdExample: - $ref: '#/components/examples/400MInvalidExternalClusterIdExample' + 400InvalidExternalClusterIdExample: + $ref: '#/components/examples/400InvalidExternalClusterIdExample' description: Validation errors occurred "401": content: @@ -1019,7 +1019,87 @@ paths: security: - Bearer: [ ] tags: - - enterprise-dataplane-clusters + - enterprise-dataplane-clusters + /api/kafkas_mgmt/v1/clusters/{id}: + delete: + tags: + - enterprise-dataplane-clusters + operationId: deleteEnterpriseClusterById + parameters: + - in: query + name: async + description: Perform the action in an asynchronous manner + schema: + type: boolean + required: true + - in: query + name: force + description: |- + When provided with value: true - enterprise cluster will be deleted alongside all kafkas present on the cluster. + When skipped and enterprise cluster has any kafkas associated with it, the request will fail. + schema: + type: boolean + required: false + - in: path + name: id + description: ID of the enterprise data plane cluster + schema: + type: string + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Enterprise cluster deletion accepted + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + 400DeletionExample: + $ref: '#/components/examples/400DeletionExample' + description: Validation errors occurred + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + 401Example: + $ref: '#/components/examples/401Example' + description: Auth token is invalid + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + 403Example: + $ref: '#/components/examples/403Example' + description: User not authorized to access the service + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + 404DeleteExample: + $ref: '#/components/examples/404DeleteExample' + description: No Enterprise cluster with specified ID exists + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + 500DeleteExample: + $ref: '#/components/examples/500DeleteExample' + description: Unexpected error occurred + security: + - Bearer: [ ] components: schemas: @@ -2166,7 +2246,7 @@ components: code: "KAFKAS-MGMT-45" reason: "Enterprise cluster ID is invalid" operation_id: "1lWDGuybIrEnxrAem724gqkkiDv" - 400MInvalidExternalClusterIdExample: + 400InvalidExternalClusterIdExample: value: id: "46" kind: "Error" diff --git a/packages/kafka-management-sdk/src/generated/api/enterprise-dataplane-clusters-api.ts b/packages/kafka-management-sdk/src/generated/api/enterprise-dataplane-clusters-api.ts index a885c734..0b1d9bb9 100644 --- a/packages/kafka-management-sdk/src/generated/api/enterprise-dataplane-clusters-api.ts +++ b/packages/kafka-management-sdk/src/generated/api/enterprise-dataplane-clusters-api.ts @@ -32,6 +32,55 @@ import { EnterpriseOsdClusterPayload } from '../model'; */ export const EnterpriseDataplaneClustersApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * + * @param {boolean} async Perform the action in an asynchronous manner + * @param {string} id ID of the enterprise data plane cluster + * @param {boolean} [force] When provided with value: true - enterprise cluster will be deleted alongside all kafkas present on the cluster. When skipped and enterprise cluster has any kafkas associated with it, the request will fail. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteEnterpriseClusterById: async (async: boolean, id: string, force?: boolean, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'async' is not null or undefined + assertParamExists('deleteEnterpriseClusterById', 'async', async) + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteEnterpriseClusterById', 'id', id) + const localVarPath = `/api/kafkas_mgmt/v1/clusters/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (async !== undefined) { + localVarQueryParameter['async'] = async; + } + + if (force !== undefined) { + localVarQueryParameter['force'] = force; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * List all Enterprise OSD clusters * @param {*} [options] Override http request option. @@ -114,6 +163,18 @@ export const EnterpriseDataplaneClustersApiAxiosParamCreator = function (configu export const EnterpriseDataplaneClustersApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = EnterpriseDataplaneClustersApiAxiosParamCreator(configuration) return { + /** + * + * @param {boolean} async Perform the action in an asynchronous manner + * @param {string} id ID of the enterprise data plane cluster + * @param {boolean} [force] When provided with value: true - enterprise cluster will be deleted alongside all kafkas present on the cluster. When skipped and enterprise cluster has any kafkas associated with it, the request will fail. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteEnterpriseClusterById(async: boolean, id: string, force?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteEnterpriseClusterById(async, id, force, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * List all Enterprise OSD clusters * @param {*} [options] Override http request option. @@ -143,6 +204,17 @@ export const EnterpriseDataplaneClustersApiFp = function(configuration?: Configu export const EnterpriseDataplaneClustersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = EnterpriseDataplaneClustersApiFp(configuration) return { + /** + * + * @param {boolean} async Perform the action in an asynchronous manner + * @param {string} id ID of the enterprise data plane cluster + * @param {boolean} [force] When provided with value: true - enterprise cluster will be deleted alongside all kafkas present on the cluster. When skipped and enterprise cluster has any kafkas associated with it, the request will fail. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteEnterpriseClusterById(async: boolean, id: string, force?: boolean, options?: any): AxiosPromise { + return localVarFp.deleteEnterpriseClusterById(async, id, force, options).then((request) => request(axios, basePath)); + }, /** * List all Enterprise OSD clusters * @param {*} [options] Override http request option. @@ -169,6 +241,17 @@ export const EnterpriseDataplaneClustersApiFactory = function (configuration?: C * @interface EnterpriseDataplaneClustersApi */ export interface EnterpriseDataplaneClustersApiInterface { + /** + * + * @param {boolean} async Perform the action in an asynchronous manner + * @param {string} id ID of the enterprise data plane cluster + * @param {boolean} [force] When provided with value: true - enterprise cluster will be deleted alongside all kafkas present on the cluster. When skipped and enterprise cluster has any kafkas associated with it, the request will fail. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterpriseDataplaneClustersApiInterface + */ + deleteEnterpriseClusterById(async: boolean, id: string, force?: boolean, options?: AxiosRequestConfig): AxiosPromise; + /** * List all Enterprise OSD clusters * @param {*} [options] Override http request option. @@ -195,6 +278,19 @@ export interface EnterpriseDataplaneClustersApiInterface { * @extends {BaseAPI} */ export class EnterpriseDataplaneClustersApi extends BaseAPI implements EnterpriseDataplaneClustersApiInterface { + /** + * + * @param {boolean} async Perform the action in an asynchronous manner + * @param {string} id ID of the enterprise data plane cluster + * @param {boolean} [force] When provided with value: true - enterprise cluster will be deleted alongside all kafkas present on the cluster. When skipped and enterprise cluster has any kafkas associated with it, the request will fail. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterpriseDataplaneClustersApi + */ + public deleteEnterpriseClusterById(async: boolean, id: string, force?: boolean, options?: AxiosRequestConfig) { + return EnterpriseDataplaneClustersApiFp(this.configuration).deleteEnterpriseClusterById(async, id, force, options).then((request) => request(this.axios, this.basePath)); + } + /** * List all Enterprise OSD clusters * @param {*} [options] Override http request option.