listServiceLevelObjectives method

Future<ListServiceLevelObjectivesOutput> listServiceLevelObjectives({
  1. DependencyConfig? dependencyConfig,
  2. bool? includeLinkedAccounts,
  3. Map<String, String>? keyAttributes,
  4. int? maxResults,
  5. MetricSource? metricSource,
  6. List<MetricSourceType>? metricSourceTypes,
  7. String? nextToken,
  8. String? operationName,
  9. String? sloOwnerAwsAccountId,
})

Returns a list of SLOs created in this account.

May throw ThrottlingException. May throw ValidationException.

Parameter dependencyConfig : Identifies the dependency using the DependencyKeyAttributes and DependencyOperationName.

Parameter includeLinkedAccounts : If you are using this operation in a monitoring account, specify true to include SLO from source accounts in the returned data.

When you are monitoring an account, you can use Amazon Web Services account ID in KeyAttribute filter for service source account and SloOwnerawsaccountID for SLO source account with IncludeLinkedAccounts to filter the returned data to only a single source account.

Parameter keyAttributes : You can use this optional field to specify which services you want to retrieve SLO information for.

This is a string-to-string map. It can include the following fields.

  • Type designates the type of object this is.
  • ResourceType specifies the type of the resource. This field is used only when the value of the Type field is Resource or AWS::Resource.
  • Name specifies the name of the object. This is used only if the value of the Type field is Service, RemoteService, or AWS::Service.
  • Identifier identifies the resource objects of this resource. This is used only if the value of the Type field is Resource or AWS::Resource.
  • Environment specifies the location where this object is hosted, or what it belongs to.

Parameter maxResults : The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used.

Parameter metricSource : Identifies the metric source to filter SLOs by.

Parameter metricSourceTypes : Use this optional field to only include SLOs with the specified metric source types in the output. Supported types are:

  • Service operation
  • Service dependency
  • Service
  • CloudWatch metric
  • AppMonitor
  • Canary

Parameter nextToken : Include this value, if it was returned by the previous operation, to get the next set of service level objectives.

Parameter operationName : The name of the operation that this SLO is associated with.

Parameter sloOwnerAwsAccountId : SLO's Amazon Web Services account ID.

Implementation

Future<ListServiceLevelObjectivesOutput> listServiceLevelObjectives({
  DependencyConfig? dependencyConfig,
  bool? includeLinkedAccounts,
  Map<String, String>? keyAttributes,
  int? maxResults,
  MetricSource? metricSource,
  List<MetricSourceType>? metricSourceTypes,
  String? nextToken,
  String? operationName,
  String? sloOwnerAwsAccountId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (includeLinkedAccounts != null)
      'IncludeLinkedAccounts': [includeLinkedAccounts.toString()],
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
    if (operationName != null) 'OperationName': [operationName],
    if (sloOwnerAwsAccountId != null)
      'SloOwnerAwsAccountId': [sloOwnerAwsAccountId],
  };
  final $payload = <String, dynamic>{
    if (dependencyConfig != null) 'DependencyConfig': dependencyConfig,
    if (keyAttributes != null) 'KeyAttributes': keyAttributes,
    if (metricSource != null) 'MetricSource': metricSource,
    if (metricSourceTypes != null)
      'MetricSourceTypes': metricSourceTypes.map((e) => e.value).toList(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/slos',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListServiceLevelObjectivesOutput.fromJson(response);
}