getResourceMetadata method

Future<GetResourceMetadataResponse> getResourceMetadata({
  1. required String identifier,
  2. required ServiceType serviceType,
})

Retrieve the metadata for different features. For example, the metadata might indicate that a feature is turned on or off on a specific DB instance.

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

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

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

Implementation

Future<GetResourceMetadataResponse> getResourceMetadata({
  required String identifier,
  required ServiceType serviceType,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PerformanceInsightsv20180227.GetResourceMetadata'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Identifier': identifier,
      'ServiceType': serviceType.value,
    },
  );

  return GetResourceMetadataResponse.fromJson(jsonResponse.body);
}