Skip to content

Commit 83f79a5

Browse files
Merge pull request #103 from regulaforensics/feature/add-healthchecks
[SP-18949] Add /healthz and /readyz endpoints
2 parents 2ecb93b + ea82f97 commit 83f79a5

7 files changed

Lines changed: 78 additions & 48 deletions

File tree

detect.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ paths:
55
- $ref: './common.yml#/components/parameters/x-request'
66
post:
77
tags:
8-
- matching
8+
- match
99
summary: "detect and check quality"
1010
description: "Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people.
1111

diagnostics.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

healthcheck.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
licenseSerial:
43+
type: string
44+
licenseValidUntil:
45+
type: string
46+
format: date-time
47+
version:
48+
type: string
49+
example:
50+
app: "Regula Face Recognition Web API"
51+
licenseId: "4D43A2AF-E321-496C-9A4E-5A8F3D26DF0E"
52+
licenseSerial: "OL70786"
53+
licenseValidUntil: "9999-12-31T23:59:59Z"
54+
version: "7.5.297907.1721"

identification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ components:
124124
outputImageParams:
125125
$ref: "./common.yml#/components/schemas/OutputImageParams"
126126
detectAll:
127-
$ref: "./matching.yml#/components/schemas/detectAll"
127+
$ref: "./match.yml#/components/schemas/detectAll"
128128
threshold:
129129
type: number
130130
format: float

index.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,18 @@ info:
2222
* [Java](https://github.com/regulaforensics/FaceSDK-web-java-client) client compatible with jvm and android
2323
* [Python](https://github.com/regulaforensics/FaceSDK-web-python-client) 3.5+ client
2424
* [C#](https://github.com/regulaforensics/FaceSDK-web-csharp-client) client for .NET & .NET Core
25-
x-tagGroups:
26-
name: liveness
25+
26+
x-tagGroups:
27+
- name: Core
2728
tags:
28-
- liveness
2929
- match
30+
- person
31+
- group
32+
- search
33+
- liveness 2.0
34+
- name: Requests
35+
tags:
36+
- healthcheck
3037

3138
servers:
3239
- url: http://localhost:41101/
@@ -37,7 +44,7 @@ servers:
3744
# ~1 means '/'
3845
paths:
3946
/api/match:
40-
$ref: './matching.yml#/paths/~1match'
47+
$ref: './match.yml#/paths/~1match'
4148
/api/match_and_search:
4249
$ref: './match_and_search.yml#/paths/~1match_and_search'
4350
/api/detect:
@@ -62,5 +69,7 @@ paths:
6269
$ref: './search.yml#/paths/~1search'
6370
/api/v2/liveness:
6471
$ref: './liveness.yml#/paths/~1v2~1liveness'
65-
/api/readiness:
66-
$ref: './diagnostics.yml#/paths/~1readiness'
72+
/api/healthz:
73+
$ref: "./healthcheck.yml#/paths/~1healthz"
74+
/api/readyz:
75+
$ref: "./healthcheck.yml#/paths/~1readyz"

matching.yml renamed to match.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ paths:
55
- $ref: './common.yml#/components/parameters/x-request'
66
post:
77
tags:
8-
- matching
8+
- match
99
summary: "compare faces (1:1)"
1010
description: "To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It's possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter. <br><br> The face detection result is displayed in the `detections` field.
1111

match_and_search.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ paths:
55
- $ref: './common.yml#/components/parameters/x-request'
66
post:
77
tags:
8-
- matching
8+
- match
99
summary: 'match and search (1:1 + 1:N)'
10-
description: "To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. If only one person is identified, matching is not performed and only search is carried out."
10+
description: "To compare several images from a document and look up a person in the database in one request, use POST `/api/match_and_search`. In this case, the calculation of the descriptor will be performed only once, as opposed to using two requests for the same operation. If only one person is identified, match is not performed and only search is carried out."
1111
operationId: match_and_search
1212
requestBody:
1313
required: true
@@ -42,7 +42,7 @@ components:
4242
content:
4343
$ref: './common.yml#/components/schemas/ImageData'
4444
type:
45-
$ref: './matching.yml#/components/schemas/ImageSource'
45+
$ref: './match.yml#/components/schemas/ImageSource'
4646
groupIds:
4747
type: array
4848
description: "IDs of the groups in which the search is performed."
@@ -59,7 +59,7 @@ components:
5959
type: array
6060
description: "The match and search results."
6161
items:
62-
$ref: './matching.yml#/components/schemas/MatchImageResult'
62+
$ref: './match.yml#/components/schemas/MatchImageResult'
6363
elapsedTime:
6464
type: number
6565
description: "Time the processing has taken, ms."
@@ -81,7 +81,7 @@ components:
8181
items:
8282
$ref: '#/components/schemas/FacesResponse'
8383
imageIndex:
84-
$ref: './matching.yml#/components/schemas/MatchImageIndex'
84+
$ref: './match.yml#/components/schemas/MatchImageIndex'
8585
status:
8686
$ref: './common.yml#/components/schemas/FaceSDKResultCode'
8787
PersonWithImages:
@@ -97,7 +97,7 @@ components:
9797

9898
FacesResponse:
9999
allOf:
100-
- $ref: './matching.yml#/components/schemas/DetectionFace'
100+
- $ref: './match.yml#/components/schemas/DetectionFace'
101101
- type: object
102102
properties:
103103
persons:

0 commit comments

Comments
 (0)