describeInstancePatches method

Future<DescribeInstancePatchesResult> describeInstancePatches({
  1. required String instanceId,
  2. List<PatchOrchestratorFilter>? filters,
  3. int? maxResults,
  4. String? nextToken,
})

Retrieves information about the patches on the specified managed node and their state relative to the patch baseline being used for the node.

May throw InternalServerError. May throw InvalidFilter. May throw InvalidInstanceId. May throw InvalidNextToken.

Parameter instanceId : The ID of the managed node whose patch state information should be retrieved.

Parameter filters : Each element in the array is a structure containing a key-value pair.

Supported keys for DescribeInstancePatchesinclude the following:

  • Classification

    Sample values: Security | SecurityUpdates

  • KBId

    Sample values: KB4480056 | java-1.7.0-openjdk.x86_64

  • Severity

    Sample values: Important | Medium | Low

  • State

    Sample values: Installed | InstalledOther | InstalledPendingReboot

    For lists of all State values, see Patch compliance state values in the Amazon Web Services Systems Manager User Guide.

Parameter maxResults : The maximum number of patches to return (per page).

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Implementation

Future<DescribeInstancePatchesResult> describeInstancePatches({
  required String instanceId,
  List<PatchOrchestratorFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    10,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DescribeInstancePatches'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InstanceId': instanceId,
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeInstancePatchesResult.fromJson(jsonResponse.body);
}