From 4e66fd205887c6c454734ba298d416e196ce5233 Mon Sep 17 00:00:00 2001 From: Debashisa Mohanty Date: Wed, 12 Apr 2023 09:53:38 -0400 Subject: [PATCH 1/3] added open api inject to include replay end point --- .../main/resources/config/openapi-inject.yml | 97 ++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/openapi-meta/src/main/resources/config/openapi-inject.yml b/openapi-meta/src/main/resources/config/openapi-inject.yml index 26b9f2e3..472b133d 100644 --- a/openapi-meta/src/main/resources/config/openapi-inject.yml +++ b/openapi-meta/src/main/resources/config/openapi-inject.yml @@ -3,6 +3,46 @@ info: version: 1.0.0 title: Light-4j OpenAPI Admin paths: + '/adm/messagereplaymetadata': + post: + tags: + - "kafka-sidecar" + operationId: TopicReplayMetadataPost + summary: Post message for replay the message from topic + description: Post message for replay the message from topic + requestBody: + description: "Topic message replay metadata object" + required: true + content: + application/json: + schema: + "$ref": "#/components/schemas/TopicReplayMetadata" + parameters: + - $ref: '#/components/parameters/x-traceability-id' + responses: + '200': + description: Successful response + content: + application/json: + schema: + "$ref": "#/components/schemas/ProduceResponse" + '400': + description: Bad Request + content: + application/json: + schema: + "$ref": "#/components/schemas/Status" + '500': + description: Internal Server Error + content: + application/json: + schema: + "$ref": "#/components/schemas/Status" + security: + - admin-scope: + - admin + # for each business to access their own admin endpoints + - ${server.serviceId:com.networknt.placeholder-1.0.0}/admin /adm/health/${server.serviceId:com.networknt.placeholder-1.0.0}: parameters: - name: server.serviceId:com.networknt.placeholder-1.0.0 @@ -229,4 +269,59 @@ components: clientCredentials: tokenUrl: 'https://localhost:6882/token' scopes: - admin: admin scope to access admin endpoints + "admin": "Grant admin access to light4j components' admin endpoint for this API, api platform team " + "${server.serviceId}/admin": "Grant admin access to light4j components' admin endpoints for this API , API owner" + parameters: + x-traceability-id: + name: x-traceability-id + description: "Common header parameters for centeralized logging" + in: header + required: true + schema: + $ref: 'https://api.swaggerhub.com/domains/Sun-Life-Financial/EnterpriseCommonComponents/1.4.5#/components/schemas/x-traceability-id' + schemas: + TopicReplayMetadata: + type: object + properties: + topicName: + type: string + dlqIndicator: + type: string + partition: + type: number + startOffset: + type: number + endOffset: + type: number + consumerGroup: + type: string + timeout: + type: number + streamingApp: + type: boolean + destinationTopic: + type: string + lastRetry: + type: boolean + ProduceResponse: + type: object + properties: + keySchemaId: + type: integer + valueSchemaId: + type: integer + offsets: + type: array + items: + "$ref": "#/components/schemas/PartitionOffset" + PartitionOffset: + type: object + properties: + topic: + type: string + partition: + type: integer + offset: + type: number + metadata: + type: string \ No newline at end of file From fe5670086674dd58206277c081b514edabcbf6ee Mon Sep 17 00:00:00 2001 From: Debashisa Mohanty Date: Wed, 12 Apr 2023 10:46:06 -0400 Subject: [PATCH 2/3] modified header type to string --- openapi-meta/src/main/resources/config/openapi-inject.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi-meta/src/main/resources/config/openapi-inject.yml b/openapi-meta/src/main/resources/config/openapi-inject.yml index 472b133d..e3412af5 100644 --- a/openapi-meta/src/main/resources/config/openapi-inject.yml +++ b/openapi-meta/src/main/resources/config/openapi-inject.yml @@ -278,7 +278,7 @@ components: in: header required: true schema: - $ref: 'https://api.swaggerhub.com/domains/Sun-Life-Financial/EnterpriseCommonComponents/1.4.5#/components/schemas/x-traceability-id' + type: string schemas: TopicReplayMetadata: type: object From a3afff623c868150d3aefa97932a26b619a05e9a Mon Sep 17 00:00:00 2001 From: Debashisa Mohanty Date: Wed, 12 Apr 2023 10:58:26 -0400 Subject: [PATCH 3/3] modified scope to include placeholder --- openapi-meta/src/main/resources/config/openapi-inject.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi-meta/src/main/resources/config/openapi-inject.yml b/openapi-meta/src/main/resources/config/openapi-inject.yml index e3412af5..5869ae9d 100644 --- a/openapi-meta/src/main/resources/config/openapi-inject.yml +++ b/openapi-meta/src/main/resources/config/openapi-inject.yml @@ -270,7 +270,7 @@ components: tokenUrl: 'https://localhost:6882/token' scopes: "admin": "Grant admin access to light4j components' admin endpoint for this API, api platform team " - "${server.serviceId}/admin": "Grant admin access to light4j components' admin endpoints for this API , API owner" + "${server.serviceId:com.networknt.placeholder-1.0.0}/admin": "Grant admin access to light4j components' admin endpoints for this API , API owner" parameters: x-traceability-id: name: x-traceability-id