nodes: 0, module; 1, function_definition; 2, function_name:build_query_uri; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, default_parameter; 13, default_parameter; 14, default_parameter; 15, expression_statement; 16, if_statement; 17, if_statement; 18, if_statement; 19, if_statement; 20, if_statement; 21, if_statement; 22, expression_statement; 23, expression_statement; 24, expression_statement; 25, expression_statement; 26, return_statement; 27, identifier:start; 28, integer:0; 29, identifier:count; 30, unary_operator; 31, identifier:filter; 32, string; 33, identifier:query; 34, string; 35, identifier:sort; 36, string; 37, identifier:view; 38, string; 39, identifier:fields; 40, string; 41, identifier:uri; 42, None; 43, identifier:scope_uris; 44, string; 45, comment:"""
          Builds the URI given the parameters.
  
          More than one request can be send to get the items, regardless the query parameter 'count', because the actual
          number of items in the response might differ from the requested count. Some types of resource have a limited
          number of items returned on each call. For those resources, additional calls are made to the API to retrieve
          any other items matching the given filter. The actual number of items can also differ from the requested call
          if the requested number of items would take too long.
  
          The use of optional parameters for OneView 2.0 is described at:
          http://h17007.www1.hpe.com/docs/enterprise/servers/oneview2.0/cic-api/en/api-docs/current/index.html
  
          Note:
              Single quote - "'" - inside a query parameter is not supported by OneView API.
  
          Args:
              start:
                  The first item to return, using 0-based indexing.
                  If not specified, the default is 0 - start with the first available item.
              count:
                  The number of resources to return. A count of -1 requests all items (default).
              filter (list or str):
                  A general filter/query string to narrow the list of items returned. The default is no
                  filter; all resources are returned.
              query:
                  A single query parameter can do what would take multiple parameters or multiple GET requests using
                  filter. Use query for more complex queries. NOTE: This parameter is experimental for OneView 2.0.
              sort:
                  The sort order of the returned data set. By default, the sort order is based on create time with the
                  oldest entry first.
              view:
                  Returns a specific subset of the attributes of the resource or collection by specifying the name of a
                  predefined view. The default view is expand (show all attributes of the resource and all elements of
                  the collections or resources).
              fields:
                  Name of the fields.
              uri:
                  A specific URI (optional)
              scope_uris:
                  An expression to restrict the resources returned according to the scopes to
                  which they are assigned.
  
          Returns:
              uri: The complete uri
          """; 46, identifier:filter; 47, block; 48, identifier:query; 49, block; 50, identifier:sort; 51, block; 52, identifier:view; 53, block; 54, identifier:fields; 55, block; 56, identifier:scope_uris; 57, block; 58, assignment; 59, call; 60, assignment; 61, assignment; 62, identifier:uri; 63, integer:1; 64, expression_statement; 65, expression_statement; 66, expression_statement; 67, expression_statement; 68, expression_statement; 69, expression_statement; 70, identifier:path; 71, conditional_expression:uri if uri else self._uri; 72, attribute; 73, argument_list; 74, identifier:symbol; 75, conditional_expression:'?' if '?' not in path else '&'; 76, identifier:uri; 77, call; 78, assignment; 79, assignment; 80, assignment; 81, assignment; 82, assignment; 83, assignment; 84, identifier:uri; 85, identifier:uri; 86, attribute; 87, identifier:self; 88, identifier:__validate_resource_uri; 89, identifier:path; 90, string; 91, comparison_operator:'?' not in path; 92, string; 93, attribute; 94, argument_list; 95, identifier:filter; 96, call; 97, identifier:query; 98, binary_operator:"&query=" + quote(query); 99, identifier:sort; 100, binary_operator:"&sort=" + quote(sort); 101, identifier:view; 102, binary_operator:"&view=" + quote(view); 103, identifier:fields; 104, binary_operator:"&fields=" + quote(fields); 105, identifier:scope_uris; 106, binary_operator:"&scopeUris=" + quote(scope_uris); 107, identifier:self; 108, identifier:_uri; 109, string_content:?; 110, string; 111, identifier:path; 112, string_content:&; 113, string:"{0}{1}start={2}&count={3}{4}{5}{6}{7}{8}{9}"; 114, identifier:format; 115, identifier:path; 116, identifier:symbol; 117, identifier:start; 118, identifier:count; 119, identifier:filter; 120, identifier:query; 121, identifier:sort; 122, identifier:view; 123, identifier:fields; 124, identifier:scope_uris; 125, attribute; 126, argument_list; 127, string:"&query="; 128, call; 129, string:"&sort="; 130, call; 131, string:"&view="; 132, call; 133, string:"&fields="; 134, call; 135, string:"&scopeUris="; 136, call; 137, string_content:?; 138, identifier:self; 139, identifier:__make_query_filter; 140, identifier:filter; 141, identifier:quote; 142, argument_list; 143, identifier:quote; 144, argument_list; 145, identifier:quote; 146, argument_list; 147, identifier:quote; 148, argument_list; 149, identifier:quote; 150, argument_list; 151, identifier:query; 152, identifier:sort; 153, identifier:view; 154, identifier:fields; 155, identifier:scope_uris
