/AWS1/IF_GML=>DESCRIBEINSTANCES()¶
About DescribeInstances¶
This API works with the following fleet types: EC2
Retrieves information about the EC2 instances in an Amazon GameLift Servers managed fleet, including instance ID, connection data, and status. You can use this operation with a multi-location fleet to get location-specific instance information. As an alternative, use the operations https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute and https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeCompute to retrieve information for compute resources, including EC2 and Anywhere fleets.
You can call this operation in the following ways:
-
To get information on all instances in a fleet's home Region, specify the fleet ID.
-
To get information on all instances in a fleet's remote location, specify the fleet ID and location name.
-
To get information on a specific instance in a fleet, specify the fleet ID and instance ID.
Use the pagination parameters to retrieve results as a set of sequential pages.
If successful, this operation returns Instance objects for each requested
instance, listed in no particular order. If you call this operation for an Anywhere
fleet, you receive an InvalidRequestException.
Learn more
Remotely connect to fleet instances
Related actions
Method Signature¶
METHODS /AWS1/IF_GML~DESCRIBEINSTANCES
IMPORTING
!IV_FLEETID TYPE /AWS1/GMLFLEETIDORARN OPTIONAL
!IV_INSTANCEID TYPE /AWS1/GMLINSTANCEID OPTIONAL
!IV_LIMIT TYPE /AWS1/GMLPOSITIVEINTEGER OPTIONAL
!IV_NEXTTOKEN TYPE /AWS1/GMLNONZEROANDMAXSTRING OPTIONAL
!IV_LOCATION TYPE /AWS1/GMLLOCATIONSTRINGMODEL OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_gmldescrinstsoutput
RAISING
/AWS1/CX_GMLINTERNALSERVICEEX
/AWS1/CX_GMLINVALIDREQUESTEX
/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 fleet to retrieve instance information for. You can use either the fleet ID or ARN value.
Optional arguments:¶
iv_instanceid TYPE /AWS1/GMLINSTANCEID /AWS1/GMLINSTANCEID¶
A unique identifier for an instance to retrieve. Specify an instance ID or leave blank to retrieve all instances in the fleet.
iv_limit TYPE /AWS1/GMLPOSITIVEINTEGER /AWS1/GMLPOSITIVEINTEGER¶
The maximum number of results to return. Use this parameter with
NextTokento get results as a set of sequential pages.
iv_nexttoken TYPE /AWS1/GMLNONZEROANDMAXSTRING /AWS1/GMLNONZEROANDMAXSTRING¶
A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.
iv_location TYPE /AWS1/GMLLOCATIONSTRINGMODEL /AWS1/GMLLOCATIONSTRINGMODEL¶
The name of a location to retrieve instance information for, in the form of an Amazon Web Services Region code such as
us-west-2.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_gmldescrinstsoutput /AWS1/CL_GMLDESCRINSTSOUTPUT¶
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->describeinstances(
iv_fleetid = |string|
iv_instanceid = |string|
iv_limit = 123
iv_location = |string|
iv_nexttoken = |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_instances( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_fleetid = lo_row_1->get_fleetid( ).
lv_fleetarn = lo_row_1->get_fleetarn( ).
lv_instanceid = lo_row_1->get_instanceid( ).
lv_ipaddress = lo_row_1->get_ipaddress( ).
lv_dnsname = lo_row_1->get_dnsname( ).
lv_operatingsystem = lo_row_1->get_operatingsystem( ).
lv_ec2instancetype = lo_row_1->get_type( ).
lv_instancestatus = lo_row_1->get_status( ).
lv_timestamp = lo_row_1->get_creationtime( ).
lv_locationstringmodel = lo_row_1->get_location( ).
ENDIF.
ENDLOOP.
lv_nonzeroandmaxstring = lo_result->get_nexttoken( ).
ENDIF.