Skip to content

create_environment_host

create_environment_host(
    environment_id: EnvironmentId,
    host: HostInfoForCreate,
    *,
    config_overrides: Optional[evsClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    esx_version: Optional[EsxVersion] = None,
) -> CreateEnvironmentHostResponse

Creates an ESX host and adds it to an Amazon EVS environment.

This action can only be used after the Amazon EVS environment is deployed.

You can use the dedicatedHostId parameter to specify an Amazon EC2 Dedicated Host for ESX host creation.

You can use the placementGroupId parameter to specify a cluster or partition placement group to launch EC2 instances into.

If you don't specify an ESX version when adding hosts using CreateEnvironmentHost action, Amazon EVS automatically uses the default ESX version for your environment's VCF version. To find the available ESX versions for a particular VCF version, use the GetVersions action.

You cannot use the dedicatedHostId and placementGroupId parameters together in the same CreateEnvironmentHost action. This results in a ValidationException response.

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 creation 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 environment that the host is added to.

  • host (HostInfoForCreate) –

    The host that is created and added to the environment.

  • esx_version (Optional[EsxVersion], default: None ) –

    The ESX version to use for the host.

Raises:

  • ThrottlingException –

    The operation could not be performed because the service is throttling requests. This exception is thrown when the service endpoint receives too many concurrent requests.

  • 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/evs.py
def create_environment_host(
    self,
    environment_id: "capo_evs.types.environment_id.EnvironmentId",
    host: "capo_evs.types.host_info_for_create.HostInfoForCreate",
    *,
    config_overrides: Optional[evsClientConfig] = None,
    client_token: Optional["capo_evs.types.client_token.ClientToken"] = None,
    esx_version: Optional["capo_evs.types.esx_version.EsxVersion"] = None,
) -> (
    "capo_evs.types.create_environment_host_response.CreateEnvironmentHostResponse"
):
    """<p>Creates an ESX host and adds it to an Amazon EVS environment.</p> <p>This action can only be used after the Amazon EVS environment is deployed.</p> <p>You can use the <code>dedicatedHostId</code> parameter to specify an Amazon EC2 Dedicated Host for ESX host creation.</p> <p> You can use the <code>placementGroupId</code> parameter to specify a cluster or partition placement group to launch EC2 instances into.</p> <note> <p>If you don't specify an ESX version when adding hosts using <code>CreateEnvironmentHost</code> action, Amazon EVS automatically uses the default ESX version for your environment's VCF version. To find the available ESX versions for a particular VCF version, use the <code>GetVersions</code> action.</p> <p>You cannot use the <code>dedicatedHostId</code> and <code>placementGroupId</code> parameters together in the same <code>CreateEnvironmentHost</code> action. This results in a <code>ValidationException</code> response.</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 creation 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 environment that the host is added to.</p>
        host: <p>The host that is created and added to the environment.</p>
        esx_version: <p>The ESX version to use for the host.</p>

    Raises:
        capo_evs.errors.throttling_exception.ThrottlingException: <p>The operation could not be performed because the service is throttling requests. This exception is thrown when the service endpoint receives too many concurrent requests.</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.
    """

    def _handler(
        req: "OperationRequest[capo_evs.types.create_environment_host_request.CreateEnvironmentHostRequest]",
    ) -> OperationResponse[
        "capo_evs.types.create_environment_host_response.CreateEnvironmentHostResponse"
    ]:
        import capo_evs._operations.amazon_elastic_v_mware_service.create_environment_host

        output, http_response = (
            capo_evs._operations.amazon_elastic_v_mware_service.create_environment_host.create_environment_host(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEnvironmentHost")
    )
    input_: capo_evs.types.create_environment_host_request.CreateEnvironmentHostRequest = {
        "environment_id": environment_id,
        "host": host,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if esx_version is not None:
        input_["esx_version"] = esx_version

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output