Skip to content

/AWS1/IF_MGN=>CREATENETWORKMIGRATIONDEFN()

About CreateNetworkMigrationDefinition

Creates a new network migration definition that specifies the source and target network configuration for a migration.

Method Signature

METHODS /AWS1/IF_MGN~CREATENETWORKMIGRATIONDEFN
  IMPORTING
    !IV_NAME TYPE /AWS1/MGNNETWORKMIGRDEFNNAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/MGNNETWORKMIGRDEFNDESC OPTIONAL
    !IT_SOURCECONFIGURATIONS TYPE /AWS1/CL_MGNSOURCECONF=>TT_SOURCECONFIGURATIONLIST OPTIONAL
    !IO_TARGETS3CONFIGURATION TYPE REF TO /AWS1/CL_MGNTARGETS3CONF OPTIONAL
    !IO_TARGETNETWORK TYPE REF TO /AWS1/CL_MGNTARGETNETWORK OPTIONAL
    !IV_TARGETDEPLOYMENT TYPE /AWS1/MGNTARGETDEPLOYMENT OPTIONAL
    !IV_VPCPROVISIONINGSTRATEGY TYPE /AWS1/MGNVPCPROVSTRATEGY OPTIONAL
    !IT_CIDRMAPPINGS TYPE /AWS1/CL_MGNCIDRMAPPING=>TT_CIDRMAPPINGSLIST OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_MGNTAGSMAP_W=>TT_TAGSMAP OPTIONAL
    !IT_SCOPETAGS TYPE /AWS1/CL_MGNSCOPETAGSMAP_W=>TT_SCOPETAGSMAP OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_mgnnetworkmigrdefn
  RAISING
    /AWS1/CX_MGNSERVICEQUOTAEXCDEX
    /AWS1/CX_MGNVALIDATIONEX
    /AWS1/CX_MGNCLIENTEXC
    /AWS1/CX_MGNSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_name TYPE /AWS1/MGNNETWORKMIGRDEFNNAME /AWS1/MGNNETWORKMIGRDEFNNAME

The name of the network migration definition.

io_targets3configuration TYPE REF TO /AWS1/CL_MGNTARGETS3CONF /AWS1/CL_MGNTARGETS3CONF

The S3 configuration for storing the target network artifacts.

io_targetnetwork TYPE REF TO /AWS1/CL_MGNTARGETNETWORK /AWS1/CL_MGNTARGETNETWORK

The target network configuration including topology and CIDR ranges.

Optional arguments:

iv_description TYPE /AWS1/MGNNETWORKMIGRDEFNDESC /AWS1/MGNNETWORKMIGRDEFNDESC

A description of the network migration definition.

it_sourceconfigurations TYPE /AWS1/CL_MGNSOURCECONF=>TT_SOURCECONFIGURATIONLIST TT_SOURCECONFIGURATIONLIST

A list of source configurations for the network migration.

iv_targetdeployment TYPE /AWS1/MGNTARGETDEPLOYMENT /AWS1/MGNTARGETDEPLOYMENT

The target deployment configuration for the migrated network.

iv_vpcprovisioningstrategy TYPE /AWS1/MGNVPCPROVSTRATEGY /AWS1/MGNVPCPROVSTRATEGY

Specifies whether to create new target VPCs or use existing ones. Set to CREATE_NEW to provision new target VPCs as part of the migration, or USE_EXISTING to migrate into existing VPCs in the target account.

it_cidrmappings TYPE /AWS1/CL_MGNCIDRMAPPING=>TT_CIDRMAPPINGSLIST TT_CIDRMAPPINGSLIST

A list of CIDR mappings that map original source CIDR ranges to updated target CIDR ranges. CIDR mappings can be provided only when vpcProvisioningStrategy is set to USE_EXISTING.

it_tags TYPE /AWS1/CL_MGNTAGSMAP_W=>TT_TAGSMAP TT_TAGSMAP

Tags to assign to the network migration definition.

it_scopetags TYPE /AWS1/CL_MGNSCOPETAGSMAP_W=>TT_SCOPETAGSMAP TT_SCOPETAGSMAP

Scope tags for the network migration definition to control access and organization.

RETURNING

