Skip to content

/AWS1/CL_SGM=>BATCHADDCLUSTERNODES()

About BatchAddClusterNodes

Adds nodes to a HyperPod cluster by incrementing the target count for one or more instance groups. This operation returns a unique NodeLogicalId for each node being added, which can be used to track the provisioning status of the node. This API provides a safer alternative to UpdateCluster for scaling operations by avoiding unintended configuration changes.

This API is only supported for clusters using Continuous as the NodeProvisioningMode.

Method Signature

IMPORTING

Required arguments:

iv_clustername TYPE /AWS1/SGMCLUSTERNAMEORARN /AWS1/SGMCLUSTERNAMEORARN

The name of the HyperPod cluster to which you want to add nodes.

it_nodestoadd TYPE /AWS1/CL_SGMADDCLUSTERNODESPEC=>TT_ADDCLUSTERNODESPECLIST TT_ADDCLUSTERNODESPECLIST

A list of instance groups and the number of nodes to add to each. You can specify up to 5 instance groups in a single request, with a maximum of 50 nodes total across all instance groups.

Optional arguments:

iv_clienttoken TYPE /AWS1/SGMSTRING /AWS1/SGMSTRING

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token is valid for 8 hours. If you retry the request with the same client token within this timeframe and the same parameters, the API returns the same set of NodeLogicalIds with their latest status.

RETURNING

oo_output TYPE REF TO /aws1/cl_sgmbtcaddclstnodesrsp /AWS1/CL_SGMBTCADDCLSTNODESRSP

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_sgm~batchaddclusternodes(
  it_nodestoadd = VALUE /aws1/cl_sgmaddclusternodespec=>tt_addclusternodespeclist(
    (
      new /aws1/cl_sgmaddclusternodespec(
        iv_incrementtargetcountby = 123
        iv_instancegroupname = |string|
      )
    )
  )
  iv_clienttoken = |string|
  iv_clustername = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_successful( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_clusternodelogicalid = lo_row_1->get_nodelogicalid( ).
      lv_clusterinstancegroupnam = lo_row_1->get_instancegroupname( ).
      lv_clusterinstancestatus = lo_row_1->get_status( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_failed( ) into lo_row_2.
    lo_row_3 = lo_row_2.
    IF lo_row_3 IS NOT INITIAL.
      lv_instancegroupname = lo_row_3->get_instancegroupname( ).
      lv_batchaddclusternodeserr = lo_row_3->get_errorcode( ).
      lv_batchaddfailurecount = lo_row_3->get_failedcount( ).
      lv_string = lo_row_3->get_message( ).
    ENDIF.
  ENDLOOP.
ENDIF.