getTrailStatus method
Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.
May throw TrailNotFoundException. May throw InvalidTrailNameException. May throw UnsupportedOperationException. May throw OperationNotPermittedException.
Parameter name
:
Specifies the name or the CloudTrail ARN of the trail for which you are
requesting status. To get the status of a shadow trail (a replication of
the trail in another region), you must specify its ARN. The format of a
trail ARN is:
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
Implementation
Future<GetTrailStatusResponse> getTrailStatus({
required String name,
}) async {
ArgumentError.checkNotNull(name, 'name');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.GetTrailStatus'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Name': name,
},
);
return GetTrailStatusResponse.fromJson(jsonResponse.body);
}