NX Cloud to send alerts/notifications

Answered

Comments

2 comments

  • Avatar
    Andrey Terentyev

    Hello,

    If the ability is confirmed inexistent, couldn't it be implemented easily, can I suggest/ask for this upgrade?

    You could use Cloud API for polling the system status.

    If you take this script as a basis

    https://github.com/networkoptix/nx_open_integrations/blob/master/python/examples/authentication/cloud_bearer.py

    and modify the main() as following:

    def main():
    oauth_payload = create_payload()
    oath_response = request_api(CLOUD_URL, f'/cdb/oauth2/token', 'POST', json=oauth_payload)
    primary_token = get_token(oath_response)

    oath_response = request_api(CLOUD_URL, f'/cdb/oauth2/token', 'POST', json=oauth_payload)
    secondary_token = get_token(oath_response)

    primary_token_header = create_header(primary_token)

    system_info = request_api(CLOUD_URL, f'/cdb/system/get', 'GET',
    headers=primary_token_header, verify=False)

    print(system_info)
    secondary_token_header = create_header(secondary_token)

    request_api(CLOUD_URL, f'/cdb/oauth2/token/{primary_token}', 'DELETE', headers=secondary_token_header)

    it would give a list of system, where you find the status by checking the "stateOfHealth" value.

    0
    Comment actions Permalink
  • Avatar
    Marco Perin

    Thank you, Andrey.

    Unfortunately, I posted this in the wrong place, I'm not a developer and that's not gonna work for me.

    Regards,

    Marco

    0
    Comment actions Permalink

Please sign in to leave a comment.