Skip to content

delete_environment async

delete_environment(
    environment_id: EnvironmentId,
    *,
    config_overrides: Optional[AsyncevsClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> DeleteEnvironmentResponse

Deletes an Amazon EVS environment.

Amazon EVS environments will only be enabled for deletion once the hosts are deleted. You can delete hosts using the DeleteEnvironmentHost action.

Environment deletion also deletes the associated Amazon EVS VLAN subnets and Amazon Web Services Secrets Manager secrets that Amazon EVS created. Amazon Web Services resources that you create are not deleted. These resources may continue to incur costs.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

    This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the environment deletion request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.

  • environment_id (EnvironmentId) –

    A unique ID associated with the environment to be deleted.

Raises:

  • ResourceNotFoundException –

    A service resource associated with the request could not be found. The resource might not be specified correctly, or it may have a state of DELETED.

  • ValidationException –

    The input fails to satisfy the specified constraints. You will see this exception if invalid inputs are provided for any of the Amazon EVS environment operations, or if a list operation is performed on an environment resource that is still initializing.

  • UnknownServiceError –

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

Source code in docs_src/capo_evs/_services/async_evs.py
async def delete_environment(
    self,
    environment_id: "capo_evs.types.environment_id.EnvironmentId",
    *,
    config_overrides: Optional[AsyncevsClientConfig] = None,
    client_token: Optional["capo_evs.types.client_token.ClientToken"] = None,
) -> "capo_evs.types.delete_environment_response.DeleteEnvironmentResponse":
    """<p>Deletes an Amazon EVS environment.</p> <p>Amazon EVS environments will only be enabled for deletion once the hosts are deleted. You can delete hosts using the <code>DeleteEnvironmentHost</code> action.</p> <p>Environment deletion also deletes the associated Amazon EVS VLAN subnets and Amazon Web Services Secrets Manager secrets that Amazon EVS created. Amazon Web Services resources that you create are not deleted. These resources may continue to incur costs.</p>

    Args:
        client_token: <note> <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p> </note> <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the environment deletion request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
        environment_id: <p>A unique ID associated with the environment to be deleted.</p>

    Raises:
        capo_evs.errors.resource_not_found_exception.ResourceNotFoundException: <p>A service resource associated with the request could not be found. The resource might not be specified correctly, or it may have a <code>state</code> of <code>DELETED</code>.</p>
        capo_evs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints. You will see this exception if invalid inputs are provided for any of the Amazon EVS environment operations, or if a list operation is performed on an environment resource that is still initializing.</p>
        capo_evs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

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

    def _redact_output(
        output: "capo_evs.types.delete_environment_response.DeleteEnvironmentResponse",
    ) -> dict[str, Any]:
        import capo_evs.types.delete_environment_response

        return capo_evs.types.delete_environment_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DeleteEnvironment", redact_output=_redact_output),
    )
    input_: capo_evs.types.delete_environment_request.DeleteEnvironmentRequest = {
        "environment_id": environment_id
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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