describeAssociation method

Future<DescribeAssociationResult> describeAssociation({
  1. String? associationId,
  2. String? associationVersion,
  3. String? instanceId,
  4. String? name,
})

Describes the association for the specified target or managed node. If you created the association by using the Targets parameter, then you must retrieve the association by using the association ID.

May throw AssociationDoesNotExist. May throw InternalServerError. May throw InvalidAssociationVersion. May throw InvalidDocument. May throw InvalidInstanceId.

Parameter associationId : The association ID for which you want information.

Parameter associationVersion : Specify the association version to retrieve. To view the latest version, either specify $LATEST for this parameter, or omit this parameter. To view a list of all associations for a managed node, use ListAssociations. To get a list of versions for a specific association, use ListAssociationVersions.

Parameter instanceId : The managed node ID.

Parameter name : The name of the SSM document.

Implementation

Future<DescribeAssociationResult> describeAssociation({
  String? associationId,
  String? associationVersion,
  String? instanceId,
  String? name,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DescribeAssociation'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (associationId != null) 'AssociationId': associationId,
      if (associationVersion != null)
        'AssociationVersion': associationVersion,
      if (instanceId != null) 'InstanceId': instanceId,
      if (name != null) 'Name': name,
    },
  );

  return DescribeAssociationResult.fromJson(jsonResponse.body);
}