describeCommands method
Describes the results of specified commands. Required Permissions: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information about user permissions, see Managing User Permissions.
May throw ValidationException. May throw ResourceNotFoundException.
Parameter commandIds
:
An array of command IDs. If you include this parameter,
DescribeCommands
returns a description of the specified
commands. Otherwise, it returns a description of every command.
Parameter deploymentId
:
The deployment ID. If you include this parameter,
DescribeCommands
returns a description of the commands
associated with the specified deployment.
Parameter instanceId
:
The instance ID. If you include this parameter,
DescribeCommands
returns a description of the commands
associated with the specified instance.
Implementation
Future<DescribeCommandsResult> describeCommands({
List<String>? commandIds,
String? deploymentId,
String? instanceId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'OpsWorks_20130218.DescribeCommands'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (commandIds != null) 'CommandIds': commandIds,
if (deploymentId != null) 'DeploymentId': deploymentId,
if (instanceId != null) 'InstanceId': instanceId,
},
);
return DescribeCommandsResult.fromJson(jsonResponse.body);
}