diff --git a/.errors/errors_kafka_mgmt.json b/.errors/errors_kafka_mgmt.json index cccd02fa..44bfb38b 100644 --- a/.errors/errors_kafka_mgmt.json +++ b/.errors/errors_kafka_mgmt.json @@ -292,7 +292,7 @@ "code": "KAFKAS-MGMT-121" }, { - "reason": "Too Many requests", + "reason": "Too many requests", "id": "429", "kind": "Error", "href": "/api/kafkas_mgmt/v1/errors/429", diff --git a/.openapi/smartevents_mgmt_v2.yaml b/.openapi/smartevents_mgmt_v2.yaml new file mode 100644 index 00000000..46495f33 --- /dev/null +++ b/.openapi/smartevents_mgmt_v2.yaml @@ -0,0 +1,886 @@ +--- +openapi: 3.0.3 +info: + title: Red Hat Openshift SmartEvents Fleet Manager V2 + description: The API exposed by the fleet manager of the SmartEvents service. + contact: + name: Development Team + email: openbridge-dev@redhat.com + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0 + version: 0.0.1 +servers: +- url: https://api.stage.openshift.com +- url: http://localhost:8000 +- url: https://api.openshift.com +- url: / +tags: +- name: Bridges + description: "The API that allow the user to retrieve, create or delete Bridge instances." +- name: Cloud Providers + description: List Supported Cloud Providers and Regions +- name: Error Catalog + description: List and get the error definitions from the error catalog. +paths: + /api/smartevents_mgmt/v2/bridges: + get: + tags: + - Bridges + summary: Get the list of Bridge instances + description: Get the list of Bridge instances for the authenticated user. + operationId: BridgesAPI_getBridges + parameters: + - name: name + in: query + schema: + type: string + - name: page + in: query + schema: + format: int32 + default: 0 + minimum: 0 + type: integer + - name: size + in: query + schema: + format: int32 + default: 100 + maximum: 100 + minimum: 1 + type: integer + - name: status + in: query + schema: + uniqueItems: true + type: array + items: + $ref: '#/components/schemas/ManagedResourceStatus' + responses: + "200": + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/BridgeListResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "401": + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "403": + description: Forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "404": + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + security: + - bearer: [] + post: + tags: + - Bridges + summary: Create a Bridge instance + description: Create a Bridge instance for the authenticated user. + operationId: BridgesAPI_createBridge + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BridgeRequest' + responses: + "202": + description: Accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/BridgeResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "401": + description: Unauthorized. + "402": + description: Not enough quota. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "403": + description: Forbidden. + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + security: + - bearer: [] + /api/smartevents_mgmt/v2/bridges/{bridgeId}: + get: + tags: + - Bridges + summary: Get a Bridge instance + description: Get a Bridge instance of the authenticated user by ID. + operationId: BridgesAPI_getBridge + parameters: + - name: bridgeId + in: path + required: true + schema: + minLength: 1 + type: string + nullable: false + responses: + "200": + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/BridgeResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "401": + description: Unauthorized. + "403": + description: Forbidden. + "404": + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + security: + - bearer: [] + put: + tags: + - Bridges + summary: Update a Bridge instance + description: Update a Bridge instance for the authenticated user. + operationId: BridgesAPI_updateBridge + parameters: + - name: bridgeId + in: path + required: true + schema: + minLength: 1 + type: string + nullable: false + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BridgeRequest' + responses: + "202": + description: Accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/BridgeResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "401": + description: Unauthorized. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "403": + description: Forbidden. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "404": + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + security: + - bearer: [] + delete: + tags: + - Bridges + summary: Delete a Bridge instance + description: Delete a Bridge instance of the authenticated user by ID. + operationId: BridgesAPI_deleteBridge + parameters: + - name: bridgeId + in: path + required: true + schema: + type: string + responses: + "202": + description: Accepted. + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "401": + description: Unauthorized. + "403": + description: Forbidden. + "404": + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + security: + - bearer: [] + /api/smartevents_mgmt/v2/cloud_providers: + get: + tags: + - Cloud Providers + summary: List Supported Cloud Providers. + description: Returns the list of supported Cloud Providers. + operationId: CloudProviderAPI_listCloudProviders + parameters: + - name: page + in: query + schema: + format: int32 + default: 0 + minimum: 0 + type: integer + - name: size + in: query + schema: + format: int32 + default: 100 + maximum: 100 + minimum: 1 + type: integer + responses: + "200": + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/CloudProviderListResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + /api/smartevents_mgmt/v2/cloud_providers/{id}: + get: + tags: + - Cloud Providers + summary: Get Cloud Provider. + description: Get details of the Cloud Provider specified by id. + operationId: CloudProviderAPI_getCloudProvider + parameters: + - name: id + in: path + required: true + schema: + minLength: 1 + type: string + nullable: false + responses: + "200": + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/CloudProviderListResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "404": + description: Not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + /api/smartevents_mgmt/v2/cloud_providers/{id}/regions: + get: + tags: + - Cloud Providers + summary: List Supported Cloud Regions. + description: Returns the list of supported Regions of the specified Cloud Provider. + operationId: CloudProviderAPI_listCloudProviderRegions + parameters: + - name: id + in: path + required: true + schema: + minLength: 1 + type: string + nullable: false + - name: page + in: query + schema: + format: int32 + default: 0 + minimum: 0 + type: integer + - name: size + in: query + schema: + format: int32 + default: 100 + maximum: 100 + minimum: 1 + type: integer + responses: + "200": + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/CloudRegionListResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + /api/smartevents_mgmt/v2/errors: + get: + tags: + - Error Catalog + summary: Get the list of errors. + description: Get the list of errors from the error catalog. + operationId: ErrorsAPI_getErrors + parameters: + - name: page + in: query + schema: + format: int32 + default: 0 + minimum: 0 + type: integer + - name: size + in: query + schema: + format: int32 + default: 100 + maximum: 100 + minimum: 1 + type: integer + responses: + "200": + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorListResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "401": + description: Unauthorized. + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + /api/smartevents_mgmt/v2/errors/{id}: + get: + tags: + - Error Catalog + summary: Get an error from the error catalog. + description: Get an error from the error catalog. + operationId: ErrorsAPI_getError + parameters: + - name: id + in: path + required: true + schema: + format: int32 + type: integer + responses: + "200": + description: Success. + content: + application/json: + schema: + $ref: '#/components/schemas/BridgeError' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' + "401": + description: Unauthorized. + "500": + description: Internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorsList' +components: + schemas: + BridgeError: + type: object + properties: + id: + format: int32 + type: integer + code: + type: string + reason: + type: string + type: + $ref: '#/components/schemas/BridgeErrorType' + BridgeErrorInstance: + type: object + properties: + id: + format: int32 + type: integer + code: + type: string + reason: + type: string + type: + $ref: '#/components/schemas/BridgeErrorType' + uuid: + type: string + BridgeErrorType: + enum: + - USER + - PLATFORM + type: string + BridgeListResponse: + required: + - kind + - page + - size + - total + type: object + properties: + kind: + type: string + nullable: false + items: + type: array + items: + $ref: '#/components/schemas/BridgeResponse' + page: + format: int64 + type: integer + nullable: false + size: + format: int64 + type: integer + nullable: false + total: + format: int64 + type: integer + nullable: false + BridgeRequest: + required: + - name + - cloud_provider + - region + type: object + properties: + name: + minLength: 1 + type: string + nullable: false + cloud_provider: + minLength: 1 + type: string + nullable: false + region: + minLength: 1 + type: string + nullable: false + BridgeResponse: + required: + - kind + - id + - href + - submitted_at + - status + - owner + type: object + properties: + kind: + type: string + nullable: false + id: + type: string + nullable: false + name: + type: string + href: + type: string + nullable: false + submitted_at: + format: date-time + type: string + nullable: false + published_at: + format: date-time + type: string + modified_at: + format: date-time + type: string + status: + allOf: + - $ref: '#/components/schemas/ManagedResourceStatus' + - nullable: false + owner: + type: string + nullable: false + endpoint: + type: string + cloud_provider: + type: string + region: + type: string + status_message: + type: string + CloudProviderListResponse: + required: + - kind + - page + - size + - total + type: object + properties: + kind: + type: string + nullable: false + items: + type: array + items: + $ref: '#/components/schemas/CloudProviderResponse' + page: + format: int64 + type: integer + nullable: false + size: + format: int64 + type: integer + nullable: false + total: + format: int64 + type: integer + nullable: false + CloudProviderResponse: + required: + - kind + - id + - href + - display_name + - enabled + type: object + properties: + kind: + type: string + nullable: false + id: + type: string + nullable: false + name: + type: string + href: + type: string + nullable: false + display_name: + type: string + nullable: false + enabled: + type: boolean + nullable: false + CloudRegionListResponse: + required: + - kind + - page + - size + - total + type: object + properties: + kind: + type: string + nullable: false + items: + type: array + items: + $ref: '#/components/schemas/CloudRegionResponse' + page: + format: int64 + type: integer + nullable: false + size: + format: int64 + type: integer + nullable: false + total: + format: int64 + type: integer + nullable: false + CloudRegionResponse: + required: + - kind + - name + - display_name + - enabled + type: object + properties: + kind: + type: string + nullable: false + name: + type: string + nullable: false + display_name: + type: string + nullable: false + enabled: + type: boolean + nullable: false + Error: + required: + - kind + - reason + - id + - href + type: object + properties: + kind: + type: string + nullable: false + name: + type: string + code: + type: string + reason: + type: string + nullable: false + id: + type: string + nullable: false + href: + type: string + nullable: false + ErrorListResponse: + required: + - kind + - page + - size + - total + type: object + properties: + kind: + type: string + nullable: false + items: + type: array + items: + $ref: '#/components/schemas/Error' + page: + format: int64 + type: integer + nullable: false + size: + format: int64 + type: integer + nullable: false + total: + format: int64 + type: integer + nullable: false + ErrorsList: + required: + - kind + type: object + properties: + kind: + type: string + nullable: false + items: + type: array + items: + $ref: '#/components/schemas/Error' + List: + allOf: + - $ref: '#/components/schemas/ListResponse' + - required: + - page + - size + - total + type: object + properties: + page: + format: int64 + type: integer + nullable: false + size: + format: int64 + type: integer + nullable: false + total: + format: int64 + type: integer + nullable: false + ListResponse: + required: + - kind + type: object + properties: + kind: + type: string + nullable: false + items: + type: array + items: + type: object + ManagedResourceStatus: + enum: + - accepted + - preparing + - provisioning + - ready + - deprovision + - deleting + - deleted + - failed + type: string + ObjectReference: + required: + - kind + - id + - href + type: object + properties: + kind: + type: string + nullable: false + id: + type: string + nullable: false + name: + type: string + href: + type: string + nullable: false + ProcessingErrorListResponse: + required: + - kind + - page + - size + - total + type: object + properties: + kind: + type: string + nullable: false + items: + type: array + items: + $ref: '#/components/schemas/ProcessingErrorResponse' + page: + format: int64 + type: integer + nullable: false + size: + format: int64 + type: integer + nullable: false + total: + format: int64 + type: integer + nullable: false + ProcessingErrorResponse: + type: object + properties: + recorded_at: + format: date-time + type: string + headers: + type: object + additionalProperties: + type: string + payload: + type: object + securitySchemes: + bearer: + type: http + scheme: Bearer diff --git a/packages/kafka-management-sdk/src/errors.ts b/packages/kafka-management-sdk/src/errors.ts index 54eda0ec..fff352a6 100644 --- a/packages/kafka-management-sdk/src/errors.ts +++ b/packages/kafka-management-sdk/src/errors.ts @@ -136,7 +136,7 @@ export const APIErrorCodes = { /** Failed to check quota*/ ERROR_121 : "KAFKAS-MGMT-121", - /** Too Many requests*/ + /** Too many requests*/ ERROR_429 : "KAFKAS-MGMT-429", /** An unexpected error happened, please check the log of the service for details*/