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/README.md b/packages/kafka-management-sdk/README.md index 04fa7777..dbd36214 100644 --- a/packages/kafka-management-sdk/README.md +++ b/packages/kafka-management-sdk/README.md @@ -130,6 +130,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**getMetricsByRangeQuery**](docs/DefaultApi.md#getMetricsByRangeQuery) | **GET** /api/kafkas_mgmt/v1/kafkas/{id}/metrics/query_range | *DefaultApi* | [**getVersionMetadata**](docs/DefaultApi.md#getVersionMetadata) | **GET** /api/kafkas_mgmt/v1 | *DefaultApi* | [**updateKafkaById**](docs/DefaultApi.md#updateKafkaById) | **PATCH** /api/kafkas_mgmt/v1/kafkas/{id} | +*EnterpriseDataplaneClustersApi* | [**deleteEnterpriseClusterById**](docs/EnterpriseDataplaneClustersApi.md#deleteEnterpriseClusterById) | **DELETE** /api/kafkas_mgmt/v1/clusters/{id} | *EnterpriseDataplaneClustersApi* | [**getEnterpriseOsdClusters**](docs/EnterpriseDataplaneClustersApi.md#getEnterpriseOsdClusters) | **GET** /api/kafkas_mgmt/v1/clusters | *EnterpriseDataplaneClustersApi* | [**registerEnterpriseOsdCluster**](docs/EnterpriseDataplaneClustersApi.md#registerEnterpriseOsdCluster) | **POST** /api/kafkas_mgmt/v1/clusters | *ErrorsApi* | [**getErrorById**](docs/ErrorsApi.md#getErrorById) | **GET** /api/kafkas_mgmt/v1/errors/{id} | diff --git a/packages/kafka-management-sdk/api/openapi.yaml b/packages/kafka-management-sdk/api/openapi.yaml index 5a0a0672..dc8c1716 100644 --- a/packages/kafka-management-sdk/api/openapi.yaml +++ b/packages/kafka-management-sdk/api/openapi.yaml @@ -1279,8 +1279,8 @@ paths: examples: "400InvalidClusterIdExample": $ref: '#/components/examples/400InvalidClusterIdExample' - "400MInvalidExternalClusterIdExample": - $ref: '#/components/examples/400MInvalidExternalClusterIdExample' + "400InvalidExternalClusterIdExample": + $ref: '#/components/examples/400InvalidExternalClusterIdExample' schema: $ref: '#/components/schemas/Error' description: Validation errors occurred @@ -1326,6 +1326,93 @@ paths: - enterprise-dataplane-clusters x-contentType: application/json x-accepts: application/json + /api/kafkas_mgmt/v1/clusters/{id}: + delete: + operationId: deleteEnterpriseClusterById + parameters: + - description: Perform the action in an asynchronous manner + explode: true + in: query + name: async + required: true + schema: + type: boolean + style: form + - 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. + explode: true + in: query + name: force + required: false + schema: + type: boolean + style: form + - description: ID of the enterprise data plane cluster + explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "202": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Enterprise cluster deletion accepted + "400": + content: + application/json: + examples: + "400DeletionExample": + $ref: '#/components/examples/400DeletionExample' + schema: + $ref: '#/components/schemas/Error' + description: Validation errors occurred + "401": + content: + application/json: + examples: + "401Example": + $ref: '#/components/examples/401Example' + schema: + $ref: '#/components/schemas/Error' + description: Auth token is invalid + "403": + content: + application/json: + examples: + "403Example": + $ref: '#/components/examples/403Example' + schema: + $ref: '#/components/schemas/Error' + description: User not authorized to access the service + "404": + content: + application/json: + examples: + "404DeleteExample": + $ref: '#/components/examples/404DeleteExample' + schema: + $ref: '#/components/schemas/Error' + description: No Enterprise cluster with specified ID exists + "500": + content: + application/json: + examples: + "500DeleteExample": + $ref: '#/components/examples/500DeleteExample' + schema: + $ref: '#/components/schemas/Error' + description: Unexpected error occurred + security: + - Bearer: [] + tags: + - enterprise-dataplane-clusters + x-accepts: application/json components: examples: USRegionExample: @@ -1577,7 +1664,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/docs/EnterpriseDataplaneClustersApi.md b/packages/kafka-management-sdk/docs/EnterpriseDataplaneClustersApi.md index a25c3f6c..380ecf07 100644 --- a/packages/kafka-management-sdk/docs/EnterpriseDataplaneClustersApi.md +++ b/packages/kafka-management-sdk/docs/EnterpriseDataplaneClustersApi.md @@ -4,11 +4,90 @@ All URIs are relative to *https://api.openshift.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**deleteEnterpriseClusterById**](EnterpriseDataplaneClustersApi.md#deleteEnterpriseClusterById) | **DELETE** /api/kafkas_mgmt/v1/clusters/{id} | [**getEnterpriseOsdClusters**](EnterpriseDataplaneClustersApi.md#getEnterpriseOsdClusters) | **GET** /api/kafkas_mgmt/v1/clusters | [**registerEnterpriseOsdCluster**](EnterpriseDataplaneClustersApi.md#registerEnterpriseOsdCluster) | **POST** /api/kafkas_mgmt/v1/clusters | +## deleteEnterpriseClusterById + +> Error deleteEnterpriseClusterById(async, id, force) + + + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.kas.invoker.ApiClient; +import com.openshift.cloud.api.kas.invoker.ApiException; +import com.openshift.cloud.api.kas.invoker.Configuration; +import com.openshift.cloud.api.kas.invoker.auth.*; +import com.openshift.cloud.api.kas.invoker.models.*; +import com.openshift.cloud.api.kas.EnterpriseDataplaneClustersApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + EnterpriseDataplaneClustersApi apiInstance = new EnterpriseDataplaneClustersApi(defaultClient); + Boolean async = true; // Boolean | Perform the action in an asynchronous manner + String id = "id_example"; // String | ID of the enterprise data plane cluster + Boolean force = true; // Boolean | 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. + try { + Error result = apiInstance.deleteEnterpriseClusterById(async, id, force); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EnterpriseDataplaneClustersApi#deleteEnterpriseClusterById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **async** | **Boolean**| Perform the action in an asynchronous manner | + **id** | **String**| ID of the enterprise data plane cluster | + **force** | **Boolean**| 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. | [optional] + +### Return type + +[**Error**](Error.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Enterprise cluster deletion accepted | - | +| **400** | Validation errors occurred | - | +| **401** | Auth token is invalid | - | +| **403** | User not authorized to access the service | - | +| **404** | No Enterprise cluster with specified ID exists | - | +| **500** | Unexpected error occurred | - | + + ## getEnterpriseOsdClusters > EnterpriseClusterList getEnterpriseOsdClusters() diff --git a/packages/kafka-management-sdk/src/main/java/com/openshift/cloud/api/kas/EnterpriseDataplaneClustersApi.java b/packages/kafka-management-sdk/src/main/java/com/openshift/cloud/api/kas/EnterpriseDataplaneClustersApi.java index f79b2763..b35f7162 100644 --- a/packages/kafka-management-sdk/src/main/java/com/openshift/cloud/api/kas/EnterpriseDataplaneClustersApi.java +++ b/packages/kafka-management-sdk/src/main/java/com/openshift/cloud/api/kas/EnterpriseDataplaneClustersApi.java @@ -37,6 +37,59 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** + * + * + * @param async Perform the action in an asynchronous manner (required) + * @param id ID of the enterprise data plane cluster (required) + * @param 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. (optional) + * @return a {@code Error} + * @throws ApiException if fails to make API call + */ + public Error deleteEnterpriseClusterById(Boolean async, String id, Boolean force) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'async' is set + if (async == null) { + throw new ApiException(400, "Missing the required parameter 'async' when calling deleteEnterpriseClusterById"); + } + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException(400, "Missing the required parameter 'id' when calling deleteEnterpriseClusterById"); + } + + // create path and map variables + String localVarPath = "/api/kafkas_mgmt/v1/clusters/{id}".replaceAll("\\{format\\}","json") + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "async", async)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "force", force)); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "Bearer" }; + + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + } /** * * List all Enterprise OSD clusters