nodes: 0, module; 1, function_definition; 2, function_name:execute; 3, parameters; 4, block; 5, identifier:self; 6, identifier:query; 7, keyword_separator; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, default_parameter; 12, expression_statement; 13, expression_statement; 14, expression_statement; 15, return_statement; 16, identifier:dc; 17, None; 18, identifier:near; 19, None; 20, identifier:limit; 21, None; 22, identifier:consistency; 23, None; 24, comment:"""Executes a prepared query
  
          Parameters:
              query (ObjectID): Query ID
              dc (str): Specify datacenter that will be used.
                        Defaults to the agent's local datacenter.
              near (str): Sort the resulting list in ascending order based on
                          the estimated round trip time from that node
              limit (int): Limit the list's size to the given number of nodes
              consistency (Consistency): Force consistency
          Returns:
              Object:
          Raises:
              NotFound: the query does not exist
  
          Returns a body like this::
  
              {
                  "Service": "redis",
                  "Nodes": [
                      {
                          "Node": {
                              "Node": "foobar",
                              "Address": "10.1.10.12",
                              "TaggedAddresses": {
                                  "lan": "10.1.10.12",
                                  "wan": "10.1.10.12"
                              }
                          },
                          "Service": {
                              "ID": "redis",
                              "Service": "redis",
                              "Tags": None,
                              "Port": 8000
                          },
                          "Checks": [
                              {
                                  "Node": "foobar",
                                  "CheckID": "service:redis",
                                  "Name": "Service 'redis' check",
                                  "Status": "passing",
                                  "Notes": "",
                                  "Output": "",
                                  "ServiceID": "redis",
                                  "ServiceName": "redis"
                              },
                              {
                                  "Node": "foobar",
                                  "CheckID": "serfHealth",
                                  "Name": "Serf Health Status",
                                  "Status": "passing",
                                  "Notes": "",
                                  "Output": "",
                                  "ServiceID": "",
                                  "ServiceName": ""
                              }
                          ],
                          "DNS": {
                              "TTL": timedelta(seconds=10)
                          },
                          "Datacenter": "dc3",
                          "Failovers": 2
                      }
                  ]
              }
  
          The **Nodes** section contains the list of healthy nodes providing
          the given service, as specified by the constraints of the prepared
          query.
  
          **Service** has the service name that the query was selecting. This is
          useful for context in case an empty list of nodes is returned.
  
          **DNS** has information used when serving the results over DNS. This
          is just a copy of the structure given when the prepared query was
          created.
  
          **Datacenter** has the datacenter that ultimately provided the list of
          nodes and **Failovers** has the number of remote datacenters that were
          queried while executing the query. This provides some insight into
          where the data came from. This will be zero during non-failover
          operations where there were healthy nodes found in the local
          datacenter.
          """; 25, assignment; 26, assignment; 27, attribute; 28, identifier:query_id; 29, call; 30, identifier:response; 31, await; 32, identifier:response; 33, identifier:body; 34, identifier:extract_attr; 35, argument_list; 36, call; 37, identifier:query; 38, keyword_argument; 39, attribute; 40, argument_list; 41, identifier:keys; 42, list; 43, attribute; 44, identifier:get; 45, binary_operator:"/v1/query/%s/execute" % query_id; 46, keyword_argument; 47, keyword_argument; 48, string:"ID"; 49, identifier:self; 50, identifier:_api; 51, string:"/v1/query/%s/execute"; 52, identifier:query_id; 53, identifier:params; 54, dictionary; 55, identifier:consistency; 56, identifier:consistency; 57, pair; 58, pair; 59, pair; 60, string:"dc"; 61, identifier:dc; 62, string:"near"; 63, identifier:near; 64, string:"limit"; 65, identifier:limit
code: async def execute(self, query, *,
                        dc=None, near=None, limit=None, consistency=None):
          """Executes a prepared query
  
          Parameters:
              query (ObjectID): Query ID
              dc (str): Specify datacenter that will be used.
                        Defaults to the agent's local datacenter.
              near (str): Sort the resulting list in ascending order based on
                          the estimated round trip time from that node
              limit (int): Limit the list's size to the given number of nodes
              consistency (Consistency): Force consistency
          Returns:
              Object:
          Raises:
              NotFound: the query does not exist
  
          Returns a body like this::
  
              {
                  "Service": "redis",
                  "Nodes": [
                      {
                          "Node": {
                              "Node": "foobar",
                              "Address": "10.1.10.12",
                              "TaggedAddresses": {
                                  "lan": "10.1.10.12",
                                  "wan": "10.1.10.12"
                              }
                          },
                          "Service": {
                              "ID": "redis",
                              "Service": "redis",
                              "Tags": None,
                              "Port": 8000
                          },
                          "Checks": [
                              {
                                  "Node": "foobar",
                                  "CheckID": "service:redis",
                                  "Name": "Service 'redis' check",
                                  "Status": "passing",
                                  "Notes": "",
                                  "Output": "",
                                  "ServiceID": "redis",
                                  "ServiceName": "redis"
                              },
                              {
                                  "Node": "foobar",
                                  "CheckID": "serfHealth",
                                  "Name": "Serf Health Status",
                                  "Status": "passing",
                                  "Notes": "",
                                  "Output": "",
                                  "ServiceID": "",
                                  "ServiceName": ""
                              }
                          ],
                          "DNS": {
                              "TTL": timedelta(seconds=10)
                          },
                          "Datacenter": "dc3",
                          "Failovers": 2
                      }
                  ]
              }
  
          The **Nodes** section contains the list of healthy nodes providing
          the given service, as specified by the constraints of the prepared
          query.
  
          **Service** has the service name that the query was selecting. This is
          useful for context in case an empty list of nodes is returned.
  
          **DNS** has information used when serving the results over DNS. This
          is just a copy of the structure given when the prepared query was
          created.
  
          **Datacenter** has the datacenter that ultimately provided the list of
          nodes and **Failovers** has the number of remote datacenters that were
          queried while executing the query. This provides some insight into
          where the data came from. This will be zero during non-failover
          operations where there were healthy nodes found in the local
          datacenter.
          """
          query_id = extract_attr(query, keys=["ID"])
          response = await self._api.get(
              "/v1/query/%s/execute" % query_id,
              params={"dc": dc, "near": near, "limit": limit},
              consistency=consistency)
          return response.body