list method

Future<ListHotTabletsResponse> list(
  1. String parent, {
  2. String? endTime,
  3. int? pageSize,
  4. String? pageToken,
  5. String? startTime,
  6. String? $fields,
})

Lists hot tablets in a cluster, within the time range provided.

Hot tablets are ordered based on CPU usage.

Request parameters:

parent - Required. The cluster name to list hot tablets. Value is in the following form: projects/{project}/instances/{instance}/clusters/{cluster}. Value must have pattern ^projects/\[^/\]+/instances/\[^/\]+/clusters/\[^/\]+$.

endTime - The end time to list hot tablets.

pageSize - Maximum number of results per page. A page_size that is empty or zero lets the server choose the number of items to return. A page_size which is strictly positive will return at most that many items. A negative page_size will cause an error. Following the first request, subsequent paginated calls do not need a page_size field. If a page_size is set in subsequent calls, it must match the page_size given in the first request.

pageToken - The value of next_page_token returned by a previous call.

startTime - The start time to list hot tablets. The hot tablets in the response will have start times between the requested start time and end time. Start time defaults to Now if it is unset, and end time defaults to Now - 24 hours if it is unset. The start time should be less than the end time, and the maximum allowed time range between start time and end time is 48 hours. Start time and end time should have values between Now and Now - 14 days.

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

Completes with a ListHotTabletsResponse.

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<ListHotTabletsResponse> list(
  core.String parent, {
  core.String? endTime,
  core.int? pageSize,
  core.String? pageToken,
  core.String? startTime,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (endTime != null) 'endTime': [endTime],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (startTime != null) 'startTime': [startTime],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v2/' + core.Uri.encodeFull('$parent') + '/hotTablets';

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