Skip to content

delete_host async

delete_host(
    host_arn: HostArn,
    *,
    config_overrides: Optional[AsyncCodeConnectionsClientConfig] = None,
) -> DeleteHostOutput

The host to be deleted. Before you delete a host, all connections associated to the host must be deleted.

A host cannot be deleted if it is in the VPC_CONFIG_INITIALIZING or VPC_CONFIG_DELETING state.

Parameters:

  • host_arn (HostArn) –

    The Amazon Resource Name (ARN) of the host to be deleted.

Raises:

Source code in docs_src/capo_codeconnections/_services/async_code_connections.py
async def delete_host(
    self,
    host_arn: "capo_codeconnections.types.host_arn.HostArn",
    *,
    config_overrides: Optional[AsyncCodeConnectionsClientConfig] = None,
) -> "capo_codeconnections.types.delete_host_output.DeleteHostOutput":
    """<p>The host to be deleted. Before you delete a host, all connections associated to the host must be deleted.</p> <note> <p>A host cannot be deleted if it is in the VPC_CONFIG_INITIALIZING or VPC_CONFIG_DELETING state.</p> </note>

    Args:
        host_arn: <p>The Amazon Resource Name (ARN) of the host to be deleted.</p>

    Raises:
        capo_codeconnections.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found. Verify the connection resource ARN and try again.</p>
        capo_codeconnections.errors.resource_unavailable_exception.ResourceUnavailableException: <p>Resource not found. Verify the ARN for the host resource and try again.</p>
        capo_codeconnections.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codeconnections.types.delete_host_input.DeleteHostInput]",
    ) -> AsyncOperationResponse[
        "capo_codeconnections.types.delete_host_output.DeleteHostOutput"
    ]:
        import capo_codeconnections._operations.code_connections_20231201.delete_host

        (
            output,
            http_response,
        ) = await capo_codeconnections._operations.code_connections_20231201.delete_host.async_delete_host(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteHost")
    )
    input_: capo_codeconnections.types.delete_host_input.DeleteHostInput = {
        "host_arn": host_arn
    }

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