deregisterManagedInstance method

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

Removes the server or virtual machine from the list of registered servers. You can reregister the instance again at any time. If you don't plan to use Run Command on the server, we suggest uninstalling SSM Agent first.

May throw InvalidInstanceId. May throw InternalServerError.

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

Implementation

Future<void> deregisterManagedInstance({
  required String instanceId,
}) async {
  ArgumentError.checkNotNull(instanceId, 'instanceId');
  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,
    },
  );
}