Skip to content

delete_environment_host async

delete_environment_host(
    environment_id: EnvironmentId,
    host_name: HostName,
    *,
    config_overrides: Optional[AsyncevsClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> DeleteEnvironmentHostResponse

Deletes a host from an Amazon EVS environment.

Before deleting a host, you must unassign and decommission the host from within the SDDC Manager user interface. Not doing so could impact the availability of your virtual machines or result in data loss.

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 host 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 for the host's environment.

  • host_name (HostName) –

    The DNS hostname associated with the host 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_host(
    self,
    environment_id: "capo_evs.types.environment_id.EnvironmentId",
    host_name: "capo_evs.types.host_name.HostName",
    *,
    config_overrides: Optional[AsyncevsClientConfig] = None,
    client_token: Optional["capo_evs.types.client_token.ClientToken"] = None,
) -> (
    "capo_evs.types.delete_environment_host_response.DeleteEnvironmentHostResponse"
):
    """<p>Deletes a host from an Amazon EVS environment.</p> <note> <p>Before deleting a host, you must unassign and decommission the host from within the SDDC Manager user interface. Not doing so could impact the availability of your virtual machines or result in data loss.</p> </note>

    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 host 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 for the host's environment.</p>
        host_name: <p>The DNS hostname associated with the host 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_host_request.DeleteEnvironmentHostRequest]",
    ) -> AsyncOperationResponse[
        "capo_evs.types.delete_environment_host_response.DeleteEnvironmentHostResponse"
    ]:
        import capo_evs._operations.amazon_elastic_v_mware_service.delete_environment_host

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteEnvironmentHost")
    )
    input_: capo_evs.types.delete_environment_host_request.DeleteEnvironmentHostRequest = {
        "environment_id": environment_id,
        "host_name": host_name,
    }
    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