listCommandInvocations method

Future<ListCommandInvocationsResult> listCommandInvocations({
  1. String? commandId,
  2. bool? details,
  3. List<CommandFilter>? filters,
  4. String? instanceId,
  5. int? maxResults,
  6. String? nextToken,
})

An invocation is copy of a command sent to a specific managed node. A command can apply to one or more managed nodes. A command invocation applies to one managed node. For example, if a user runs SendCommand against three managed nodes, then a command invocation is created for each requested managed node ID. ListCommandInvocations provide status about command execution.

May throw InternalServerError. May throw InvalidCommandId. May throw InvalidFilterKey. May throw InvalidInstanceId. May throw InvalidNextToken.

Parameter commandId : (Optional) The invocations for a specific command ID.

Parameter details : (Optional) If set this returns the response of the command executions and any command output. The default value is false.

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

Parameter instanceId : (Optional) The command execution details for a specific managed node ID.

Parameter maxResults : (Optional) 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 : (Optional) The token for the next set of items to return. (You received this token from a previous call.)

Implementation

Future<ListCommandInvocationsResult> listCommandInvocations({
  String? commandId,
  bool? details,
  List<CommandFilter>? filters,
  String? instanceId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.ListCommandInvocations'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (commandId != null) 'CommandId': commandId,
      if (details != null) 'Details': details,
      if (filters != null) 'Filters': filters,
      if (instanceId != null) 'InstanceId': instanceId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListCommandInvocationsResult.fromJson(jsonResponse.body);
}