def _router_request(router, method, data=None):
 if (router not in ROUTERS):
  return False
 req_data = json.dumps([dict(action=router, method=method, data=data, type='rpc', tid=1)])
 config = __salt__['config.option']('zenoss')
 log.debug('Making request to router %s with method %s', router, method)
 url = '{0}/zport/dmd/{1}_router'.format(config.get('hostname'), ROUTERS[router])
 response = _session().post(url, data=req_data)
 if re.search('name="__ac_name"', response.content):
  log.error('Request failed. Bad username/password.')
  raise Exception('Request failed. Bad username/password.')
 return json.loads(response.content).get('result', None)

def _router_request ( router , method , data = None ) : if ( router not in ROUTERS ) : return False req_data = json . dumps ( [ dict ( action = router , method = method , data = data , type = 'rpc' , tid = 1 ) ] ) config = __salt__ [ 'config.option' ] ( 'zenoss' ) log . debug ( 'Making request to router %s with method %s' , router , method ) url = '{0}/zport/dmd/{1}_router' . format ( config . get ( 'hostname' ) , ROUTERS [ router ] ) response = _session ( ) . post ( url , data = req_data ) if re . search ( 'name="__ac_name"' , response . content ) : log . error ( 'Request failed. Bad username/password.' ) raise Exception ( 'Request failed. Bad username/password.' ) return json . loads ( response . content ) . get ( 'result' , None )
make a request to the zenoss api router .