Skip to content

Commit 06f5753

Browse files
[SP-18833] Add /healthz and /readyz endpoints (#198)
* Add /healthz and /readyz endpoints * move healthcheck * fix example * return ping, mark as deprecated --------- Co-authored-by: rchxx
1 parent bff016a commit 06f5753

File tree

3 files changed

+71
-2
lines changed

3 files changed

+71
-2
lines changed

index.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ servers:
2222
- url: http://localhost:8080/
2323
description: Local on-premise installation
2424

25-
2625
paths:
2726
/api/process:
2827
$ref: "./p-process.yml#/paths/~1process"
@@ -40,6 +39,10 @@ paths:
4039
$ref: "./p-transaction.yml#/paths/~1tag~1{tagId}~1transactions"
4140
/api/ping:
4241
$ref: "./p-ping.yml#/paths/~1ping"
42+
/api/healthz:
43+
$ref: "./p-healthcheck.yml#/paths/~1healthz"
44+
/api/readyz:
45+
$ref: "./p-healthcheck.yml#/paths/~1readyz"
4346

4447
tags:
4548
- name: process
@@ -77,6 +80,7 @@ x-tagGroups:
7780
tags:
7881
- process
7982
- transaction
83+
- healthcheck
8084
- name: Models
8185
tags:
8286
- status_model

p-healthcheck.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
openapi: 3.0.3
2+
3+
paths:
4+
/healthz:
5+
parameters:
6+
- $ref: "./common.yml#/components/parameters/x-request"
7+
get:
8+
summary: "Server healthcheck"
9+
operationId: healthz
10+
tags:
11+
- healthcheck
12+
responses:
13+
200:
14+
description: "Device info"
15+
content:
16+
application/json:
17+
schema:
18+
$ref: "#/components/schemas/DeviceInfo"
19+
/readyz:
20+
parameters:
21+
- $ref: "./common.yml#/components/parameters/x-request"
22+
get:
23+
summary: "License healthcheck"
24+
operationId: readyz
25+
tags:
26+
- healthcheck
27+
responses:
28+
200:
29+
description: "License is valid"
30+
400:
31+
description: "License is not valid"
32+
33+
components:
34+
schemas:
35+
DeviceInfo:
36+
type: object
37+
properties:
38+
app:
39+
type: string
40+
licenseId:
41+
type: string
42+
licenseType:
43+
type: string
44+
licenseSerial:
45+
type: string
46+
licenseValidUntil:
47+
type: string
48+
format: date-time
49+
scenarios:
50+
type: array
51+
items:
52+
type: string
53+
version:
54+
type: string
55+
example:
56+
app: "Regula Document Reader Web API"
57+
licenseId: "4D43A2AF-E321-496C-9A4E-5A8F3D26DF0E"
58+
licenseType: "Transactional"
59+
licenseSerial: "OL70786"
60+
licenseValidUntil: "9999-12-31T23:59:59Z"
61+
scenarios: ["Mrz", "Barcode", "Locate"]
62+
version: "7.5.297907.1721"

p-ping.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ paths:
55
parameters:
66
- $ref: "./common.yml#/components/parameters/x-request"
77
get:
8+
deprecated: true
89
summary: "Server health check"
910
operationId: ping
11+
tags:
12+
- healthcheck
1013
responses:
1114
200:
1215
description: "Device info"
@@ -40,4 +43,4 @@ components:
4043
license-id: "4d43a2af-e321-496c-9a4e-5a8f3d26df0e"
4144
license-serial: "OL70786"
4245
valid-until: "9999-12-31T23:59:59Z"
43-
server-time: "2020-10-16 09:42:08.080713+00:00"
46+
server-time: "2020-10-16 09:42:08.080713+00:00"

0 commit comments

Comments
 (0)