(redata, jdata, logger)
Perform actual call
Perform actual call
Perform actual call
def call_linode(redata, jdata, logger):
    ''' Perform actual call '''
    url = 'https://api.linode.com/'
    params = {
        "api_action": "linode.boot",
        "LinodeID": int(redata['data']['linode_id']),
        "api_key": str(redata['data']['api_key'])
    }
    try:
        req = requests.post(
            url, timeout=3.0, data=params, verify=True)
    except:
        return False
    if req.status_code >= 200 and req.status_code < 300:
        if len(req.json()['ERRORARRAY']) > 0:
            line = 'linode-boot: Request to {0} sent for monitor {1} - \
                False'.format(url, jdata['cid'])
            logger.info(line)
            return False
        else:
            line = 'linode-boot: Request to {0} sent for monitor {1} - \
                Successful'.format(url, jdata['cid'])
            logger.info(line)
        return True
def call_linode ( redata , jdata , logger ) : url = 'https://api.linode.com/' params = { "api_action" : "linode.boot" , "LinodeID" : int ( redata [ 'data' ] [ 'linode_id' ] ) , "api_key" : str ( redata [ 'data' ] [ 'api_key' ] ) } try : req = requests . post ( url , timeout = 3.0 , data = params , verify = True ) except : return False if req . status_code >= 200 and req . status_code < 300 : if len ( req . json ( ) [ 'ERRORARRAY' ] ) > 0 : line = 'linode-boot: Request to {0} sent for monitor {1} - \
                False' . format ( url , jdata [ 'cid' ] ) logger . info ( line ) return False else : line = 'linode-boot: Request to {0} sent for monitor {1} - \
                Successful' . format ( url , jdata [ 'cid' ] ) logger . info ( line ) return True