describePatchGroups method

Future<DescribePatchGroupsResult> describePatchGroups({
  1. List<PatchOrchestratorFilter>? filters,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all patch groups that have been registered with patch baselines.

May throw InternalServerError.

Parameter filters : One or more filters. Use a filter to return a more specific list of results.

For DescribePatchGroups,valid filter keys include the following:

  • NAME_PREFIX: The name of the patch group. Wildcards (*) are accepted.
  • OPERATING_SYSTEM: The supported operating system type to return results for. For valid operating system values, see GetDefaultPatchBaselineRequest$OperatingSystem in CreatePatchBaseline.

    Examples:

    • --filters Key=NAME_PREFIX,Values=MyPatchGroup*
    • --filters Key=OPERATING_SYSTEM,Values=AMAZON_LINUX_2

Parameter maxResults : The maximum number of patch groups 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<DescribePatchGroupsResult> describePatchGroups({
  List<PatchOrchestratorFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DescribePatchGroups'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribePatchGroupsResult.fromJson(jsonResponse.body);
}