Skip to content

Commit

Permalink
fix: update open api spec (redhat-developer#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki committed Apr 29, 2021
1 parent a7007ae commit 3d88cee
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 11 deletions.
132 changes: 125 additions & 7 deletions source/openapi/kas-fleet-manager.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -669,6 +728,8 @@ components:
type: string
failed_reason:
type: string
version:
type: string
example:
$ref: "#/components/examples/KafkaRequestExample"
KafkaRequestList:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -845,6 +953,9 @@ components:
items:
allOf:
- $ref: "#/components/schemas/ServiceAccountListItem"
required:
- kind
- items
# user-facing metrics related #
MetricsRangeQueryList:
allOf:
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions source/openapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<packaging>jar</packaging>

<properties>
<swagger-annotations-version>1.5.22</swagger-annotations-version>
<swagger-annotations-version>1.6.2</swagger-annotations-version>
<resteasy-version>3.1.3.Final</resteasy-version>
<jackson-version>2.10.4</jackson-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
Expand Down Expand Up @@ -110,7 +110,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>5.0.0</version>
<version>5.1.0</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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());

Expand Down

0 comments on commit 3d88cee

Please sign in to comment.