Skip to content

/AWS1/IF_WSP=>REGISTERWORKSPACEDIRECTORY()

About RegisterWorkspaceDirectory

Registers the specified directory. This operation is asynchronous and returns before the WorkSpace directory is registered. If this is the first time you are registering a directory, you will need to create the workspaces_DefaultRole role before you can register a directory. For more information, see Creating the workspaces_DefaultRole Role.

Method Signature

METHODS /AWS1/IF_WSP~REGISTERWORKSPACEDIRECTORY
  IMPORTING
    !IV_DIRECTORYID TYPE /AWS1/WSPDIRECTORYID OPTIONAL
    !IT_SUBNETIDS TYPE /AWS1/CL_WSPSUBNETIDS_W=>TT_SUBNETIDS OPTIONAL
    !IV_ENABLESELFSERVICE TYPE /AWS1/WSPBOOLEANOBJECT OPTIONAL
    !IV_TENANCY TYPE /AWS1/WSPTENANCY OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_WSPTAG=>TT_TAGLIST OPTIONAL
    !IV_WORKSPACEDIRECTORYNAME TYPE /AWS1/WSPWORKSPACEDIRECTORYN00 OPTIONAL
    !IV_WORKSPACEDIRECTORYDESC TYPE /AWS1/WSPWORKSPACEDIRECTORYDSC OPTIONAL
    !IV_USERIDENTITYTYPE TYPE /AWS1/WSPUSERIDENTITYTYPE OPTIONAL
    !IV_IDCINSTANCEARN TYPE /AWS1/WSPARN OPTIONAL
    !IO_MICROSOFTENTRACONFIG TYPE REF TO /AWS1/CL_WSPMICROSOFTENTRACFG OPTIONAL
    !IV_WORKSPACETYPE TYPE /AWS1/WSPWORKSPACETYPE OPTIONAL
    !IO_ACTIVEDIRECTORYCONFIG TYPE REF TO /AWS1/CL_WSPACTDIRECTORYCONFIG OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_wspregworkspacedire01
  RAISING
    /AWS1/CX_WSPACCESSDENIEDEX
    /AWS1/CX_WSPINVPARAMVALUESEX
    /AWS1/CX_WSPINVRESOURCESTATEEX
    /AWS1/CX_WSPOPNOTSUPPORTEDEX
    /AWS1/CX_WSPRESRCALRDYEXISTSEX
    /AWS1/CX_WSPRESRCLIMITEXCDEX
    /AWS1/CX_WSPRESOURCENOTFOUNDEX
    /AWS1/CX_WSPUNSUPPEDNETWORKC00
    /AWS1/CX_WSPWORKSPACESDEFROL00
    /AWS1/CX_WSPCLIENTEXC
    /AWS1/CX_WSPSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Optional arguments:

iv_directoryid TYPE /AWS1/WSPDIRECTORYID /AWS1/WSPDIRECTORYID

The identifier of the directory. You cannot register a directory if it does not have a status of Active. If the directory does not have a status of Active, you will receive an InvalidResourceStateException error. If you have already registered the maximum number of directories that you can register with Amazon WorkSpaces, you will receive a ResourceLimitExceededException error. Deregister directories that you are not using for WorkSpaces, and try again.

it_subnetids TYPE /AWS1/CL_WSPSUBNETIDS_W=>TT_SUBNETIDS TT_SUBNETIDS

The identifiers of the subnets for your virtual private cloud (VPC). Make sure that the subnets are in supported Availability Zones. The subnets must also be in separate Availability Zones. If these conditions are not met, you will receive an OperationNotSupportedException error.

iv_enableselfservice TYPE /AWS1/WSPBOOLEANOBJECT /AWS1/WSPBOOLEANOBJECT

Indicates whether self-service capabilities are enabled or disabled.

iv_tenancy TYPE /AWS1/WSPTENANCY /AWS1/WSPTENANCY

Indicates whether your WorkSpace directory is dedicated or shared. To use Bring Your Own License (BYOL) images, this value must be set to DEDICATED and your Amazon Web Services account must be enabled for BYOL. If your account has not been enabled for BYOL, you will receive an InvalidParameterValuesException error. For more information about BYOL images, see Bring Your Own Windows Desktop Images.

it_tags TYPE /AWS1/CL_WSPTAG=>TT_TAGLIST TT_TAGLIST

The tags associated with the directory.

iv_workspacedirectoryname TYPE /AWS1/WSPWORKSPACEDIRECTORYN00 /AWS1/WSPWORKSPACEDIRECTORYN00

The name of the directory to register.

iv_workspacedirectorydesc TYPE /AWS1/WSPWORKSPACEDIRECTORYDSC /AWS1/WSPWORKSPACEDIRECTORYDSC

Description of the directory to register.

iv_useridentitytype TYPE /AWS1/WSPUSERIDENTITYTYPE /AWS1/WSPUSERIDENTITYTYPE

The type of identity management the user is using.

iv_idcinstancearn TYPE /AWS1/WSPARN /AWS1/WSPARN

The Amazon Resource Name (ARN) of the identity center instance.

io_microsoftentraconfig TYPE REF TO /AWS1/CL_WSPMICROSOFTENTRACFG /AWS1/CL_WSPMICROSOFTENTRACFG

The details about Microsoft Entra config.

iv_workspacetype TYPE /AWS1/WSPWORKSPACETYPE /AWS1/WSPWORKSPACETYPE

Indicates whether the directory's WorkSpace type is personal or pools.

io_activedirectoryconfig TYPE REF TO /AWS1/CL_WSPACTDIRECTORYCONFIG /AWS1/CL_WSPACTDIRECTORYCONFIG

The active directory config of the directory.

RETURNING

oo_output TYPE REF TO /aws1/cl_wspregworkspacedire01 /AWS1/CL_WSPREGWORKSPACEDIRE01

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->registerworkspacedirectory(
  io_activedirectoryconfig = new /aws1/cl_wspactdirectoryconfig(
    iv_domainname = |string|
    iv_serviceaccountsecretarn = |string|
  )
  io_microsoftentraconfig = new /aws1/cl_wspmicrosoftentracfg(
    iv_applicationcfgsecretarn = |string|
    iv_tenantid = |string|
  )
  it_subnetids = VALUE /aws1/cl_wspsubnetids_w=>tt_subnetids(
    ( new /aws1/cl_wspsubnetids_w( |string| ) )
  )
  it_tags = VALUE /aws1/cl_wsptag=>tt_taglist(
    (
      new /aws1/cl_wsptag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  iv_directoryid = |string|
  iv_enableselfservice = ABAP_TRUE
  iv_idcinstancearn = |string|
  iv_tenancy = |string|
  iv_useridentitytype = |string|
  iv_workspacedirectorydesc = |string|
  iv_workspacedirectoryname = |string|
  iv_workspacetype = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_directoryid = lo_result->get_directoryid( ).
  lv_workspacedirectorystate = lo_result->get_state( ).
ENDIF.