Skip to content

/AWS1/CL_EVS=>CREATEENVIRONMENTHOST()

About CreateEnvironmentHost

Amazon EVS is in public preview release and is subject to change.

Creates an ESXi host and adds it to an Amazon EVS environment. Amazon EVS supports 4-16 hosts per environment.

This action can only be used after the Amazon EVS environment is deployed. All Amazon EVS hosts are created with the latest AMI release version for the respective VCF version of the environment. Amazon EVS hosts are commissioned in the SDDC Manager inventory as unassigned hosts.

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

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

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

Method Signature

IMPORTING

Required arguments:

iv_environmentid TYPE /AWS1/EVSENVIRONMENTID /AWS1/EVSENVIRONMENTID

A unique ID for the environment that the host is added to.

io_host TYPE REF TO /AWS1/CL_EVSHOSTINFOFORCREATE /AWS1/CL_EVSHOSTINFOFORCREATE

The host that is created and added to the environment.

Optional arguments:

iv_clienttoken TYPE /AWS1/EVSCLIENTTOKEN /AWS1/EVSCLIENTTOKEN

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.

RETURNING

oo_output TYPE REF TO /aws1/cl_evscreateenvhostrsp /AWS1/CL_EVSCREATEENVHOSTRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_evs~createenvironmenthost(
  io_host = new /aws1/cl_evshostinfoforcreate(
    iv_dedicatedhostid = |string|
    iv_hostname = |string|
    iv_instancetype = |string|
    iv_keyname = |string|
    iv_placementgroupid = |string|
  )
  iv_clienttoken = |string|
  iv_environmentid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_environmentsummary = lo_result->get_environmentsummary( ).
  IF lo_environmentsummary IS NOT INITIAL.
    lv_environmentid = lo_environmentsummary->get_environmentid( ).
    lv_environmentname = lo_environmentsummary->get_environmentname( ).
    lv_vcfversion = lo_environmentsummary->get_vcfversion( ).
    lv_checkresult = lo_environmentsummary->get_environmentstatus( ).
    lv_environmentstate = lo_environmentsummary->get_environmentstate( ).
    lv_timestamp = lo_environmentsummary->get_createdat( ).
    lv_timestamp = lo_environmentsummary->get_modifiedat( ).
    lv_arn = lo_environmentsummary->get_environmentarn( ).
  ENDIF.
  lo_host = lo_result->get_host( ).
  IF lo_host IS NOT INITIAL.
    lv_hostname = lo_host->get_hostname( ).
    lv_ipaddress = lo_host->get_ipaddress( ).
    lv_keyname = lo_host->get_keyname( ).
    lv_instancetype = lo_host->get_instancetype( ).
    lv_placementgroupid = lo_host->get_placementgroupid( ).
    lv_dedicatedhostid = lo_host->get_dedicatedhostid( ).
    lv_timestamp = lo_host->get_createdat( ).
    lv_timestamp = lo_host->get_modifiedat( ).
    lv_hoststate = lo_host->get_hoststate( ).
    lv_statedetails = lo_host->get_statedetails( ).
    lv_string = lo_host->get_ec2instanceid( ).
    LOOP AT lo_host->get_networkinterfaces( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_networkinterfaceid = lo_row_1->get_networkinterfaceid( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.