Close httplib2 connections.
Retrieve metrics grouped by dimensions. The types of metrics you can retrieve include traffic, message counts, API call latency, response size, and cache hits and counts. Dimensions let you view metrics in meaningful groups. You can optionally pass dimensions as path parameters to the `stats` API. If dimensions are not specified, the metrics are computed on the entire set of data for the given time range.
close()
Close httplib2 connections.
get(name, accuracy=None, aggTable=None, filter=None, limit=None, offset=None, realtime=None, select=None, sonar=None, sort=None, sortby=None, timeRange=None, timeUnit=None, topk=None, tsAscending=None, tzo=None, x__xgafv=None)
Retrieve metrics grouped by dimensions. The types of metrics you can retrieve include traffic, message counts, API call latency, response size, and cache hits and counts. Dimensions let you view metrics in meaningful groups. You can optionally pass dimensions as path parameters to the `stats` API. If dimensions are not specified, the metrics are computed on the entire set of data for the given time range. Args: name: string, Required. Resource name for which the interactive query will be executed. Use the following format in your request: `organizations/{org}/environments/{env}/stats/{dimensions}` Dimensions let you view metrics in meaningful groupings, such as `apiproxy` or `target_host`. The value of dimensions should be a comma-separated list, as shown below: `organizations/{org}/environments/{env}/stats/apiproxy,request_verb` (required) accuracy: string, No longer used by Apigee. Supported for backwards compatibility. aggTable: string, Table name used to query custom aggregate tables. If this parameter is skipped, then Apigee will try to retrieve the data from fact tables which will be expensive. filter: string, Filter that enables you to drill down on specific dimension values. limit: string, Maximum number of result items to return. The default and maximum value that can be returned is 14400. offset: string, Offset value. Use `offset` with `limit` to enable pagination of results. For example, to display results 11-20, set limit to `10` and offset to `10`. realtime: boolean, No longer used by Apigee. Supported for backwards compatibility. select: string, Comma-separated list of metrics. For example: `sum(message_count),sum(error_count)` sonar: boolean, Routes the query to API Monitoring for the last hour. sort: string, Flag that specifies whether the sort order should be ascending or descending. Valid values include: `DESC` and `ASC`. sortby: string, Comma-separated list of columns to sort the final result. timeRange: string, Time interval for the interactive query. Time range is specified in GMT as `start~end`. For example: `04/15/2017 00:00~05/15/2017 23:59` timeUnit: string, Granularity of metrics returned. Valid values include: `second`, `minute`, `hour`, `day`, `week`, or` month`. topk: string, Top number of results to return. For example, to return the top 5 results, set `topk=5`. tsAscending: boolean, Flag that specifies whether to list timestamps in ascending (`true`) or descending (`false`) order. Apigee recommends that you set this value to `true` if you are using `sortby` with `sort=DESC`. tzo: string, Timezone offset value. x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # Encapsulates a `stats` response. "environments": [ # List of query results on the environment level. { # Encapsulates the environment wrapper: ``` "environments": [ { "metrics": [ { "name": "sum(message_count)", "values": [ "2.52056245E8" ] } ], "name": "prod" } ]``` "dimensions": [ # List of metrics grouped under dimensions. { # Encapsulates a metric grouped by dimension. "metrics": [ # List of metrics. { # Encapsulates the metric data point. For example: ```{ "name": "sum(message_count)", "values" : [ { "timestamp": 1549004400000, "value": "39.0" }, { "timestamp" : 1548997200000, "value" : "0.0" } ] }``` or ```{ "name": "sum(message_count)", "values" : ["39.0"] }``` "name": "A String", # Metric name. "values": [ # List of metric values. Possible value formats include: `"values":["39.0"]` or `"values":[ { "value": "39.0", "timestamp": 1232434354} ]` "", ], }, ], "name": "A String", # Name of the dimension. }, ], "metrics": [ # In the final response, only one of the following fields will be present based on the dimensions provided. If no dimensions are provided, then only top-level metrics is provided. If dimensions are included, then there will be a top-level dimensions field under environments which will contain metrics values and the dimension name. Example: ``` "environments": [ { "dimensions": [ { "metrics": [ { "name": "sum(message_count)", "values": [ "2.14049521E8" ] } ], "name": "nit_proxy" } ], "name": "prod" } ]``` or ```"environments": [ { "metrics": [ { "name": "sum(message_count)", "values": [ "2.19026331E8" ] } ], "name": "prod" } ]``` List of metric values. { # Encapsulates the metric data point. For example: ```{ "name": "sum(message_count)", "values" : [ { "timestamp": 1549004400000, "value": "39.0" }, { "timestamp" : 1548997200000, "value" : "0.0" } ] }``` or ```{ "name": "sum(message_count)", "values" : ["39.0"] }``` "name": "A String", # Metric name. "values": [ # List of metric values. Possible value formats include: `"values":["39.0"]` or `"values":[ { "value": "39.0", "timestamp": 1232434354} ]` "", ], }, ], "name": "A String", # Name of the environment. }, ], "hosts": [ # List of query results grouped by host. { # Encapsulates the hostname wrapper: ``` "hosts": [ { "metrics": [ { "name": "sum(message_count)", "values": [ "2.52056245E8" ] } ], "name": "example.com" } ]``` "dimensions": [ # List of metrics grouped under dimensions. { # Encapsulates a metric grouped by dimension. "metrics": [ # List of metrics. { # Encapsulates the metric data point. For example: ```{ "name": "sum(message_count)", "values" : [ { "timestamp": 1549004400000, "value": "39.0" }, { "timestamp" : 1548997200000, "value" : "0.0" } ] }``` or ```{ "name": "sum(message_count)", "values" : ["39.0"] }``` "name": "A String", # Metric name. "values": [ # List of metric values. Possible value formats include: `"values":["39.0"]` or `"values":[ { "value": "39.0", "timestamp": 1232434354} ]` "", ], }, ], "name": "A String", # Name of the dimension. }, ], "metrics": [ # In the final response, only one of the following fields will be present based on the dimensions provided. If no dimensions are provided, then only the top-level metrics are provided. If dimensions are included, then there will be a top-level dimensions field under hostnames which will contain metrics values and the dimension name. Example: ``` "hosts": [ { "dimensions": [ { "metrics": [ { "name": "sum(message_count)", "values": [ "2.14049521E8" ] } ], "name": "nit_proxy" } ], "name": "example.com" } ]``` OR ```"hosts": [ { "metrics": [ { "name": "sum(message_count)", "values": [ "2.19026331E8" ] } ], "name": "example.com" } ]``` List of metric values. { # Encapsulates the metric data point. For example: ```{ "name": "sum(message_count)", "values" : [ { "timestamp": 1549004400000, "value": "39.0" }, { "timestamp" : 1548997200000, "value" : "0.0" } ] }``` or ```{ "name": "sum(message_count)", "values" : ["39.0"] }``` "name": "A String", # Metric name. "values": [ # List of metric values. Possible value formats include: `"values":["39.0"]` or `"values":[ { "value": "39.0", "timestamp": 1232434354} ]` "", ], }, ], "name": "A String", # Hostname used in query. }, ], "metaData": { # Encapsulates additional information about query execution. # Metadata information. "errors": [ # List of error messages as strings. "A String", ], "notices": [ # List of additional information such as data source, if result was truncated. For example: ``` "notices": [ "Source:Postgres", "PG Host:uappg0rw.e2e.apigeeks.net", "query served by:4b64601e-40de-4eb1-bfb9-eeee7ac929ed", "Table used: edge.api.uapgroup2.agg_api" ]``` "A String", ], }, }