Gets information about the specific command execution on a single device.
Parameters:
-
execution_id
(CommandExecutionId)
–
The unique identifier for the command execution. This information is returned as a response of the StartCommandExecution API request.
-
target_arn
(TargetArn)
–
The Amazon Resource Number (ARN) of the device on which the command execution is being performed.
-
include_result
(Optional[BooleanWrapperObject], default:
None
)
–
Can be used to specify whether to include the result of the command execution in the GetCommandExecution API response. Your device can use this field to provide additional information about the command execution. You only need to specify this field when using the AWS-IoT namespace.
Raises:
Source code in docs_src/capo_iot/_services/io_t.py
| def get_command_execution(
self,
execution_id: "capo_iot.types.command_execution_id.CommandExecutionId",
target_arn: "capo_iot.types.target_arn.TargetArn",
*,
config_overrides: Optional[IoTClientConfig] = None,
include_result: Optional[
"capo_iot.types.boolean_wrapper_object.BooleanWrapperObject"
] = None,
) -> "capo_iot.types.get_command_execution_response.GetCommandExecutionResponse":
"""<p>Gets information about the specific command execution on a single device.</p>
Args:
execution_id: <p>The unique identifier for the command execution. This information is returned as a response of the <code>StartCommandExecution</code> API request.</p>
target_arn: <p>The Amazon Resource Number (ARN) of the device on which the command execution is being performed.</p>
include_result: <p>Can be used to specify whether to include the result of the command execution in the <code>GetCommandExecution</code> API response. Your device can use this field to provide additional information about the command execution. You only need to specify this field when using the <code>AWS-IoT</code> namespace.</p>
Raises:
capo_iot.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
capo_iot.errors.validation_exception.ValidationException: <p>The request is not valid.</p>
capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iot.types.get_command_execution_request.GetCommandExecutionRequest]",
) -> OperationResponse[
"capo_iot.types.get_command_execution_response.GetCommandExecutionResponse"
]:
import capo_iot._operations.aws_iot_service.get_command_execution
output, http_response = (
capo_iot._operations.aws_iot_service.get_command_execution.get_command_execution(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetCommandExecution")
)
input_: capo_iot.types.get_command_execution_request.GetCommandExecutionRequest = {
"execution_id": execution_id,
"target_arn": target_arn,
}
if include_result is not None:
input_["include_result"] = include_result
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|