Skip to content

/AWS1/IF_IOS=>CREATEWORKSPACE()

About CreateWorkspace

Creates a workspace in IoT SiteWise. A workspace isolates its resources, such as datasets, time series, pipelines, and tasks, and their data from other workspaces, and has its own quotas and throttling limits. You must specify an encryption configuration when you create a workspace. The operation returns immediately with the workspace in the CREATING state. Provisioning completes asynchronously, after which the workspace state is ACTIVE, or FAILED if provisioning doesn't complete.

Method Signature

METHODS /AWS1/IF_IOS~CREATEWORKSPACE
  IMPORTING
    !IV_WORKSPACENAME TYPE /AWS1/IOSWORKSPACENAME OPTIONAL
    !IV_WORKSPACEDESCRIPTION TYPE /AWS1/IOSDESCRIPTION OPTIONAL
    !IO_ENCRYPTIONCONFIGURATION TYPE REF TO /AWS1/CL_IOSWORKSPACEENCCONF OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_IOSTAGMAP_W=>TT_TAGMAP OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/IOSCLIENTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ioscreatewkspresponse
  RAISING
    /AWS1/CX_IOSACCESSDENIEDEX
    /AWS1/CX_IOSCNFLCTOPERATIONEX
    /AWS1/CX_IOSINTERNALFAILUREEX
    /AWS1/CX_IOSINVALIDREQUESTEX
    /AWS1/CX_IOSLIMITEXCEEDEDEX
    /AWS1/CX_IOSTHROTTLINGEX
    /AWS1/CX_IOSCLIENTEXC
    /AWS1/CX_IOSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_workspacename TYPE /AWS1/IOSWORKSPACENAME /AWS1/IOSWORKSPACENAME

The name of the workspace to create.

io_encryptionconfiguration TYPE REF TO /AWS1/CL_IOSWORKSPACEENCCONF /AWS1/CL_IOSWORKSPACEENCCONF

The encryption configuration for the workspace.

Optional arguments:

iv_workspacedescription TYPE /AWS1/IOSDESCRIPTION /AWS1/IOSDESCRIPTION

A description for the workspace.

it_tags TYPE /AWS1/CL_IOSTAGMAP_W=>TT_TAGMAP TT_TAGMAP

A list of key-value pairs that contain metadata for the workspace. For more information, see Tagging your IoT SiteWise resources in the IoT SiteWise User Guide.

iv_clienttoken TYPE /AWS1/IOSCLIENTTOKEN /AWS1/IOSCLIENTTOKEN

A unique, case-sensitive identifier that you provide to ensure that the request is idempotent. If you retry a request that completed successfully using the same client token, the retry succeeds without performing any further actions.

RETURNING

oo_output TYPE REF TO /aws1/cl_ioscreatewkspresponse /AWS1/CL_IOSCREATEWKSPRESPONSE

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->createworkspace(
  io_encryptionconfiguration = new /aws1/cl_iosworkspaceencconf(
    iv_encryptiontype = |string|
    iv_kmskeyid = |string|
  )
  it_tags = VALUE /aws1/cl_iostagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_iostagmap_w=>ts_tagmap_maprow(
        key = |string|
        value = new /aws1/cl_iostagmap_w( |string| )
      )
    )
  )
  iv_clienttoken = |string|
  iv_workspacedescription = |string|
  iv_workspacename = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_workspacename = lo_result->get_workspacename( ).
  lv_arn = lo_result->get_workspacearn( ).
  lo_workspacestatus = lo_result->get_workspacestatus( ).
  IF lo_workspacestatus IS NOT INITIAL.
    lv_workspacestate = lo_workspacestatus->get_state( ).
    lo_workspaceerrordetails = lo_workspacestatus->get_error( ).
    IF lo_workspaceerrordetails IS NOT INITIAL.
      lv_errorcode = lo_workspaceerrordetails->get_code( ).
      lv_description = lo_workspaceerrordetails->get_message( ).
    ENDIF.
  ENDIF.
ENDIF.