diff --git a/source/openapi/kas-fleet-manager.yaml b/source/openapi/kas-fleet-manager.yaml index facfac5e..e3e0f7b4 100644 --- a/source/openapi/kas-fleet-manager.yaml +++ b/source/openapi/kas-fleet-manager.yaml @@ -1,5 +1,5 @@ +openapi: 3.0.0 # need this as first line to allow some IDEs to know this is an openapi document. # 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 -openapi: 3.0.0 info: title: Kafka Service Fleet Manager version: 0.0.1 @@ -14,6 +14,39 @@ servers: - url: / description: current domain paths: + /api/managed-services-api/v1: + get: + operationId: versionMetadata + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VersionMetadata' + description: Version metadata + summary: Retrieves the version metadata + /api/managed-services-api/v1/status: + get: + operationId: serviceStatus + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceStatus' + description: Ok + "500": + description: Unexpected error occurred + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + examples: + 500Example: + $ref: '#/components/examples/500Example' + summary: Retrieves the status of resources e.g whether we have reached maximum service capacity + security: + - Bearer: [] /api/managed-services-api/v1/kafkas/{id}: get: operationId: getKafkaById @@ -515,6 +548,32 @@ paths: sa-reset: $ref: '#/components/examples/ServiceAccountExample' description: reset credentials + '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: + 401Example: + $ref: '#/components/examples/403Example' + description: User not authorized to access the service + '500': + content: + application/json: + schema: {} + examples: + 500Example: + $ref: '#/components/examples/500Example' + description: Unexpected error occurred security: - Bearer: [] operationId: resetServiceAccountCreds @@ -669,6 +728,8 @@ components: type: string failed_reason: type: string + version: + type: string example: $ref: "#/components/examples/KafkaRequestExample" KafkaRequestList: @@ -688,6 +749,40 @@ components: items: allOf: - $ref: "#/components/schemas/KafkaRequest" + VersionMetadata: + allOf: + - $ref: "#/components/schemas/ObjectReference" + - type: object + example: + kind: "APIVersion" + id: "v1" + href: "/api/managed-services-api/v1" + collections: + - id: "kafkas" + href: "/api/managed-services-api/v1/kafkas" + kind: "KafkaList" + properties: + collections: + type: array + items: + allOf: + - $ref: "#/components/schemas/ObjectReference" + ServiceStatus: + description: Schema for the service status response body + example: + kafkas: + max_capacity_reached: true + type: object + properties: + kafkas: + description: The kafka resource api status + type: object + required: + - max_capacity_reached + properties: + max_capacity_reached: + description: Indicates whether we have reached kafka maximum capacity + type: boolean KafkaRequestPayload: description: Schema for the request body sent to /kafkas POST required: @@ -797,6 +892,11 @@ components: type: string clientSecret: type: string + owner: + type: string + created_at: + format: date-time + type: string example: $ref: "#/components/examples/ServiceAccountExample" ServiceAccountRequest: @@ -823,20 +923,28 @@ components: description: 'server generated unique id of the service account' type: string clientID: - description: '' + description: 'client id of the service account' type: string name: - description: '' + description: 'name of the service account' + type: string + owner: + description: 'owner of the service account' + type: string + created_at: + format: date-time + description: 'service account creation timestamp' type: string description: - description: '' + type: string + description: 'description of the service account' ServiceAccountList: allOf: - type: object example: kind: "ServiceAccountList" items: - $ref: '#/components/examples/ServiceAccountListItemExample' + - $ref: '#/components/examples/ServiceAccountListItemExample' properties: kind: type: string @@ -845,6 +953,9 @@ components: items: allOf: - $ref: "#/components/schemas/ServiceAccountListItem" + required: + - kind + - items # user-facing metrics related # MetricsRangeQueryList: allOf: @@ -1078,9 +1189,10 @@ components: region: "us-east-1" owner: "api_kafka_service" name: "serviceapi" - bootstrapServerHost: "serviceapi-1isy6rq3jki8q0otmjqfd3ocfrg.apps.ms-bttg0jn170hp.x5u8.s1.devshift.org" + bootstrapServerHost: "serviceapi-1isy6rq3jki8q0otmjqfd3ocfrg.apps.mk-bttg0jn170hp.x5u8.s1.devshift.org" created_at: "2020-10-05T12:51:24.053142Z" updated_at: "2020-10-05T12:56:36.362208Z" + version: "2.6.0" KafkaRequestFailedCreationStatusExample: value: id: "1iSY6RQ3JKI8Q0OTmjQFd3ocFRg" @@ -1092,7 +1204,7 @@ components: region: "us-east-1" owner: "api_kafka_service" name: "serviceapi" - bootstrapServerHost: "serviceapi-1isy6rq3jki8q0otmjqfd3ocfrg.apps.ms-bttg0jn170hp.x5u8.s1.devshift.org" + bootstrapServerHost: "serviceapi-1isy6rq3jki8q0otmjqfd3ocfrg.apps.mk-bttg0jn170hp.x5u8.s1.devshift.org" created_at: "2020-10-05T12:51:24.053142Z" updated_at: "2020-10-05T12:56:36.362208Z" failed_reason: "a reason the kafka request creation failed" @@ -1122,6 +1234,8 @@ components: description: "service account for my app" clientID: "SA-121212" clientSecret: "secret" + owner: "test-user" + created_at: "2021-04-07T16:24:01+05:30" ServiceAccountByIdExample: value: id: "1" @@ -1130,6 +1244,8 @@ components: name: "my-app-sa" description: "service account for my app" clientID: "SA-121212" + owner: "test-user" + created_at: "2021-04-07T16:24:01+05:30" ServiceAccountListItemExample: value: id: "1" @@ -1138,6 +1254,8 @@ components: name: "my-app-sa" description: "service account for my app" clientID: "SA-121212" + owner: "test-user" + created_at: "2021-04-07T16:24:01+05:30" MetricsRangeQueryExample: value: metric: diff --git a/source/openapi/pom.xml b/source/openapi/pom.xml index cfca605d..be4472c4 100644 --- a/source/openapi/pom.xml +++ b/source/openapi/pom.xml @@ -16,7 +16,7 @@ jar - 1.5.22 + 1.6.2 3.1.3.Final 2.10.4 0.2.1 @@ -110,7 +110,7 @@ org.openapitools openapi-generator-maven-plugin - 5.0.0 + 5.1.0 diff --git a/source/rhoas/src/main/java/com/openshift/cloud/RHOASOperator.java b/source/rhoas/src/main/java/com/openshift/cloud/RHOASOperator.java index 902ca49e..ffcece36 100755 --- a/source/rhoas/src/main/java/com/openshift/cloud/RHOASOperator.java +++ b/source/rhoas/src/main/java/com/openshift/cloud/RHOASOperator.java @@ -10,7 +10,6 @@ import io.quarkus.runtime.QuarkusApplication; import io.quarkus.runtime.annotations.QuarkusMain; import javax.inject.Inject; - import org.eclipse.microprofile.config.inject.ConfigProperty; import org.jboss.logging.Logger; @@ -40,7 +39,7 @@ public static void main(String... args) { @Override public int run(String... args) throws Exception { LOG.info("Using API URL: " + clientBasePath); - + ControllerConfiguration config = configuration.getConfigurationFor(connectionController); LOG.info("CR class: " + config.getCustomResourceClass());