updateMonitor method

Future<UpdateMonitorOutput> updateMonitor({
  1. required String monitorName,
  2. String? clientToken,
  3. List<MonitorLocalResource>? localResourcesToAdd,
  4. List<MonitorLocalResource>? localResourcesToRemove,
  5. List<MonitorRemoteResource>? remoteResourcesToAdd,
  6. List<MonitorRemoteResource>? remoteResourcesToRemove,
})

Update a monitor to add or remove local or remote resources.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter monitorName : The name of the monitor.

Parameter clientToken : A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don't reuse the same client token for other API requests.

Parameter localResourcesToAdd : Additional local resources to specify network flows for a monitor, as an array of resources with identifiers and types. A local resource in a workload is the location of hosts where the Network Flow Monitor agent is installed.

Parameter localResourcesToRemove : The local resources to remove, as an array of resources with identifiers and types.

Parameter remoteResourcesToAdd : The remote resources to add, as an array of resources with identifiers and types.

A remote resource is the other endpoint in the flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource.

Parameter remoteResourcesToRemove : The remote resources to remove, as an array of resources with identifiers and types.

A remote resource is the other endpoint specified for the network flow of a workload, with a local resource. For example, Amazon Dynamo DB can be a remote resource.

Implementation

Future<UpdateMonitorOutput> updateMonitor({
  required String monitorName,
  String? clientToken,
  List<MonitorLocalResource>? localResourcesToAdd,
  List<MonitorLocalResource>? localResourcesToRemove,
  List<MonitorRemoteResource>? remoteResourcesToAdd,
  List<MonitorRemoteResource>? remoteResourcesToRemove,
}) async {
  final $payload = <String, dynamic>{
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (localResourcesToAdd != null)
      'localResourcesToAdd': localResourcesToAdd,
    if (localResourcesToRemove != null)
      'localResourcesToRemove': localResourcesToRemove,
    if (remoteResourcesToAdd != null)
      'remoteResourcesToAdd': remoteResourcesToAdd,
    if (remoteResourcesToRemove != null)
      'remoteResourcesToRemove': remoteResourcesToRemove,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/monitors/${Uri.encodeComponent(monitorName)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateMonitorOutput.fromJson(response);
}