Skip to content

Commit 82d4ab4

Browse files
SP-21987: Add healthz method
1 parent 6dd7184 commit 82d4ab4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

example/example.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"X-CLIENT-KEY": "123",
2525
"Authorization": "Bearer 123"
2626
}
27+
healthz_response = api.get_healthz()
28+
2729
params = ProcessParams(already_cropped=True, scenario=Scenario.FULL_PROCESS)
2830

2931
# Add license to request
@@ -86,6 +88,7 @@
8688
Document Number Visual: {doc_number_visual}
8789
Document Type: {response.result_by_type(result_type=Result.DOCUMENT_TYPE).one_candidate.document_name}
8890
Validity Of Document Number Visual: {doc_number_visual_validity}
91+
License id: {healthz_response.license_id}
8992
""")
9093

9194
print("-----------------------All Text Fields------------------------")

regula/documentreader/webclient/ext/api/document_reader_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import base64
21
from typing import Union
32

43
from regula.documentreader.webclient import ProcessResponse
@@ -35,6 +34,9 @@ def set_configuration(self, configuration) -> None:
3534
def process(self, process_request: ProcessRequest) -> RecognitionResponse:
3635
return RecognitionResponse(self.api_process(process_request))
3736

37+
def get_healthz(self, **kwargs):
38+
return self.healthz(**kwargs)
39+
3840
def deserialize_to_recognition_response(self, content: Union[bytes, bytearray, str]) -> RecognitionResponse:
3941
response = self.__to_response_object(content)
4042
response = self.api_client.deserialize(response, ProcessResponse)

0 commit comments

Comments
 (0)