def call(payload, apply_changes=False):
    '''
    Sends a post command to the device and returns the decoded data.
    '''
    session, cookies, csrf_token = logon()
    response = _post_request(session, payload, cookies, csrf_token)
    if apply_changes:
        apply_payload = {"jsonrpc": "2.0",
                         "id": "ID1",
                         "method": "apply_policy_changes",
                         "params": []}
        _post_request(session, apply_payload, cookies, csrf_token)
    logout(session, cookies, csrf_token)
    return response
def call ( payload , apply_changes = False ) : session , cookies , csrf_token = logon ( ) response = _post_request ( session , payload , cookies , csrf_token ) if apply_changes : apply_payload = { "jsonrpc" : "2.0" , "id" : "ID1" , "method" : "apply_policy_changes" , "params" : [ ] } _post_request ( session , apply_payload , cookies , csrf_token ) logout ( session , cookies , csrf_token ) return response
Sends a post command to the device and returns the decoded data.