getDataset method
Returns information about the specified dataset. This includes its identifier, Amazon Resource Name (ARN), and any customer managed Amazon Web Services Key Management Service (Amazon Web Services KMS) key that is currently associated with it.
Only the default dataset is supported. The
default dataset is implicit for every account in every Region
— you can call GetDataset for it without first creating it.
If no customer managed KMS key has been associated with the dataset, the
response omits the KmsKeyArn field, indicating that data is
encrypted at rest using an Amazon Web Services owned key managed by Amazon
CloudWatch.
To associate a customer managed KMS key with a dataset, use AssociateDatasetKmsKey. To remove the association, use DisassociateDatasetKmsKey.
May throw ResourceNotFoundException.
Parameter datasetIdentifier :
Specifies the identifier of the dataset to retrieve. For the
default dataset, you can specify either default
or the full dataset Amazon Resource Name (ARN) in the format
arn:aws:cloudwatch:Region:account-id:dataset/default.
Implementation
Future<GetDatasetOutput> getDataset({
required String datasetIdentifier,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'GraniteServiceVersion20100801.GetDataset'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DatasetIdentifier': datasetIdentifier,
},
);
return GetDatasetOutput.fromJson(jsonResponse.body);
}