getDeployablePatchSnapshotForInstance method
Retrieves the current snapshot for the patch baseline the instance uses. This API is primarily used by the AWS-RunPatchBaseline Systems Manager document.
May throw InternalServerError. May throw UnsupportedOperatingSystem. May throw UnsupportedFeatureRequiredException.
Parameter instanceId
:
The ID of the instance for which the appropriate patch snapshot should be
retrieved.
Parameter snapshotId
:
The user-defined snapshot ID.
Implementation
Future<GetDeployablePatchSnapshotForInstanceResult>
getDeployablePatchSnapshotForInstance({
required String instanceId,
required String snapshotId,
}) async {
ArgumentError.checkNotNull(instanceId, 'instanceId');
ArgumentError.checkNotNull(snapshotId, 'snapshotId');
_s.validateStringLength(
'snapshotId',
snapshotId,
36,
36,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonSSM.GetDeployablePatchSnapshotForInstance'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InstanceId': instanceId,
'SnapshotId': snapshotId,
},
);
return GetDeployablePatchSnapshotForInstanceResult.fromJson(
jsonResponse.body);
}