list method

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

List the ServiceLevelObjectives for the given Service.

Request parameters:

parent - Required. Resource name of the parent containing the listed SLOs, either a project or a Monitoring Metrics Scope. The formats are: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- Value must have pattern ^\[^/\]+/\[^/\]+/services/\[^/\]+$.

filter - A filter specifying what ServiceLevelObjectives to return.

pageSize - A non-negative number that is the maximum number of results to return. When 0, use default page size.

pageToken - If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.

view - View of the ServiceLevelObjectives to return. If DEFAULT, return each ServiceLevelObjective as originally defined. If EXPLICIT and the ServiceLevelObjective is defined in terms of a BasicSli, replace the BasicSli with a RequestBasedSli spelling out how the SLI is computed. Possible string values are:

  • "VIEW_UNSPECIFIED" : Same as FULL.
  • "FULL" : Return the embedded ServiceLevelIndicator in the form in which it was defined. If it was defined using a BasicSli, return that BasicSli.
  • "EXPLICIT" : For ServiceLevelIndicators using BasicSli articulation, instead return the ServiceLevelIndicator with its mode of computation fully spelled out as a RequestBasedSli. For ServiceLevelIndicators using RequestBasedSli or WindowsBasedSli, return the ServiceLevelIndicator as it was provided.

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

Completes with a ListServiceLevelObjectivesResponse.

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

  final url_ =
      'v3/' + core.Uri.encodeFull('$parent') + '/serviceLevelObjectives';

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