def template_get(name=None, host=None, templateids=None, **connection_args):
 conn_args = _login(**connection_args)
 try:
  if conn_args:
   method = 'template.get'
   params = {'output': 'extend', 'filter': {}}
   if name:
    params['filter'].setdefault('name', name)
   if host:
    params['filter'].setdefault('host', host)
   if templateids:
    params.setdefault('templateids', templateids)
   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 template_get ( name = None , host = None , templateids = None , ** connection_args ) : conn_args = _login ( ** connection_args ) try : if conn_args : method = 'template.get' params = { 'output' : 'extend' , 'filter' : { } } if name : params [ 'filter' ] . setdefault ( 'name' , name ) if host : params [ 'filter' ] . setdefault ( 'host' , host ) if templateids : params . setdefault ( 'templateids' , templateids ) 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 templates according to the given parameters .