Skip to content

delete_environment async

delete_environment(
    environment_id: Identifier,
    *,
    config_overrides: Optional[Asyncm2ClientConfig] = None,
) -> DeleteEnvironmentResponse

Deletes a specific runtime environment. The environment cannot contain deployed applications. If it does, you must delete those applications before you delete the environment.

Parameters:

  • environment_id (Identifier) –

    The unique identifier of the runtime environment you want to delete.

Raises:

Source code in docs_src/capo_m2/_services/async_m2.py
async def delete_environment(
    self,
    environment_id: "capo_m2.types.identifier.Identifier",
    *,
    config_overrides: Optional[Asyncm2ClientConfig] = None,
) -> "capo_m2.types.delete_environment_response.DeleteEnvironmentResponse":
    """<p>Deletes a specific runtime environment. The environment cannot contain deployed applications. If it does, you must delete those applications before you delete the environment.</p>

    Args:
        environment_id: <p>The unique identifier of the runtime environment you want to delete.</p>

    Raises:
        capo_m2.errors.access_denied_exception.AccessDeniedException: <p>The account or role doesn't have the right permissions to make the request.</p>
        capo_m2.errors.conflict_exception.ConflictException: <p>The parameters provided in the request conflict with existing resources.</p>
        capo_m2.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_m2.errors.throttling_exception.ThrottlingException: <p>The number of requests made exceeds the limit.</p>
        capo_m2.errors.validation_exception.ValidationException: <p>One or more parameters provided in the request is not valid.</p>
        capo_m2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_m2.types.delete_environment_request.DeleteEnvironmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_m2.types.delete_environment_response.DeleteEnvironmentResponse"
    ]:
        import capo_m2._operations.aws_supernova_control_plane_service.delete_environment

        (
            output,
            http_response,
        ) = await capo_m2._operations.aws_supernova_control_plane_service.delete_environment.async_delete_environment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteEnvironment")
    )
    input_: capo_m2.types.delete_environment_request.DeleteEnvironmentRequest = {
        "environment_id": environment_id
    }

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