listNodesSummary method

Future<ListNodesSummaryResult> listNodesSummary({
  1. required List<NodeAggregator> aggregators,
  2. List<NodeFilter>? filters,
  3. int? maxResults,
  4. String? nextToken,
  5. String? syncName,
})

Generates a summary of managed instance/node metadata based on the filters and aggregators you specify. Results are grouped by the input aggregator you specify.

May throw InternalServerError. May throw InvalidAggregatorException. May throw InvalidFilter. May throw InvalidNextToken. May throw ResourceDataSyncNotFoundException. May throw UnsupportedOperationException.

Parameter aggregators : Specify one or more aggregators to return a count of managed nodes that match that expression. For example, a count of managed nodes by operating system.

Parameter filters : One or more filters. Use a filter to generate a summary that matches your specified filter criteria.

Parameter maxResults : The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.) The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter syncName : The name of the Amazon Web Services managed resource data sync to retrieve information about.

For cross-account/cross-Region configurations, this parameter is required, and the name of the supported resource data sync is AWS-QuickSetup-ManagedNode.

For single account/single-Region configurations, the parameter is not required.

Implementation

Future<ListNodesSummaryResult> listNodesSummary({
  required List<NodeAggregator> aggregators,
  List<NodeFilter>? filters,
  int? maxResults,
  String? nextToken,
  String? syncName,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.ListNodesSummary'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Aggregators': aggregators,
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (syncName != null) 'SyncName': syncName,
    },
  );

  return ListNodesSummaryResult.fromJson(jsonResponse.body);
}