listNodes method

Future<ListNodesResult> listNodes({
  1. List<NodeFilter>? filters,
  2. int? maxResults,
  3. String? nextToken,
  4. String? syncName,
})

Takes in filters and returns a list of managed nodes matching the filter criteria.

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

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

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.)

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<ListNodesResult> listNodes({
  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.ListNodes'
  };
  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,
      if (syncName != null) 'SyncName': syncName,
    },
  );

  return ListNodesResult.fromJson(jsonResponse.body);
}