Example #1
0
def hello():
    return niceJson({"subresource_uris": allLinks(app)}, 200)
Example #2
0
    try:
        url = TRANSACTIONS_SERVICE_URL + 'transactions/%s' % transNum
        res = requests.delete(url)
    except ConnectionError as e:
        raise ServiceUnavailable("Transactions service connection error: %s." %
                                 e)

    if res.status_code != codes.ok:
        raise NotFound("Cannot cancel transaction %s, resp %s, status code %s" \
                       % (transNum, res.text, res.status_code))
    else:
        return res.json()['number']


# All APIs provided by this application, automatically generated
LOCAL_APIS = allLinks(app)
# All external APIs that this application relies on, manually created
KNOWN_REMOTE_APIS = [
    ACCOUNTS_SERVICE_URL + "accounts",
    TRANSACTIONS_SERVICE_URL + "transactions"
]

# def main():
#     logger.info("%s service starting now: MTLS=%s, Token=%s" \
#                 % (SERVICE_TYPE, MTLS, TOKEN))
#     # Start Flask web server
#     if MTLS and serviceCert:
#         # SSL configuration for Flask. Order matters!
#         cert = serviceCert.getServiceCertFileName()
#         key = serviceCert.getServiceKeyFileName()
#         if cert and key: