Add Service Status page with service_health_check and report_issue examples

This commit is contained in:
Ross Savage
2023-11-27 13:50:16 +01:00
parent b65d2c0d85
commit 2e24d376ee
11 changed files with 348 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import breez_sdk
def health_check_status(sdk_services):
try:
# ANCHOR: health-check-status
health_check = sdk_services.service_health_check()
print("Current service status is: ", health_check.status)
# ANCHOR_END: health-check-status
except Exception as error:
print(error)
raise
def report_payment_failure(sdk_services):
try:
# ANCHOR: report-payment-failure
payment_hash = "..."
sdk_services.report_issue(
breez_sdk.ReportIssueRequest.PAYMENT_FAILURE(
breez_sdk.ReportPaymentFailureDetails(payment_hash)))
# ANCHOR_END: report-payment-failure
except Exception as error:
print(error)
raise