updateAssociationStatus method
Updates the status of the Amazon Web Services Systems Manager document (SSM document) associated with the specified managed node.
UpdateAssociationStatus is primarily used by the Amazon Web
Services Systems Manager Agent (SSM Agent) to report status updates about
your associations and is only used for associations created with the
InstanceId legacy parameter.
May throw AssociationDoesNotExist.
May throw InternalServerError.
May throw InvalidDocument.
May throw InvalidInstanceId.
May throw StatusUnchanged.
May throw TooManyUpdates.
Parameter associationStatus :
The association status.
Parameter instanceId :
The managed node ID.
Parameter name :
The name of the SSM document.
Implementation
Future<UpdateAssociationStatusResult> updateAssociationStatus({
required AssociationStatus associationStatus,
required String instanceId,
required String name,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonSSM.UpdateAssociationStatus'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AssociationStatus': associationStatus,
'InstanceId': instanceId,
'Name': name,
},
);
return UpdateAssociationStatusResult.fromJson(jsonResponse.body);
}