getMonitor method
Gets information about a monitor in Amazon CloudWatch Internet Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time, modified time, resources included in the monitor, and status information.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
Parameter monitorName :
The name of the monitor.
Parameter linkedAccountId :
The account ID for an account that you've set up cross-account sharing for
in Amazon CloudWatch Internet Monitor. You configure cross-account sharing
by using Amazon CloudWatch Observability Access Manager. For more
information, see Internet
Monitor cross-account observability in the Amazon CloudWatch Internet
Monitor User Guide.
Implementation
Future<GetMonitorOutput> getMonitor({
required String monitorName,
String? linkedAccountId,
}) async {
final $query = <String, List<String>>{
if (linkedAccountId != null) 'LinkedAccountId': [linkedAccountId],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/v20210603/Monitors/${Uri.encodeComponent(monitorName)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return GetMonitorOutput.fromJson(response);
}