Skip to content

/AWS1/IF_WSI=>CREATEWORKSPACEINSTANCE()

About CreateWorkspaceInstance

Launches a new WorkSpace Instance with specified configuration parameters, enabling programmatic workspace deployment.

Method Signature

IMPORTING

Required arguments:

io_managedinstance TYPE REF TO /AWS1/CL_WSIMANAGEDINSTREQUEST /AWS1/CL_WSIMANAGEDINSTREQUEST

Comprehensive configuration settings for the WorkSpaces Instance, including network, compute, and storage parameters.

Optional arguments:

iv_clienttoken TYPE /AWS1/WSICLIENTTOKEN /AWS1/WSICLIENTTOKEN

Unique token to ensure idempotent instance creation, preventing duplicate workspace launches.

it_tags TYPE /AWS1/CL_WSITAG=>TT_TAGLIST TT_TAGLIST

Optional metadata tags for categorizing and managing WorkSpaces Instances.

RETURNING

oo_output TYPE REF TO /aws1/cl_wsicreworkspaceinst01 /AWS1/CL_WSICREWORKSPACEINST01

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_wsi~createworkspaceinstance(
  io_managedinstance = new /aws1/cl_wsimanagedinstrequest(
    io_capacityreservationspec = new /aws1/cl_wsicapacityrsvpec(
      io_capacityreservationtarget = new /aws1/cl_wsicapreservationtgt(
        iv_capacityreservationid = |string|
        iv_capreservationresgrouparn = |string|
      )
      iv_capacityreservationpref = |string|
    )
    io_cpuoptions = new /aws1/cl_wsicpuoptionsrequest(
      iv_amdsevsnp = |string|
      iv_corecount = 123
      iv_threadspercore = 123
    )
    io_creditspecification = new /aws1/cl_wsicreditspecrequest( |string| )
    io_enclaveoptions = new /aws1/cl_wsiencloptionsrequest( ABAP_TRUE )
    io_hibernationoptions = new /aws1/cl_wsihibernationoptsreq( ABAP_TRUE )
    io_iaminstanceprofile = new /aws1/cl_wsiiaminstprofilespec(
      iv_arn = |string|
      iv_name = |string|
    )
    io_instancemarketoptions = new /aws1/cl_wsiinstmarketoptsreq(
      io_spotoptions = new /aws1/cl_wsispotmarketoptions(
        iv_blockdurationminutes = 123
        iv_instanceinterrptbehavior = |string|
        iv_maxprice = |string|
        iv_spotinstancetype = |string|
        iv_validuntilutc = '20150101000000.0000000'
      )
      iv_markettype = |string|
    )
    io_maintenanceoptions = new /aws1/cl_wsiinstmaintenanceo00( |string| )
    io_metadataoptions = new /aws1/cl_wsiinstmetoptsrequest(
      iv_httpendpoint = |string|
      iv_httpprotocolipv6 = |string|
      iv_httpputresponsehoplimit = 123
      iv_httptokens = |string|
      iv_instancemetadatatags = |string|
    )
    io_monitoring = new /aws1/cl_wsiruninstsmonenabled( ABAP_TRUE )
    io_networkperformanceoptions = new /aws1/cl_wsiinstnetperforman00( |string| )
    io_placement = new /aws1/cl_wsiplacement(
      iv_affinity = |string|
      iv_availabilityzone = |string|
      iv_groupid = |string|
      iv_groupname = |string|
      iv_hostid = |string|
      iv_hostresourcegrouparn = |string|
      iv_partitionnumber = 123
      iv_tenancy = |string|
    )
    io_privatednsnameoptions = new /aws1/cl_wsipvtdnsnameoptsreq(
      iv_enableresnamednsaaaarec = ABAP_TRUE
      iv_enableresnamednsarecord = ABAP_TRUE
      iv_hostnametype = |string|
    )
    it_blockdevicemappings = VALUE /aws1/cl_wsiblockdevicemapreq=>tt_blockdevicemappings(
      (
        new /aws1/cl_wsiblockdevicemapreq(
          io_ebs = new /aws1/cl_wsiebsblockdevice(
            iv_encrypted = ABAP_TRUE
            iv_iops = 123
            iv_kmskeyid = |string|
            iv_throughput = 123
            iv_volumesize = 123
            iv_volumetype = |string|
          )
          iv_devicename = |string|
          iv_nodevice = |string|
          iv_virtualname = |string|
        )
      )
    )
    it_ipv6addresses = VALUE /aws1/cl_wsiinstipv6address=>tt_ipv6addresses(
      (
        new /aws1/cl_wsiinstipv6address(
          iv_ipv6address = |string|
          iv_isprimaryipv6 = ABAP_TRUE
        )
      )
    )
    it_licensespecifications = VALUE /aws1/cl_wsilicenseconfrequest=>tt_licensespecifications(
      ( new /aws1/cl_wsilicenseconfrequest( |string| ) )
    )
    it_networkinterfaces = VALUE /aws1/cl_wsiinstnetifacespec=>tt_networkinterfaces(
      (
        new /aws1/cl_wsiinstnetifacespec(
          io_connectiontrackingspec = new /aws1/cl_wsiconntrkspecrequest(
            iv_tcpestablishedtimeout = 123
            iv_udpstreamtimeout = 123
            iv_udptimeout = 123
          )
          io_enasrdspecification = new /aws1/cl_wsienasrdspecrequest(
            io_enasrdudpspecification = new /aws1/cl_wsienasrdudpspecreq( ABAP_TRUE )
            iv_enasrdenabled = ABAP_TRUE
          )
          it_groups = VALUE /aws1/cl_wsisecuritygroupids_w=>tt_securitygroupids(
            ( new /aws1/cl_wsisecuritygroupids_w( |string| ) )
          )
          it_ipv4prefixes = VALUE /aws1/cl_wsiipv4prefixspecreq=>tt_ipv4prefixes(
            ( new /aws1/cl_wsiipv4prefixspecreq( |string| ) )
          )
          it_ipv6addresses = VALUE /aws1/cl_wsiinstipv6address=>tt_ipv6addresses(
            (
              new /aws1/cl_wsiinstipv6address(
                iv_ipv6address = |string|
                iv_isprimaryipv6 = ABAP_TRUE
              )
            )
          )
          it_ipv6prefixes = VALUE /aws1/cl_wsiipv6prefixspecreq=>tt_ipv6prefixes(
            ( new /aws1/cl_wsiipv6prefixspecreq( |string| ) )
          )
          it_privateipaddresses = VALUE /aws1/cl_wsipvtipaddressspec=>tt_privateipaddresses(
            (
              new /aws1/cl_wsipvtipaddressspec(
                iv_primary = ABAP_TRUE
                iv_privateipaddress = |string|
              )
            )
          )
          iv_associatecarrieripaddress = ABAP_TRUE
          iv_associatepublicipaddress = ABAP_TRUE
          iv_description = |string|
          iv_deviceindex = 123
          iv_interfacetype = |string|
          iv_ipv4prefixcount = 123
          iv_ipv6addresscount = 123
          iv_ipv6prefixcount = 123
          iv_networkcardindex = 123
          iv_networkinterfaceid = |string|
          iv_primaryipv6 = ABAP_TRUE
          iv_privateipaddress = |string|
          iv_secprivateipaddresscount = 123
          iv_subnetid = |string|
        )
      )
    )
    it_securitygroupids = VALUE /aws1/cl_wsisecuritygroupids_w=>tt_securitygroupids(
      ( new /aws1/cl_wsisecuritygroupids_w( |string| ) )
    )
    it_securitygroups = VALUE /aws1/cl_wsisecgroupnames_w=>tt_securitygroupnames(
      ( new /aws1/cl_wsisecgroupnames_w( |string| ) )
    )
    it_tagspecifications = VALUE /aws1/cl_wsitagspecification=>tt_tagspecifications(
      (
        new /aws1/cl_wsitagspecification(
          it_tags = VALUE /aws1/cl_wsitag=>tt_taglist(
            (
              new /aws1/cl_wsitag(
                iv_key = |string|
                iv_value = |string|
              )
            )
          )
          iv_resourcetype = |string|
        )
      )
    )
    iv_disableapistop = ABAP_TRUE
    iv_ebsoptimized = ABAP_TRUE
    iv_enableprimaryipv6 = ABAP_TRUE
    iv_imageid = |string|
    iv_instancetype = |string|
    iv_ipv6addresscount = 123
    iv_kernelid = |string|
    iv_keyname = |string|
    iv_privateipaddress = |string|
    iv_ramdiskid = |string|
    iv_subnetid = |string|
    iv_userdata = |string|
  )
  it_tags = VALUE /aws1/cl_wsitag=>tt_taglist(
    (
      new /aws1/cl_wsitag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  iv_clienttoken = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_workspaceinstanceid = lo_result->get_workspaceinstanceid( ).
ENDIF.