From 3f9f71e36aa9c1ee5f97d115afec06054766a303 Mon Sep 17 00:00:00 2001 From: rchxx <=> Date: Mon, 14 Oct 2024 14:30:10 +0300 Subject: [PATCH 1/4] Add /healthz and /readyz endpoints --- index.yml | 8 +++--- p-healthcheck.yml | 62 +++++++++++++++++++++++++++++++++++++++++++++++ p-ping.yml | 43 -------------------------------- 3 files changed, 67 insertions(+), 46 deletions(-) create mode 100644 p-healthcheck.yml delete mode 100644 p-ping.yml diff --git a/index.yml b/index.yml index 53a4b58..62a113a 100644 --- a/index.yml +++ b/index.yml @@ -22,7 +22,6 @@ servers: - url: http://localhost:8080/ description: Local on-premise installation - paths: /api/process: $ref: "./p-process.yml#/paths/~1process" @@ -38,8 +37,10 @@ paths: $ref: "./p-transaction.yml#/paths/~1tag~1{tagId}" /api/v2/tag/{tagId}/transactions: $ref: "./p-transaction.yml#/paths/~1tag~1{tagId}~1transactions" - /api/ping: - $ref: "./p-ping.yml#/paths/~1ping" + /api/healthz: + $ref: "./p-healthcheck.yml#/paths/~1healthz" + /api/readyz: + $ref: "./p-healthcheck.yml#/paths/~1readyz" tags: - name: process @@ -76,6 +77,7 @@ x-tagGroups: - name: Requests tags: - process + - healthcheck - transaction - name: Models tags: diff --git a/p-healthcheck.yml b/p-healthcheck.yml new file mode 100644 index 0000000..7867106 --- /dev/null +++ b/p-healthcheck.yml @@ -0,0 +1,62 @@ +openapi: 3.0.3 + +paths: + /healthz: + parameters: + - $ref: "./common.yml#/components/parameters/x-request" + get: + summary: "Server healthcheck" + operationId: healthz + tags: + - healthcheck + responses: + 200: + description: "Device info" + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceInfo" + /readyz: + parameters: + - $ref: "./common.yml#/components/parameters/x-request" + get: + summary: "License healthcheck" + operationId: readyz + tags: + - healthcheck + responses: + 200: + description: "License is valid" + 400: + description: "License is not valid" + +components: + schemas: + DeviceInfo: + type: object + properties: + app: + type: string + licenseId: + type: string + licenseType: + type: string + licenseSerial: + type: string + licenseValidUntil: + type: string + format: date-time + scenarios: + type: array + items: + type: string + version: + type: string + example: + "app": "Regula Document Reader Web API" + "licenseId": "4D43A2AF-E321-496C-9A4E-5A8F3D26DF0E" + "licenseType": "Transactional" + "licenseSerial": "OL70786" + "licenseValidUntil": "9999-12-31T23:59:59Z" + "scenarios": ["Mrz", "Barcode", "Locate"] + "version": "7.5.297907.1721" diff --git a/p-ping.yml b/p-ping.yml deleted file mode 100644 index 91a1eff..0000000 --- a/p-ping.yml +++ /dev/null @@ -1,43 +0,0 @@ -openapi: 3.0.3 - -paths: - /ping: - parameters: - - $ref: "./common.yml#/components/parameters/x-request" - get: - summary: "Server health check" - operationId: ping - responses: - 200: - description: "Device info" - content: - application/json: - schema: - $ref: "#/components/schemas/DeviceInfo" - -components: - schemas: - DeviceInfo: - type: object - properties: - app-name: - type: string - version: - type: string - license-id: - type: string - license-serial: - type: string - valid-until: - type: string - format: date-time - server-time: - type: string - format: date-time - example: - app-name: "Regula Process Manager Service" - version: "5.3.104980.123" - license-id: "4d43a2af-e321-496c-9a4e-5a8f3d26df0e" - license-serial: "OL70786" - valid-until: "9999-12-31T23:59:59Z" - server-time: "2020-10-16 09:42:08.080713+00:00" From d0c8cc980bbd7178aea0f354a5b074fe76933da3 Mon Sep 17 00:00:00 2001 From: rchxx <=> Date: Mon, 14 Oct 2024 14:42:11 +0300 Subject: [PATCH 2/4] move healthcheck --- index.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.yml b/index.yml index 62a113a..fd8f371 100644 --- a/index.yml +++ b/index.yml @@ -77,8 +77,8 @@ x-tagGroups: - name: Requests tags: - process - - healthcheck - transaction + - healthcheck - name: Models tags: - status_model From aad8401242bf5dcf57eb83b571a3d41e33e82282 Mon Sep 17 00:00:00 2001 From: rchxx <=> Date: Mon, 14 Oct 2024 14:54:41 +0300 Subject: [PATCH 3/4] fix example --- p-healthcheck.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/p-healthcheck.yml b/p-healthcheck.yml index 7867106..f87cc2c 100644 --- a/p-healthcheck.yml +++ b/p-healthcheck.yml @@ -53,10 +53,10 @@ components: version: type: string example: - "app": "Regula Document Reader Web API" - "licenseId": "4D43A2AF-E321-496C-9A4E-5A8F3D26DF0E" - "licenseType": "Transactional" - "licenseSerial": "OL70786" - "licenseValidUntil": "9999-12-31T23:59:59Z" - "scenarios": ["Mrz", "Barcode", "Locate"] - "version": "7.5.297907.1721" + app: "Regula Document Reader Web API" + licenseId: "4D43A2AF-E321-496C-9A4E-5A8F3D26DF0E" + licenseType: "Transactional" + licenseSerial: "OL70786" + licenseValidUntil: "9999-12-31T23:59:59Z" + scenarios: ["Mrz", "Barcode", "Locate"] + version: "7.5.297907.1721" From cada0f51a4f361d81b86f229b23107673d725c56 Mon Sep 17 00:00:00 2001 From: rchxx <=> Date: Mon, 14 Oct 2024 15:11:41 +0300 Subject: [PATCH 4/4] return ping, mark as deprecated --- index.yml | 2 ++ p-ping.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 p-ping.yml diff --git a/index.yml b/index.yml index fd8f371..2098914 100644 --- a/index.yml +++ b/index.yml @@ -37,6 +37,8 @@ paths: $ref: "./p-transaction.yml#/paths/~1tag~1{tagId}" /api/v2/tag/{tagId}/transactions: $ref: "./p-transaction.yml#/paths/~1tag~1{tagId}~1transactions" + /api/ping: + $ref: "./p-ping.yml#/paths/~1ping" /api/healthz: $ref: "./p-healthcheck.yml#/paths/~1healthz" /api/readyz: diff --git a/p-ping.yml b/p-ping.yml new file mode 100644 index 0000000..8805fa1 --- /dev/null +++ b/p-ping.yml @@ -0,0 +1,46 @@ +openapi: 3.0.3 + +paths: + /ping: + parameters: + - $ref: "./common.yml#/components/parameters/x-request" + get: + deprecated: true + summary: "Server health check" + operationId: ping + tags: + - healthcheck + responses: + 200: + description: "Device info" + content: + application/json: + schema: + $ref: "#/components/schemas/DeviceInfo" + +components: + schemas: + DeviceInfo: + type: object + properties: + app-name: + type: string + version: + type: string + license-id: + type: string + license-serial: + type: string + valid-until: + type: string + format: date-time + server-time: + type: string + format: date-time + example: + app-name: "Regula Process Manager Service" + version: "5.3.104980.123" + license-id: "4d43a2af-e321-496c-9a4e-5a8f3d26df0e" + license-serial: "OL70786" + valid-until: "9999-12-31T23:59:59Z" + server-time: "2020-10-16 09:42:08.080713+00:00" \ No newline at end of file