Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsAlive API endpoint #4

Open
olemis opened this issue Feb 21, 2019 · 0 comments
Open

IsAlive API endpoint #4

olemis opened this issue Feb 21, 2019 · 0 comments
Assignees

Comments

@olemis
Copy link
Contributor

olemis commented Feb 21, 2019

[GET] /api/isalive

Should return some general service info. Used to check if the service is running. Response:

{
// Name of the service
“name”: “string”,
// Version of the service
“version”: “string”,
// ENV_INFO environment variable value
“env”: “string”,
// Flag, which indicates if the service is built
// in the debug configuration or not
“isDebug”: boolean
}

Python implementation

@api.route('/isalive', methods=['GET'])
def isalive():
    """
    Return some general service info. Used to check if service is running
    """

    version = get_version()

    if "error" in version:
        return make_response(
            jsonify(build_error(version["error"])),
            version["status"]
        )

    result = {
        "name": app.config['SKYCOIN_FIBER_NAME'],
        "version": version,
        "env": app.config["ENVIRONMENT"],
        "isDebug": app.config["DEBUG"],
        "contractVersion": app.config['SWAGGER_API_VERSION']
    }

    return jsonify(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants