Delete an OTA update.
Requires permission to access the DeleteOTAUpdate action.
Parameters:
-
ota_update_id
(OTAUpdateId)
–
The ID of the OTA update to delete.
-
delete_stream
(Optional[DeleteStream_], default:
None
)
–
When true, the stream created by the OTAUpdate process is deleted when the OTA update is deleted. Ignored if the stream specified in the OTAUpdate is supplied by the user.
-
force_delete_aws_job
(Optional[ForceDeleteAWSJob], default:
None
)
–
When true, deletes the IoT job created by the OTAUpdate process even if it is "IN_PROGRESS". Otherwise, if the job is not in a terminal state ("COMPLETED" or "CANCELED") an exception will occur. The default is false.
Raises:
Source code in docs_src/capo_iot/_services/io_t.py
| def delete_ota_update(
self,
ota_update_id: "capo_iot.types.ota_update_id.OTAUpdateId",
*,
config_overrides: Optional[IoTClientConfig] = None,
delete_stream: Optional["capo_iot.types.delete_stream_.DeleteStream_"] = None,
force_delete_aws_job: Optional[
"capo_iot.types.force_delete_aws_job.ForceDeleteAWSJob"
] = None,
) -> "capo_iot.types.delete_ota_update_response.DeleteOTAUpdateResponse":
"""<p>Delete an OTA update.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">DeleteOTAUpdate</a> action.</p>
Args:
ota_update_id: <p>The ID of the OTA update to delete.</p>
delete_stream: <p>When true, the stream created by the OTAUpdate process is deleted when the OTA update is deleted. Ignored if the stream specified in the OTAUpdate is supplied by the user.</p>
force_delete_aws_job: <p>When true, deletes the IoT job created by the OTAUpdate process even if it is "IN_PROGRESS". Otherwise, if the job is not in a terminal state ("COMPLETED" or "CANCELED") an exception will occur. The default is false.</p>
Raises:
capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
capo_iot.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
capo_iot.errors.version_conflict_exception.VersionConflictException: <p>An exception thrown when the version of an entity specified with the <code>expectedVersion</code> parameter does not match the latest version in the system.</p>
capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iot.types.delete_ota_update_request.DeleteOTAUpdateRequest]",
) -> OperationResponse[
"capo_iot.types.delete_ota_update_response.DeleteOTAUpdateResponse"
]:
import capo_iot._operations.aws_iot_service.delete_ota_update
output, http_response = (
capo_iot._operations.aws_iot_service.delete_ota_update.delete_ota_update(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteOTAUpdate")
)
input_: capo_iot.types.delete_ota_update_request.DeleteOTAUpdateRequest = {
"ota_update_id": ota_update_id
}
if delete_stream is not None:
input_["delete_stream"] = delete_stream
if force_delete_aws_job is not None:
input_["force_delete_aws_job"] = force_delete_aws_job
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|