Skip to content

/AWS1/IF_GML=>DESCRCONTNRGROUPPORTMAPPINGS()

About DescribeContainerGroupPortMappings

This API works with the following fleet types: Container

Retrieves the port mappings for a container group running on a container fleet. Port mappings show how container ports are mapped to connection ports on the fleet instance. Use this operation to find the connection port for a specific container on a fleet instance.

Request options

  • Get port mappings for a game server container group. Provide the fleet ID, set ContainerGroupType to GAME_SERVER, and specify the ComputeName for the game server container group.

  • Get port mappings for a per-instance container group. Provide the fleet ID, set ContainerGroupType to PER_INSTANCE, and specify the InstanceId for the instance.

  • Optionally filter results to a single container by providing a ContainerName.

Results

This operation returns the fleet ID, location, container group definition ARN, container group type, compute name (for game server container groups), instance ID, and a list of ContainerGroupPortMapping objects. Each object contains the container name, runtime ID, and a list of port mappings that show how container ports map to connection ports on the instance.

Learn more

Connect to containers

Create a container group definition

Method Signature

METHODS /AWS1/IF_GML~DESCRCONTNRGROUPPORTMAPPINGS
  IMPORTING
    !IV_FLEETID TYPE /AWS1/GMLFLEETIDORARN OPTIONAL
    !IV_CONTAINERGROUPTYPE TYPE /AWS1/GMLCONTAINERGROUPTYPE OPTIONAL
    !IV_COMPUTENAME TYPE /AWS1/GMLCOMPUTENAMEORARN OPTIONAL
    !IV_INSTANCEID TYPE /AWS1/GMLINSTANCEID OPTIONAL
    !IV_CONTAINERNAME TYPE /AWS1/GMLNONZEROAND128MAXASC00 OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_gmldsccnrgrportmapout
  RAISING
    /AWS1/CX_GMLINTERNALSERVICEEX
    /AWS1/CX_GMLINVALIDREQUESTEX
    /AWS1/CX_GMLLIMITEXCEEDEDEX
    /AWS1/CX_GMLNOTFOUNDEXCEPTION
    /AWS1/CX_GMLUNAUTHORIZEDEX
    /AWS1/CX_GMLUNSUPPEDREGIONEX
    /AWS1/CX_GMLCLIENTEXC
    /AWS1/CX_GMLSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_fleetid TYPE /AWS1/GMLFLEETIDORARN /AWS1/GMLFLEETIDORARN

A unique identifier for the container fleet. You can use either the fleet ID or ARN value.

iv_containergrouptype TYPE /AWS1/GMLCONTAINERGROUPTYPE /AWS1/GMLCONTAINERGROUPTYPE

The type of container group to retrieve port mappings for.

  • GAME_SERVER -- Get port mappings for a game server container group.

  • PER_INSTANCE -- Get port mappings for a per-instance container group.

Optional arguments:

iv_computename TYPE /AWS1/GMLCOMPUTENAMEORARN /AWS1/GMLCOMPUTENAMEORARN

A unique identifier for the compute resource for which to retrieve port mappings. For a container fleet, a compute represents a game server container group running on a fleet instance. You can use either the compute name or ARN value.

When ContainerGroupType is GAME_SERVER, this parameter is required.

When ContainerGroupType is PER_INSTANCE, do not provide this parameter. If you provide a compute name with PER_INSTANCE, the request fails with an InvalidRequestException.

iv_instanceid TYPE /AWS1/GMLINSTANCEID /AWS1/GMLINSTANCEID

A unique identifier for the fleet instance to retrieve port mappings for.

When ContainerGroupType is PER_INSTANCE, this parameter is required.

When ContainerGroupType is GAME_SERVER, this parameter is optional. If you provide an instance ID, it must match the instance that's running the specified compute. If the instance ID doesn't match, the request fails with an InvalidRequestException.

iv_containername TYPE /AWS1/GMLNONZEROAND128MAXASC00 /AWS1/GMLNONZEROAND128MAXASC00

A container name to filter the results. When provided, the operation returns port mappings for the specified container only. If no container with the specified name exists in the container group, the request fails with a NotFoundException.

If not provided, the operation returns port mappings for all containers in the container group.

RETURNING

oo_output TYPE REF TO /aws1/cl_gmldsccnrgrportmapout /AWS1/CL_GMLDSCCNRGRPORTMAPOUT

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->descrcontnrgroupportmappings(
  iv_computename = |string|
  iv_containergrouptype = |string|
  iv_containername = |string|
  iv_fleetid = |string|
  iv_instanceid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_fleetid = lo_result->get_fleetid( ).
  lv_locationstringmodel = lo_result->get_location( ).
  lv_containergroupdefinitio = lo_result->get_containergroupdefnarn( ).
  lv_containergrouptype = lo_result->get_containergrouptype( ).
  lv_computename = lo_result->get_computename( ).
  lv_instanceid = lo_result->get_instanceid( ).
  LOOP AT lo_result->get_contnrgroupportmappings( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_nonzeroand128maxasciist = lo_row_1->get_containername( ).
      lv_nonemptystring = lo_row_1->get_containerruntimeid( ).
      LOOP AT lo_row_1->get_containerportmappings( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          lv_portnumber = lo_row_3->get_containerport( ).
          lv_portnumber = lo_row_3->get_connectionport( ).
          lv_ipprotocol = lo_row_3->get_protocol( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
ENDIF.