code: def build_query_uri(self, start=0, count=-1, filter='', query='', sort='', view='', fields='', uri=None, scope_uris=''):
          """
          Builds the URI given the parameters.
  
          More than one request can be send to get the items, regardless the query parameter 'count', because the actual
          number of items in the response might differ from the requested count. Some types of resource have a limited
          number of items returned on each call. For those resources, additional calls are made to the API to retrieve
          any other items matching the given filter. The actual number of items can also differ from the requested call
          if the requested number of items would take too long.
  
          The use of optional parameters for OneView 2.0 is described at:
          http://h17007.www1.hpe.com/docs/enterprise/servers/oneview2.0/cic-api/en/api-docs/current/index.html
  
          Note:
              Single quote - "'" - inside a query parameter is not supported by OneView API.
  
          Args:
              start:
                  The first item to return, using 0-based indexing.
                  If not specified, the default is 0 - start with the first available item.
              count:
                  The number of resources to return. A count of -1 requests all items (default).
              filter (list or str):
                  A general filter/query string to narrow the list of items returned. The default is no
                  filter; all resources are returned.
              query:
                  A single query parameter can do what would take multiple parameters or multiple GET requests using
                  filter. Use query for more complex queries. NOTE: This parameter is experimental for OneView 2.0.
              sort:
                  The sort order of the returned data set. By default, the sort order is based on create time with the
                  oldest entry first.
              view:
                  Returns a specific subset of the attributes of the resource or collection by specifying the name of a
                  predefined view. The default view is expand (show all attributes of the resource and all elements of
                  the collections or resources).
              fields:
                  Name of the fields.
              uri:
                  A specific URI (optional)
              scope_uris:
                  An expression to restrict the resources returned according to the scopes to
                  which they are assigned.
  
          Returns:
              uri: The complete uri
          """
  
          if filter:
              filter = self.__make_query_filter(filter)
  
          if query:
              query = "&query=" + quote(query)
  
          if sort:
              sort = "&sort=" + quote(sort)
  
          if view:
              view = "&view=" + quote(view)
  
          if fields:
              fields = "&fields=" + quote(fields)
  
          if scope_uris:
              scope_uris = "&scopeUris=" + quote(scope_uris)
  
          path = uri if uri else self._uri
          self.__validate_resource_uri(path)
  
          symbol = '?' if '?' not in path else '&'
  
          uri = "{0}{1}start={2}&count={3}{4}{5}{6}{7}{8}{9}".format(path, symbol, start, count, filter, query, sort,
                                                                     view, fields, scope_uris)
          return uri