Skip to content

/AWS1/IF_LMV=>RUNMICROVM()

About RunMicrovm

Runs a new MicroVM from the specified image. The MicroVM starts in PENDING state and transitions to RUNNING once provisioning completes. To connect, generate an authentication token using CreateMicrovmAuthToken.

Method Signature

METHODS /AWS1/IF_LMV~RUNMICROVM
  IMPORTING
    !IT_INGRESSNETWORKCONNECTORS TYPE /AWS1/CL_LMVNETWORKCNCTRLIST_W=>TT_NETWORKCONNECTORLIST OPTIONAL
    !IT_EGRESSNETWORKCONNECTORS TYPE /AWS1/CL_LMVNETWORKCNCTRLIST_W=>TT_NETWORKCONNECTORLIST OPTIONAL
    !IV_IMAGEIDENTIFIER TYPE /AWS1/LMVMICROVMIMAGEID OPTIONAL
    !IV_IMAGEVERSION TYPE /AWS1/LMVVERSION OPTIONAL
    !IV_EXECUTIONROLEARN TYPE /AWS1/LMVROLEARN OPTIONAL
    !IO_IDLEPOLICY TYPE REF TO /AWS1/CL_LMVIDLEPOLICY OPTIONAL
    !IO_LOGGING TYPE REF TO /AWS1/CL_LMVLOGGING OPTIONAL
    !IV_RUNHOOKPAYLOAD TYPE /AWS1/LMVSTRING OPTIONAL
    !IV_MAXIMUMDURATIONINSECONDS TYPE /AWS1/LMVINTEGER OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/LMVSTRING OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_lmvrunmicrovmresponse
  RAISING
    /AWS1/CX_LMVACCESSDENIEDEX
    /AWS1/CX_LMVCONFLICTEXCEPTION
    /AWS1/CX_LMVINTERNALSERVEREX
    /AWS1/CX_LMVRESOURCENOTFOUNDEX
    /AWS1/CX_LMVSERVICEQUOTAEXCDEX
    /AWS1/CX_LMVTHROTTLINGEX
    /AWS1/CX_LMVVLDTNEXCEPTION
    /AWS1/CX_LMVCLIENTEXC
    /AWS1/CX_LMVSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_imageidentifier TYPE /AWS1/LMVMICROVMIMAGEID /AWS1/LMVMICROVMIMAGEID

The identifier (ARN or ID) of the MicroVM image to run.

Optional arguments:

it_ingressnetworkconnectors TYPE /AWS1/CL_LMVNETWORKCNCTRLIST_W=>TT_NETWORKCONNECTORLIST TT_NETWORKCONNECTORLIST

The list of ingress network connectors to configure for the MicroVM.

it_egressnetworkconnectors TYPE /AWS1/CL_LMVNETWORKCNCTRLIST_W=>TT_NETWORKCONNECTORLIST TT_NETWORKCONNECTORLIST

The list of egress network connectors to configure for the MicroVM.

iv_imageversion TYPE /AWS1/LMVVERSION /AWS1/LMVVERSION

The version of the MicroVM image to run.

iv_executionrolearn TYPE /AWS1/LMVROLEARN /AWS1/LMVROLEARN

The ARN of the IAM role to be assumed by the MicroVM during execution.

io_idlepolicy TYPE REF TO /AWS1/CL_LMVIDLEPOLICY /AWS1/CL_LMVIDLEPOLICY

Configuration to control auto-suspend and auto-resume behavior.

io_logging TYPE REF TO /AWS1/CL_LMVLOGGING /AWS1/CL_LMVLOGGING

The logging configuration for this MicroVM instance. Specify {"cloudWatch": {"logGroup": "..."}} to stream application logs to a custom CloudWatch log group, or {"disabled": {}} to turn off logging.

iv_runhookpayload TYPE /AWS1/LMVSTRING /AWS1/LMVSTRING

Per-MicroVM initialization data delivered as the request body of the /run lifecycle hook. Use to pass tenant-specific configuration such as session IDs or secret references. Maximum: 16,384 bytes.

iv_maximumdurationinseconds TYPE /AWS1/LMVINTEGER /AWS1/LMVINTEGER

The maximum duration in seconds that the MicroVM can exist before being terminated by the platform. Valid range: 1–28,800 (8 hours).

iv_clienttoken TYPE /AWS1/LMVSTRING /AWS1/LMVSTRING

A unique, case-sensitive identifier you provide to ensure the idempotency of the request.

RETURNING

oo_output TYPE REF TO /aws1/cl_lmvrunmicrovmresponse /AWS1/CL_LMVRUNMICROVMRESPONSE

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->runmicrovm(
  io_idlepolicy = new /aws1/cl_lmvidlepolicy(
    iv_autoresumeenabled = ABAP_TRUE
    iv_maxidledurationseconds = 123
    iv_suspendeddurationseconds = 123
  )
  io_logging = new /aws1/cl_lmvlogging(
    io_cloudwatch = new /aws1/cl_lmvcloudwatchlogging(
      iv_loggroup = |string|
      iv_logstream = |string|
    )
    io_disabled = new /aws1/cl_lmvloggingdisabled( )
  )
  it_egressnetworkconnectors = VALUE /aws1/cl_lmvnetworkcnctrlist_w=>tt_networkconnectorlist(
    ( new /aws1/cl_lmvnetworkcnctrlist_w( |string| ) )
  )
  it_ingressnetworkconnectors = VALUE /aws1/cl_lmvnetworkcnctrlist_w=>tt_networkconnectorlist(
    ( new /aws1/cl_lmvnetworkcnctrlist_w( |string| ) )
  )
  iv_clienttoken = |string|
  iv_executionrolearn = |string|
  iv_imageidentifier = |string|
  iv_imageversion = |string|
  iv_maximumdurationinseconds = 123
  iv_runhookpayload = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_microvmidentifier = lo_result->get_microvmid( ).
  lv_microvmstate = lo_result->get_state( ).
  lv_string = lo_result->get_endpoint( ).
  lv_microvmimagearn = lo_result->get_imagearn( ).
  lv_version = lo_result->get_imageversion( ).
  lv_rolearn = lo_result->get_executionrolearn( ).
  lo_idlepolicy = lo_result->get_idlepolicy( ).
  IF lo_idlepolicy IS NOT INITIAL.
    lv_integer = lo_idlepolicy->get_maxidledurationseconds( ).
    lv_integer = lo_idlepolicy->get_suspendeddurationseconds( ).
    lv_boolean = lo_idlepolicy->get_autoresumeenabled( ).
  ENDIF.
  lv_integer = lo_result->get_maximumdurationinseconds( ).
  lv_timestamp = lo_result->get_startedat( ).
  lv_timestamp = lo_result->get_terminatedat( ).
  lv_nonblankstring = lo_result->get_statereason( ).
  LOOP AT lo_result->get_ingressnetworkconnectors( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_networkconnector = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_egressnetworkconnectors( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_networkconnector = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.