def search_by_tag(resource_search_uri, ipaddr, port):
 str_uri = six.text_type(resource_search_uri)
 if (('search' in str_uri) and ('?tag=' in str_uri)):
  (s, h) = service_json_request(ipaddr, port, 'GET', resource_search_uri, None)
  o = json_decode(s)
  if (not o):
   return None
  resources = get_node_value(o, 'resource')
  resource_uris = []
  for resource in resources:
   resource_uris.append(resource['id'])
  return resource_uris
 else:
  raise CoprHdError(CoprHdError.VALUE_ERR, (_('Search URI %s is not in the expected format, it should end with ?tag={0}') % str_uri))

def search_by_tag ( resource_search_uri , ipaddr , port ) : str_uri = six . text_type ( resource_search_uri ) if ( ( 'search' in str_uri ) and ( '?tag=' in str_uri ) ) : ( s , h ) = service_json_request ( ipaddr , port , 'GET' , resource_search_uri , None ) o = json_decode ( s ) if ( not o ) : return None resources = get_node_value ( o , 'resource' ) resource_uris = [ ] for resource in resources : resource_uris . append ( resource [ 'id' ] ) return resource_uris else : raise CoprHdError ( CoprHdError . VALUE_ERR , ( _ ( 'Search URI %s is not in the expected format, it should end with ?tag={0}' ) % str_uri ) )
fetches the list of resources with a given tag .