def _query(action=None, command=None, args=None, method='GET', header_dict=None, data=None):
 vm_ = get_configured_provider()
 apikey = config.get_cloud_config_value('apikey', vm_, __opts__, search_global=False)
 sharedsecret = config.get_cloud_config_value('sharedsecret', vm_, __opts__, search_global=False)
 path = 'https://api.gogrid.com/api/'
 if action:
  path += action
 if command:
  path += '/{0}'.format(command)
 log.debug('GoGrid URL: {0}'.format(path))
 if (not isinstance(args, dict)):
  args = {}
 epoch = str(int(time.time()))
 hashtext = ''.join((apikey, sharedsecret, epoch))
 args['sig'] = hashlib.md5(hashtext).hexdigest()
 args['format'] = 'json'
 args['v'] = '1.0'
 args['api_key'] = apikey
 if (header_dict is None):
  header_dict = {}
 if (method != 'POST'):
  header_dict['Accept'] = 'application/json'
 decode = True
 if (method == 'DELETE'):
  decode = False
 return_content = None
 result = salt.utils.http.query(path, method, params=args, data=data, header_dict=header_dict, decode=decode, decode_type='json', text=True, status=True, opts=__opts__)
 log.debug('GoGrid Response Status Code: {0}'.format(result['status']))
 return result['dict']

def _query ( action = None , command = None , args = None , method = 'GET' , header_dict = None , data = None ) : vm_ = get_configured_provider ( ) apikey = config . get_cloud_config_value ( 'apikey' , vm_ , __opts__ , search_global = False ) sharedsecret = config . get_cloud_config_value ( 'sharedsecret' , vm_ , __opts__ , search_global = False ) path = 'https://api.gogrid.com/api/' if action : path += action if command : path += '/{0}' . format ( command ) log . debug ( 'GoGrid URL: {0}' . format ( path ) ) if ( not isinstance ( args , dict ) ) : args = { } epoch = str ( int ( time . time ( ) ) ) hashtext = '' . join ( ( apikey , sharedsecret , epoch ) ) args [ 'sig' ] = hashlib . md5 ( hashtext ) . hexdigest ( ) args [ 'format' ] = 'json' args [ 'v' ] = '1.0' args [ 'api_key' ] = apikey if ( header_dict is None ) : header_dict = { } if ( method != 'POST' ) : header_dict [ 'Accept' ] = 'application/json' decode = True if ( method == 'DELETE' ) : decode = False return_content = None result = salt . utils . http . query ( path , method , params = args , data = data , header_dict = header_dict , decode = decode , decode_type = 'json' , text = True , status = True , opts = __opts__ ) log . debug ( 'GoGrid Response Status Code: {0}' . format ( result [ 'status' ] ) ) return result [ 'dict' ]
perform a query directly against the vultr rest api .