deregisterManagedInstance method

Future<void> deregisterManagedInstance({
  1. required String instanceId,
})

Removes the server or virtual machine from the list of registered servers.

If you want to reregister an on-premises server, edge device, or VM, you must use a different Activation Code and Activation ID than used to register the machine previously. The Activation Code and Activation ID must not have already been used on the maximum number of activations specified when they were created. For more information, see Deregistering managed nodes in a hybrid and multicloud environment in the Amazon Web Services Systems Manager User Guide.

May throw InternalServerError. May throw InvalidInstanceId.

Parameter instanceId : The ID assigned to the managed node when you registered it using the activation process.

Implementation

Future<void> deregisterManagedInstance({
  required String instanceId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DeregisterManagedInstance'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InstanceId': instanceId,
    },
  );
}