get method

Future<GoogleCloudApigeeV1OptimizedStats> get(
  1. String name, {
  2. String? accuracy,
  3. String? aggTable,
  4. String? filter,
  5. String? limit,
  6. String? offset,
  7. bool? realtime,
  8. String? select,
  9. bool? sonar,
  10. String? sort,
  11. String? sortby,
  12. String? timeRange,
  13. String? timeUnit,
  14. String? topk,
  15. bool? tsAscending,
  16. String? tzo,
  17. String? $fields,
})

Similar to GetStats except that the response is less verbose.

Request parameters:

name - Required. Resource name for which the interactive query will be executed. Use the following format in your request: organizations/{org}/environments/{env}/optimizedStats/{dimensions} Dimensions let you view metrics in meaningful groupings, such as apiproxy, target_host. The value of dimensions should be a comma-separated list as shown below: organizations/{org}/environments/{env}/optimizedStats/apiproxy,request_verb Value must have pattern ^organizations/\[^/\]+/environments/\[^/\]+/optimizedStats/.*$.

accuracy - No longer used by Apigee. Supported for backwards compatibility.

aggTable - 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 - Filter that enables you to drill-down on specific dimension values.

limit - Maximum number of result items to return. The default and maximum value that can be returned is 14400.

offset - 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 - No longer used by Apigee. Supported for backwards compatibility.

select - Required. Comma-separated list of metrics. For example: sum(message_count),sum(error_count)

sonar - Routes the query to API Monitoring for the last hour.

sort - Flag that specifies whether the sort order should be ascending or descending. Valid values include DESC and ASC.

sortby - Comma-separated list of columns to sort the final result.

timeRange - Required. 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 - Granularity of metrics returned. Valid values include: second, minute, hour, day, week, or month.

topk - Top number of results to return. For example, to return the top 5 results, set topk=5.

tsAscending - Flag that specifies whether to list timestamps in ascending (true) or descending (false) order. Apigee recommends setting this value to true if you are using sortby with sort=DESC.

tzo - Timezone offset value.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleCloudApigeeV1OptimizedStats.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<GoogleCloudApigeeV1OptimizedStats> get(
  core.String name, {
  core.String? accuracy,
  core.String? aggTable,
  core.String? filter,
  core.String? limit,
  core.String? offset,
  core.bool? realtime,
  core.String? select,
  core.bool? sonar,
  core.String? sort,
  core.String? sortby,
  core.String? timeRange,
  core.String? timeUnit,
  core.String? topk,
  core.bool? tsAscending,
  core.String? tzo,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (accuracy != null) 'accuracy': [accuracy],
    if (aggTable != null) 'aggTable': [aggTable],
    if (filter != null) 'filter': [filter],
    if (limit != null) 'limit': [limit],
    if (offset != null) 'offset': [offset],
    if (realtime != null) 'realtime': ['${realtime}'],
    if (select != null) 'select': [select],
    if (sonar != null) 'sonar': ['${sonar}'],
    if (sort != null) 'sort': [sort],
    if (sortby != null) 'sortby': [sortby],
    if (timeRange != null) 'timeRange': [timeRange],
    if (timeUnit != null) 'timeUnit': [timeUnit],
    if (topk != null) 'topk': [topk],
    if (tsAscending != null) 'tsAscending': ['${tsAscending}'],
    if (tzo != null) 'tzo': [tzo],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name');

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return GoogleCloudApigeeV1OptimizedStats.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}