updateProbe method

Future<UpdateProbeOutput> updateProbe({
  1. required String monitorName,
  2. required String probeId,
  3. String? destination,
  4. int? destinationPort,
  5. int? packetSize,
  6. Protocol? protocol,
  7. ProbeState? state,
})

Updates a monitor probe. This action requires both the monitorName and probeId parameters. Run ListMonitors to get a list of monitor names. Run GetMonitor to get a list of probes and probe IDs.

You can update the following para create a monitor with probes using this command. For each probe, you define the following:

  • state—The state of the probe.
  • destination— The target destination IP address for the probe.
  • destinationPort—Required only if the protocol is TCP.
  • protocol—The communication protocol between the source and destination. This will be either TCP or ICMP.
  • packetSize—The size of the packets. This must be a number between 56 and 8500.
  • (Optional) tags —Key-value pairs created and assigned to the probe.

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

Parameter monitorName : The name of the monitor that the probe was updated for.

Parameter probeId : The ID of the probe to update.

Parameter destination : The updated IP address for the probe destination. This must be either an IPv4 or IPv6 address.

Parameter destinationPort : The updated port for the probe destination. This is required only if the protocol is TCP and must be a number between 1 and 65536.

Parameter packetSize : he updated packets size for network traffic between the source and destination. This must be a number between 56 and 8500.

Parameter protocol : The updated network protocol for the destination. This can be either TCP or ICMP. If the protocol is TCP, then port is also required.

Parameter state : The state of the probe update.

Implementation

Future<UpdateProbeOutput> updateProbe({
  required String monitorName,
  required String probeId,
  String? destination,
  int? destinationPort,
  int? packetSize,
  Protocol? protocol,
  ProbeState? state,
}) async {
  _s.validateNumRange(
    'destinationPort',
    destinationPort,
    0,
    65536,
  );
  _s.validateNumRange(
    'packetSize',
    packetSize,
    56,
    8500,
  );
  final $payload = <String, dynamic>{
    if (destination != null) 'destination': destination,
    if (destinationPort != null) 'destinationPort': destinationPort,
    if (packetSize != null) 'packetSize': packetSize,
    if (protocol != null) 'protocol': protocol.value,
    if (state != null) 'state': state.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/monitors/${Uri.encodeComponent(monitorName)}/probes/${Uri.encodeComponent(probeId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateProbeOutput.fromJson(response);
}