Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,19 @@ _GET `/_up`_
```py
# section: code
from ibmcloudant.cloudant_v1 import CloudantV1
from ibm_cloud_sdk_core.api_exception import ApiException

service = CloudantV1.new_instance()
try:
response = service.get_up_information()

response = service.get_up_information().get_result()

print(response)
print("Service is up and healthy")
print(response.get_result())
except ApiException as ae:
if ae.code == 503:
print(f"Service is unavailable, status code: {ae.code}")
else:
print(f"Issue performing health check, status code: {ae.code}, message: {ae.http_response.reason}")
```

## getUuids
Expand Down
13 changes: 10 additions & 3 deletions examples/snippets/getUpInformation/example_request.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# section: code
from ibmcloudant.cloudant_v1 import CloudantV1
from ibm_cloud_sdk_core.api_exception import ApiException

service = CloudantV1.new_instance()
try:
response = service.get_up_information()

response = service.get_up_information().get_result()

print(response)
print("Service is up and healthy")
print(response.get_result())
except ApiException as ae:
if ae.code == 503:
print(f"Service is unavailable, status code: {ae.code}")
else:
print(f"Issue performing health check, status code: {ae.code}, message: {ae.http_response.reason}")
14 changes: 14 additions & 0 deletions examples/snippets/headUpInformation/example_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# section: code
from ibmcloudant.cloudant_v1 import CloudantV1
from ibm_cloud_sdk_core.api_exception import ApiException

service = CloudantV1.new_instance()
try:
response = service.head_up_information()

print("Service is up and healthy")
except ApiException as ae:
if ae.code == 503:
print(f"Service is unavailable, status code: {ae.code}")
else:
print(f"Issue performing health check, status code: {ae.code}, message: {ae.http_response.reason}")