1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="apigee_v1.html">Apigee API</a> . <a href="apigee_v1.organizations.html">organizations</a> . <a href="apigee_v1.organizations.environments.html">environments</a> . <a href="apigee_v1.organizations.environments.queries.html">queries</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#close">close()</a></code></p> 79<p class="firstline">Close httplib2 connections.</p> 80<p class="toc_element"> 81 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p> 82<p class="firstline">Submit a query to be processed in the background. If the submission of the query succeeds, the API returns a 201 status and an ID that refer to the query. In addition to the HTTP status 201, the `state` of "enqueued" means that the request succeeded.</p> 83<p class="toc_element"> 84 <code><a href="#get">get(name, x__xgafv=None)</a></code></p> 85<p class="firstline">Get query status If the query is still in progress, the `state` is set to "running" After the query has completed successfully, `state` is set to "completed"</p> 86<p class="toc_element"> 87 <code><a href="#getResult">getResult(name, x__xgafv=None)</a></code></p> 88<p class="firstline">After the query is completed, use this API to retrieve the results. If the request succeeds, and there is a non-zero result set, the result is downloaded to the client as a zipped JSON file. The name of the downloaded file will be: OfflineQueryResult-.zip Example: `OfflineQueryResult-9cfc0d85-0f30-46d6-ae6f-318d0cb961bd.zip`</p> 89<p class="toc_element"> 90 <code><a href="#list">list(parent, dataset=None, from=None, inclQueriesWithoutReport=None, status=None, submittedBy=None, to=None, x__xgafv=None)</a></code></p> 91<p class="firstline">Return a list of Asynchronous Queries</p> 92<h3>Method Details</h3> 93<div class="method"> 94 <code class="details" id="close">close()</code> 95 <pre>Close httplib2 connections.</pre> 96</div> 97 98<div class="method"> 99 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code> 100 <pre>Submit a query to be processed in the background. If the submission of the query succeeds, the API returns a 201 status and an ID that refer to the query. In addition to the HTTP status 201, the `state` of "enqueued" means that the request succeeded. 101 102Args: 103 parent: string, Required. The parent resource name. Must be of the form `organizations/{org}/environments/{env}`. (required) 104 body: object, The request body. 105 The object takes the form of: 106 107{ 108 "csvDelimiter": "A String", # Delimiter used in the CSV file, if `outputFormat` is set to `csv`. Defaults to the `,` (comma) character. Supported delimiter characters include comma (`,`), pipe (`|`), and tab (`\t`). 109 "dimensions": [ # A list of dimensions. https://docs.apigee.com/api-platform/analytics/analytics-reference#dimensions 110 "A String", 111 ], 112 "envgroupHostname": "A String", # Hostname needs to be specified if query intends to run at host level. This field is only allowed when query is submitted by CreateHostAsyncQuery where analytics data will be grouped by organization and hostname. 113 "filter": "A String", # Boolean expression that can be used to filter data. Filter expressions can be combined using AND/OR terms and should be fully parenthesized to avoid ambiguity. See Analytics metrics, dimensions, and filters reference https://docs.apigee.com/api-platform/analytics/analytics-reference for more information on the fields available to filter on. For more information on the tokens that you use to build filter expressions, see Filter expression syntax. https://docs.apigee.com/api-platform/analytics/asynch-reports-api#filter-expression-syntax 114 "groupByTimeUnit": "A String", # Time unit used to group the result set. Valid values include: second, minute, hour, day, week, or month. If a query includes groupByTimeUnit, then the result is an aggregation based on the specified time unit and the resultant timestamp does not include milliseconds precision. If a query omits groupByTimeUnit, then the resultant timestamp includes milliseconds precision. 115 "limit": 42, # Maximum number of rows that can be returned in the result. 116 "metrics": [ # A list of Metrics. 117 { # More info about Metric: https://docs.apigee.com/api-platform/analytics/analytics-reference#metrics 118 "alias": "A String", # Alias for the metric. Alias will be used to replace metric name in query results. 119 "function": "A String", # Aggregation function: avg, min, max, or sum. 120 "name": "A String", # Required. Metric name. 121 "operator": "A String", # One of `+`, `-`, `/`, `%`, `*`. 122 "value": "A String", # Operand value should be provided when operator is set. 123 }, 124 ], 125 "name": "A String", # Asynchronous Query Name. 126 "outputFormat": "A String", # Valid values include: `csv` or `json`. Defaults to `json`. Note: Configure the delimiter for CSV output using the csvDelimiter property. 127 "reportDefinitionId": "A String", # Asynchronous Report ID. 128 "timeRange": "", # Required. Time range for the query. Can use the following predefined strings to specify the time range: `last60minutes` `last24hours` `last7days` Or, specify the timeRange as a structure describing start and end timestamps in the ISO format: yyyy-mm-ddThh:mm:ssZ. Example: "timeRange": { "start": "2018-07-29T00:13:00Z", "end": "2018-08-01T00:18:00Z" } 129} 130 131 x__xgafv: string, V1 error format. 132 Allowed values 133 1 - v1 error format 134 2 - v2 error format 135 136Returns: 137 An object of the form: 138 139 { 140 "created": "A String", # Creation time of the query. 141 "envgroupHostname": "A String", # Hostname is available only when query is executed at host level. 142 "error": "A String", # Error is set when query fails. 143 "executionTime": "A String", # ExecutionTime is available only after the query is completed. 144 "name": "A String", # Asynchronous Query Name. 145 "queryParams": { # Contains information like metrics, dimenstions etc of the AsyncQuery. 146 "dimensions": [ # Dimensions of the AsyncQuery. 147 "A String", 148 ], 149 "endTimestamp": "A String", # End timestamp of the query range. 150 "metrics": [ # Metrics of the AsyncQuery. Example: ["name:message_count,func:sum,alias:sum_message_count"] 151 "A String", 152 ], 153 "outputFormat": "A String", # Output format. 154 "startTimestamp": "A String", # Start timestamp of the query range. 155 "timeUnit": "A String", # Query GroupBy time unit. 156 }, 157 "reportDefinitionId": "A String", # Asynchronous Report ID. 158 "result": { # Result is available only after the query is completed. 159 "expires": "A String", # Query result will be unaccessable after this time. 160 "self": "A String", # Self link of the query results. Example: `/organizations/myorg/environments/myenv/queries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd/result` or following format if query is running at host level: `/organizations/myorg/hostQueries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd/result` 161 }, 162 "resultFileSize": "A String", # ResultFileSize is available only after the query is completed. 163 "resultRows": "A String", # ResultRows is available only after the query is completed. 164 "self": "A String", # Self link of the query. Example: `/organizations/myorg/environments/myenv/queries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd` or following format if query is running at host level: `/organizations/myorg/hostQueries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd` 165 "state": "A String", # Query state could be "enqueued", "running", "completed", "failed". 166 "updated": "A String", # Last updated timestamp for the query. 167}</pre> 168</div> 169 170<div class="method"> 171 <code class="details" id="get">get(name, x__xgafv=None)</code> 172 <pre>Get query status If the query is still in progress, the `state` is set to "running" After the query has completed successfully, `state` is set to "completed" 173 174Args: 175 name: string, Required. Name of the asynchronous query to get. Must be of the form `organizations/{org}/environments/{env}/queries/{queryId}`. (required) 176 x__xgafv: string, V1 error format. 177 Allowed values 178 1 - v1 error format 179 2 - v2 error format 180 181Returns: 182 An object of the form: 183 184 { 185 "created": "A String", # Creation time of the query. 186 "envgroupHostname": "A String", # Hostname is available only when query is executed at host level. 187 "error": "A String", # Error is set when query fails. 188 "executionTime": "A String", # ExecutionTime is available only after the query is completed. 189 "name": "A String", # Asynchronous Query Name. 190 "queryParams": { # Contains information like metrics, dimenstions etc of the AsyncQuery. 191 "dimensions": [ # Dimensions of the AsyncQuery. 192 "A String", 193 ], 194 "endTimestamp": "A String", # End timestamp of the query range. 195 "metrics": [ # Metrics of the AsyncQuery. Example: ["name:message_count,func:sum,alias:sum_message_count"] 196 "A String", 197 ], 198 "outputFormat": "A String", # Output format. 199 "startTimestamp": "A String", # Start timestamp of the query range. 200 "timeUnit": "A String", # Query GroupBy time unit. 201 }, 202 "reportDefinitionId": "A String", # Asynchronous Report ID. 203 "result": { # Result is available only after the query is completed. 204 "expires": "A String", # Query result will be unaccessable after this time. 205 "self": "A String", # Self link of the query results. Example: `/organizations/myorg/environments/myenv/queries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd/result` or following format if query is running at host level: `/organizations/myorg/hostQueries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd/result` 206 }, 207 "resultFileSize": "A String", # ResultFileSize is available only after the query is completed. 208 "resultRows": "A String", # ResultRows is available only after the query is completed. 209 "self": "A String", # Self link of the query. Example: `/organizations/myorg/environments/myenv/queries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd` or following format if query is running at host level: `/organizations/myorg/hostQueries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd` 210 "state": "A String", # Query state could be "enqueued", "running", "completed", "failed". 211 "updated": "A String", # Last updated timestamp for the query. 212}</pre> 213</div> 214 215<div class="method"> 216 <code class="details" id="getResult">getResult(name, x__xgafv=None)</code> 217 <pre>After the query is completed, use this API to retrieve the results. If the request succeeds, and there is a non-zero result set, the result is downloaded to the client as a zipped JSON file. The name of the downloaded file will be: OfflineQueryResult-.zip Example: `OfflineQueryResult-9cfc0d85-0f30-46d6-ae6f-318d0cb961bd.zip` 218 219Args: 220 name: string, Required. Name of the asynchronous query result to get. Must be of the form `organizations/{org}/environments/{env}/queries/{queryId}/result`. (required) 221 x__xgafv: string, V1 error format. 222 Allowed values 223 1 - v1 error format 224 2 - v2 error format 225 226Returns: 227 An object of the form: 228 229 { # Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged. 230 "contentType": "A String", # The HTTP Content-Type header value specifying the content type of the body. 231 "data": "A String", # The HTTP request/response body as raw binary. 232 "extensions": [ # Application specific response metadata. Must be set in the first response for streaming APIs. 233 { 234 "a_key": "", # Properties of the object. Contains field @type with type URL. 235 }, 236 ], 237}</pre> 238</div> 239 240<div class="method"> 241 <code class="details" id="list">list(parent, dataset=None, from=None, inclQueriesWithoutReport=None, status=None, submittedBy=None, to=None, x__xgafv=None)</code> 242 <pre>Return a list of Asynchronous Queries 243 244Args: 245 parent: string, Required. The parent resource name. Must be of the form `organizations/{org}/environments/{env}`. (required) 246 dataset: string, Filter response list by dataset. Example: `api`, `mint` 247 from: string, Filter response list by returning asynchronous queries that created after this date time. Time must be in ISO date-time format like '2011-12-03T10:15:30Z'. 248 inclQueriesWithoutReport: string, Flag to include asynchronous queries that don't have a report denifition. 249 status: string, Filter response list by asynchronous query status. 250 submittedBy: string, Filter response list by user who submitted queries. 251 to: string, Filter response list by returning asynchronous queries that created before this date time. Time must be in ISO date-time format like '2011-12-03T10:16:30Z'. 252 x__xgafv: string, V1 error format. 253 Allowed values 254 1 - v1 error format 255 2 - v2 error format 256 257Returns: 258 An object of the form: 259 260 { # The response for ListAsyncQueries. 261 "queries": [ # The asynchronous queries belong to requested resource name. 262 { 263 "created": "A String", # Creation time of the query. 264 "envgroupHostname": "A String", # Hostname is available only when query is executed at host level. 265 "error": "A String", # Error is set when query fails. 266 "executionTime": "A String", # ExecutionTime is available only after the query is completed. 267 "name": "A String", # Asynchronous Query Name. 268 "queryParams": { # Contains information like metrics, dimenstions etc of the AsyncQuery. 269 "dimensions": [ # Dimensions of the AsyncQuery. 270 "A String", 271 ], 272 "endTimestamp": "A String", # End timestamp of the query range. 273 "metrics": [ # Metrics of the AsyncQuery. Example: ["name:message_count,func:sum,alias:sum_message_count"] 274 "A String", 275 ], 276 "outputFormat": "A String", # Output format. 277 "startTimestamp": "A String", # Start timestamp of the query range. 278 "timeUnit": "A String", # Query GroupBy time unit. 279 }, 280 "reportDefinitionId": "A String", # Asynchronous Report ID. 281 "result": { # Result is available only after the query is completed. 282 "expires": "A String", # Query result will be unaccessable after this time. 283 "self": "A String", # Self link of the query results. Example: `/organizations/myorg/environments/myenv/queries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd/result` or following format if query is running at host level: `/organizations/myorg/hostQueries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd/result` 284 }, 285 "resultFileSize": "A String", # ResultFileSize is available only after the query is completed. 286 "resultRows": "A String", # ResultRows is available only after the query is completed. 287 "self": "A String", # Self link of the query. Example: `/organizations/myorg/environments/myenv/queries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd` or following format if query is running at host level: `/organizations/myorg/hostQueries/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd` 288 "state": "A String", # Query state could be "enqueued", "running", "completed", "failed". 289 "updated": "A String", # Last updated timestamp for the query. 290 }, 291 ], 292}</pre> 293</div> 294 295</body></html>