def hostgroup_get(name=None, groupids=None, hostids=None, **connection_args):
 conn_args = _login(**connection_args)
 try:
  if conn_args:
   method = 'hostgroup.get'
   params = {'output': 'extend'}
   if ((not groupids) and (not name) and (not hostids)):
    return False
   if name:
    name_dict = {'name': name}
    params.setdefault('filter', name_dict)
   if groupids:
    params.setdefault('groupids', groupids)
   if hostids:
    params.setdefault('hostids', hostids)
   params = _params_extend(params, **connection_args)
   ret = _query(method, params, conn_args['url'], conn_args['auth'])
   return (ret['result'] if (len(ret['result']) > 0) else False)
  else:
   raise KeyError
 except KeyError:
  return False

def hostgroup_get ( name = None , groupids = None , hostids = None , ** connection_args ) : conn_args = _login ( ** connection_args ) try : if conn_args : method = 'hostgroup.get' params = { 'output' : 'extend' } if ( ( not groupids ) and ( not name ) and ( not hostids ) ) : return False if name : name_dict = { 'name' : name } params . setdefault ( 'filter' , name_dict ) if groupids : params . setdefault ( 'groupids' , groupids ) if hostids : params . setdefault ( 'hostids' , hostids ) params = _params_extend ( params , ** connection_args ) ret = _query ( method , params , conn_args [ 'url' ] , conn_args [ 'auth' ] ) return ( ret [ 'result' ] if ( len ( ret [ 'result' ] ) > 0 ) else False ) else : raise KeyError except KeyError : return False
retrieve host groups according to the given parameters .