Skip to content

delete_deployment async

delete_deployment(
    deployment_id: NonEmptyString,
    *,
    config_overrides: Optional[AsyncGreengrassV2ClientConfig] = None,
) -> None

Deletes a deployment. To delete an active deployment, you must first cancel it. For more information, see CancelDeployment.

Deleting a deployment doesn't affect core devices that run that deployment, because core devices store the deployment's configuration on the device. Additionally, core devices can roll back to a previous deployment that has been deleted.

Parameters:

Raises:

  • AccessDeniedException –

    You don't have permission to perform the action.

  • ConflictException –

    Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.

  • InternalServerException –

    IoT Greengrass can't process your request right now. Try again later.

  • ResourceNotFoundException –

    The requested resource can't be found.

  • ThrottlingException –

    Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

  • ValidationException –

    The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_greengrassv2/_services/async_greengrass_v2.py
async def delete_deployment(
    self,
    deployment_id: "capo_greengrassv2.types.non_empty_string.NonEmptyString",
    *,
    config_overrides: Optional[AsyncGreengrassV2ClientConfig] = None,
) -> None:
    """<p>Deletes a deployment. To delete an active deployment, you must first cancel it. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_CancelDeployment.html">CancelDeployment</a>.</p> <p>Deleting a deployment doesn't affect core devices that run that deployment, because core devices store the deployment's configuration on the device. Additionally, core devices can roll back to a previous deployment that has been deleted.</p>

    Args:
        deployment_id: <p>The ID of the deployment.</p>

    Raises:
        capo_greengrassv2.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action.</p>
        capo_greengrassv2.errors.conflict_exception.ConflictException: <p>Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.</p>
        capo_greengrassv2.errors.internal_server_exception.InternalServerException: <p>IoT Greengrass can't process your request right now. Try again later.</p>
        capo_greengrassv2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_greengrassv2.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.</p>
        capo_greengrassv2.errors.validation_exception.ValidationException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.</p>
        capo_greengrassv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_greengrassv2.types.delete_deployment_request.DeleteDeploymentRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_greengrassv2._operations.greengrass_v2.delete_deployment

        (
            output,
            http_response,
        ) = await capo_greengrassv2._operations.greengrass_v2.delete_deployment.async_delete_deployment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteDeployment")
    )
    input_: capo_greengrassv2.types.delete_deployment_request.DeleteDeploymentRequest = {
        "deployment_id": deployment_id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output