From 9dea649de3abfd8f18d651ea0c495704d0eb7d64 Mon Sep 17 00:00:00 2001 From: Luca Burgazzoli Date: Tue, 6 Dec 2022 22:36:12 +0100 Subject: [PATCH] MGDCTRS-1752: Update openapi definitions The OpenAPI definition is amended and the annotation schmea replaced by a plain object definition because of a bug in the openapi generator: https://github.com/OpenAPITools/openapi-generator/issues/7066 --- .../openapi/specs/connector_mgmt-private.yaml | 4 ++ .../src/openapi/specs/connector_mgmt.yaml | 27 +++++++-- .../src/openapi/specs/kas-fleet-manager.yaml | 55 ++++++++++++++++++- 3 files changed, 78 insertions(+), 8 deletions(-) diff --git a/cos-fleet-manager-api/src/openapi/specs/connector_mgmt-private.yaml b/cos-fleet-manager-api/src/openapi/specs/connector_mgmt-private.yaml index 8eee561f..1f7461da 100644 --- a/cos-fleet-manager-api/src/openapi/specs/connector_mgmt-private.yaml +++ b/cos-fleet-manager-api/src/openapi/specs/connector_mgmt-private.yaml @@ -462,6 +462,10 @@ components: format: int64 resolved_secrets: type: boolean + annotations: + type: object + additionalProperties: + type: "string" spec: $ref: '#/components/schemas/ConnectorDeploymentSpec' status: diff --git a/cos-fleet-manager-api/src/openapi/specs/connector_mgmt.yaml b/cos-fleet-manager-api/src/openapi/specs/connector_mgmt.yaml index c6b3a4af..b6ad3a23 100644 --- a/cos-fleet-manager-api/src/openapi/specs/connector_mgmt.yaml +++ b/cos-fleet-manager-api/src/openapi/specs/connector_mgmt.yaml @@ -8,7 +8,7 @@ info: license: name: 'Apache 2.0' url: 'https://www.apache.org/licenses/LICENSE-2.0' - contact: + contact: name: 'Red Hat OpenShift Streams for Apache Kafka Support' email: 'rhosak-support@redhat.com' servers: @@ -1168,9 +1168,14 @@ components: - deleting ConnectorClusterRequestMeta: + type: object properties: name: type: string + annotations: + type: object + additionalProperties: + type: "string" ConnectorClusterRequest: description: "Schema for the request to update a data plane cluster's name" @@ -1259,6 +1264,7 @@ components: type: object ConnectorRequestMeta: + type: object required: - name - connector_type_id @@ -1275,6 +1281,11 @@ components: $ref: "#/components/schemas/Channel" desired_state: $ref: "#/components/schemas/ConnectorDesiredState" + annotations: + type: object + additionalProperties: + type: "string" + ConnectorRequest: allOf: @@ -1353,12 +1364,16 @@ components: type: array items: type: string + annotations: + type: object + additionalProperties: + type: "string" featured_rank: description: Ranking for featured connectors type: integer format: int32 capabilities: - description: The capabilities supported by the conenctor + description: The capabilities supported by the connector type: array items: type: string @@ -1625,7 +1640,7 @@ components: * Cluster: id, created_at, updated_at, owner, organisation_id, name, state, client_id * Namespace: id, created_at, updated_at, name, cluster_id, owner, expiration, tenant_user_id, tenant_organisation_id, state - * Connector Types: id, created_at, updated_at, version, name, description, label, channel, featured_rank + * Connector Types: id, created_at, updated_at, version, name, description, label, channel, featured_rank, pricing_tier * Connectors: id, created_at, updated_at, name, owner, organisation_id, connector_type_id, desired_state, state, channel, namespace_id, kafka_id, kafka_bootstrap_server, service_account_client_id, schema_registry_id, schema_registry_url Allowed operators are `<>`, `=`, `LIKE`, or `ILIKE`. @@ -1689,6 +1704,8 @@ components: icon_href: "/api/connector_mgmt/v1/kafka_connector_types/log_sink.png" labels: - sink + annotations: + - "cos.bf2.org/name": value capabilities: - data_shape - processors @@ -1814,12 +1831,12 @@ components: name: "MyNamespace" cluster_id: "9bsv0s7tne7g02gh5g4g" annotations: - "connector_mgmt.bf2.org/profile": "default-profile" + "cos.bf2.org/profile": "default-profile" ConnectorNamespaceEvalCreateExample: value: name: "MyEvalNamespace" annotations: - "connector_mgmt.bf2.org/profile": "evaluation-profile" + "cos.bf2.org/profile": "evaluation-profile" 400CreationExample: value: id: "103" diff --git a/cos-fleet-manager-api/src/openapi/specs/kas-fleet-manager.yaml b/cos-fleet-manager-api/src/openapi/specs/kas-fleet-manager.yaml index 4f9d941a..5bd09d5c 100644 --- a/cos-fleet-manager-api/src/openapi/specs/kas-fleet-manager.yaml +++ b/cos-fleet-manager-api/src/openapi/specs/kas-fleet-manager.yaml @@ -2,7 +2,7 @@ openapi: 3.0.0 # need this as first line to allow some IDEs to know this is an o # All endpoints defined here will be discoverable by all users. If there is a need to keep some endpoints "private", add them to the "managed-services-api-private.yaml" file info: title: Kafka Management API - version: 1.11.0 + version: 1.14.0 description: Kafka Management API is a REST API to manage Kafka instances license: name: 'Apache 2.0' @@ -936,16 +936,22 @@ components: properties: reason: type: string + description: "Human-readable description of the error. Intended for human consumption" operation_id: type: string + description: "Relatively unique operation ID of the request associated to the error" id: type: string + description: "The unique and immutable identifier of the resource" kind: type: string + description: "The kind of the resource" href: type: string + description: "The absolute path of the resource" code: type: string + description: "Code of the error" ErrorList: allOf: - $ref: "#/components/schemas/List" @@ -1141,12 +1147,48 @@ components: display_name: description: 'Human readable name of the supported Kafka instance type' type: string + supported_billing_models: + description: "A list of available kafka billing models for the instance type. Each kafka billing model item has a unique 'id'" + type: array + minItems: 1 + items: + $ref: '#/components/schemas/SupportedKafkaBillingModel' sizes: - description: ' A list of Kafka instance sizes available for this instance type' + description: 'A list of Kafka instance sizes available for this instance type' type: array items: allOf: - $ref: '#/components/schemas/SupportedKafkaSize' + required: + - supported_billing_models + SupportedKafkaBillingModel: + description: 'Supported Kafka Billing Model' + type: object + properties: + id: + description: 'Identifier for the Kafka billing model' + type: string + minLength: 1 + ams_resource: + description: "AMS resource to be used. Accepted values: ['rhosak']" + type: string + minLength: 1 + ams_product: + description: "AMS product to be used. Accepted values: ['RHOSAK', 'RHOSAKTrial', 'RHOSAKEval']" + type: string + minLength: 1 + ams_billing_models: + description: "List of AMS available billing models: Accepted values: ['marketplace', 'marketplace-rhm', 'marketplace-aws']" + type: array + minItems: 1 + items: + type: string + minLength: 1 + required: + - id + - ams_resource + - ams_product + - ams_billing_models SupportedKafkaSize: description: 'Supported Kafka Size' type: object @@ -1204,8 +1246,9 @@ components: description: 'Quota consumed by this Kafka instance size.' type: integer quota_type: - description: 'Quota type used by this Kafka instance size.' + description: 'Quota type used by this Kafka instance size. This is now deprecated, please refer to supported_billing_models at instance-type level instead.' type: string + deprecated: true capacity_consumed: description: 'Data plane cluster capacity consumed by this Kafka instance size.' type: integer @@ -1738,6 +1781,12 @@ components: value: id: developer display_name: Trial + supported_billing_models: + - id: trial + ams_resource: rhosak + ams_product: RHOSAKTrial + ams_billing_models: + - standard sizes: [ {