listCommands method
Lists the commands requested by users of the AWS account.
May throw InternalServerError. May throw InvalidCommandId. May throw InvalidInstanceId. May throw InvalidFilterKey. May throw InvalidNextToken.
Parameter commandId
:
(Optional) If provided, lists only the specified command.
Parameter filters
:
(Optional) One or more filters. Use a filter to return a more specific
list of results.
Parameter instanceId
:
(Optional) Lists commands issued against this instance 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<ListCommandsResult> listCommands({
String? commandId,
List<CommandFilter>? filters,
String? instanceId,
int? maxResults,
String? nextToken,
}) async {
_s.validateStringLength(
'commandId',
commandId,
36,
36,
);
_s.validateNumRange(
'maxResults',
maxResults,
1,
50,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonSSM.ListCommands'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (commandId != null) 'CommandId': commandId,
if (filters != null) 'Filters': filters,
if (instanceId != null) 'InstanceId': instanceId,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListCommandsResult.fromJson(jsonResponse.body);
}