oo_output TYPE REF TO /aws1/cl_mgnnetworkmigrdefn /AWS1/CL_MGNNETWORKMIGRDEFN

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->createnetworkmigrationdefn(
  io_targetnetwork = new /aws1/cl_mgntargetnetwork(
    iv_inboundcidr = |string|
    iv_inspectioncidr = |string|
    iv_outboundcidr = |string|
    iv_topology = |string|
  )
  io_targets3configuration = new /aws1/cl_mgntargets3conf(
    iv_s3bucket = |string|
    iv_s3bucketowner = |string|
  )
  it_cidrmappings = VALUE /aws1/cl_mgncidrmapping=>tt_cidrmappingslist(
    (
      new /aws1/cl_mgncidrmapping(
        iv_originalcidr = |string|
        iv_updatedcidr = |string|
      )
    )
  )
  it_scopetags = VALUE /aws1/cl_mgnscopetagsmap_w=>tt_scopetagsmap(
    (
      VALUE /aws1/cl_mgnscopetagsmap_w=>ts_scopetagsmap_maprow(
        key = |string|
        value = new /aws1/cl_mgnscopetagsmap_w( |string| )
      )
    )
  )
  it_sourceconfigurations = VALUE /aws1/cl_mgnsourceconf=>tt_sourceconfigurationlist(
    (
      new /aws1/cl_mgnsourceconf(
        io_sources3configuration = new /aws1/cl_mgnsources3conf(
          iv_s3bucket = |string|
          iv_s3bucketowner = |string|
          iv_s3key = |string|
        )
        iv_sourceenvironment = |string|
      )
    )
  )
  it_tags = VALUE /aws1/cl_mgntagsmap_w=>tt_tagsmap(
    (
      VALUE /aws1/cl_mgntagsmap_w=>ts_tagsmap_maprow(
        key = |string|
        value = new /aws1/cl_mgntagsmap_w( |string| )
      )
    )
  )
  iv_description = |string|
  iv_name = |string|
  iv_targetdeployment = |string|
  iv_vpcprovisioningstrategy = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_arn = lo_result->get_arn( ).
  lv_networkmigrationdefinit = lo_result->get_networkmigrationdefnid( ).
  lv_networkmigrationdefinit_1 = lo_result->get_name( ).
  lv_networkmigrationdefinit_2 = lo_result->get_description( ).
  LOOP AT lo_result->get_sourceconfigurations( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_sourceenvironment = lo_row_1->get_sourceenvironment( ).
      lo_sources3configuration = lo_row_1->get_sources3configuration( ).
      IF lo_sources3configuration IS NOT INITIAL.
        lv_s3bucketname = lo_sources3configuration->get_s3bucket( ).
        lv_accountid = lo_sources3configuration->get_s3bucketowner( ).
        lv_s3keyname = lo_sources3configuration->get_s3key( ).
      ENDIF.
    ENDIF.
  ENDLOOP.
  lo_targets3configuration = lo_result->get_targets3configuration( ).
  IF lo_targets3configuration IS NOT INITIAL.
    lv_s3bucketname = lo_targets3configuration->get_s3bucket( ).
    lv_accountid = lo_targets3configuration->get_s3bucketowner( ).
  ENDIF.
  lo_targetnetwork = lo_result->get_targetnetwork( ).
  IF lo_targetnetwork IS NOT INITIAL.
    lv_targetnetworktopology = lo_targetnetwork->get_topology( ).
    lv_cidr = lo_targetnetwork->get_inboundcidr( ).
    lv_cidr = lo_targetnetwork->get_outboundcidr( ).
    lv_cidr = lo_targetnetwork->get_inspectioncidr( ).
  ENDIF.
  lv_targetdeployment = lo_result->get_targetdeployment( ).
  lv_vpcprovisioningstrategy = lo_result->get_vpcprovisioningstrategy( ).
  LOOP AT lo_result->get_cidrmappings( ) into lo_row_2.
    lo_row_3 = lo_row_2.
    IF lo_row_3 IS NOT INITIAL.
      lv_cidr = lo_row_3->get_originalcidr( ).
      lv_cidr = lo_row_3->get_updatedcidr( ).
    ENDIF.
  ENDLOOP.
  lv_timestamp = lo_result->get_createdat( ).
  lv_timestamp = lo_result->get_updatedat( ).
  LOOP AT lo_result->get_tags( ) into ls_row_4.
    lv_key = ls_row_4-key.
    lo_value = ls_row_4-value.
    IF lo_value IS NOT INITIAL.
      lv_tagvalue = lo_value->get_value( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_scopetags( ) into ls_row_5.
    lv_key_1 = ls_row_5-key.
    lo_value_1 = ls_row_5-value.
    IF lo_value_1 IS NOT INITIAL.
      lv_scopetagvalue = lo_value_1->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.

Sample CreateNetworkMigrationDefinition call

Sample CreateNetworkMigrationDefinition call

DATA(lo_result) = lo_client->createnetworkmigrationdefn(
  io_targetnetwork = new /aws1/cl_mgntargetnetwork(
    iv_inboundcidr = |192.168.1.0/24|
    iv_topology = |ISOLATED_VPC|
  )
  io_targets3configuration = new /aws1/cl_mgntargets3conf(
    iv_s3bucket = |target_bucket|
    iv_s3bucketowner = |012345678901|
  )
  it_sourceconfigurations = VALUE /aws1/cl_mgnsourceconf=>tt_sourceconfigurationlist(
    (
      new /aws1/cl_mgnsourceconf(
        io_sources3configuration = new /aws1/cl_mgnsources3conf(
          iv_s3bucket = |source_bucket|
          iv_s3bucketowner = |012345678901|
          iv_s3key = |source_key|
        )
        iv_sourceenvironment = |NSX|
      )
    )
  )
  iv_description = |network 1 description|
  iv_name = |network1|
  iv_targetdeployment = |SINGLE_ACCOUNT|
).