listAvailableResourceDimensions method

Future<ListAvailableResourceDimensionsResponse> listAvailableResourceDimensions({
  1. required String identifier,
  2. required List<String> metrics,
  3. required ServiceType serviceType,
  4. List<FineGrainedAction>? authorizedActions,
  5. int? maxResults,
  6. String? nextToken,
})

Retrieve the dimensions that can be queried for each specified metric type on a specified DB instance.

May throw InternalServiceError. May throw InvalidArgumentException. May throw NotAuthorizedException.

Parameter identifier : An immutable identifier for a data source that is unique within an Amazon Web Services Region. Performance Insights gathers metrics from this data source. To use an Amazon RDS DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VWZ.

Parameter metrics : The types of metrics for which to retrieve dimensions. Valid values include db.load.

Parameter serviceType : The Amazon Web Services service for which Performance Insights returns metrics.

Parameter authorizedActions : The actions to discover the dimensions you are authorized to access. If you specify multiple actions, then the response will contain the dimensions common for all the actions.

When you don't specify this request parameter or provide an empty list, the response contains all the available dimensions for the target database engine whether or not you are authorized to access them.

Parameter maxResults : The maximum number of items to return in the response. If more items exist than the specified MaxRecords value, a pagination token is included in the response so that the remaining results can be retrieved.

Parameter nextToken : An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxRecords.

Implementation

Future<ListAvailableResourceDimensionsResponse>
    listAvailableResourceDimensions({
  required String identifier,
  required List<String> metrics,
  required ServiceType serviceType,
  List<FineGrainedAction>? authorizedActions,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    25,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'PerformanceInsightsv20180227.ListAvailableResourceDimensions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Identifier': identifier,
      'Metrics': metrics,
      'ServiceType': serviceType.value,
      if (authorizedActions != null)
        'AuthorizedActions': authorizedActions.map((e) => e.value).toList(),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListAvailableResourceDimensionsResponse.fromJson(jsonResponse.body);
}