/AWS1/IF_GML=>GETINSTANCEACCESS()¶
About GetInstanceAccess¶
This API works with the following fleet types: EC2
Requests authorization to remotely connect to an instance in an Amazon GameLift Servers managed fleet. Use this operation to connect to instances with game servers that use Amazon GameLift Servers server SDK 4.x or earlier. To connect to instances with game servers that use server SDK 5.x or later, call https://docs.aws.amazon.com/gamelift/latest/apireference/API_GetComputeAccess.
To request access to an instance, specify IDs for the instance and the fleet it belongs to. You can retrieve instance IDs for a fleet by calling DescribeInstances with the fleet ID.
If successful, this operation returns an IP address and credentials. The returned credentials match the operating system of the instance, as follows:
-
For a Windows instance: returns a user name and secret (password) for use with a Windows Remote Desktop client.
-
For a Linux instance: returns a user name and secret (RSA private key) for use with an SSH client. You must save the secret to a
.pemfile. If you're using the CLI, see the example Get credentials for a Linux instance for tips on automatically saving the secret to a.pemfile.
Learn more
Remotely connect to fleet instances
Related actions
Method Signature¶
METHODS /AWS1/IF_GML~GETINSTANCEACCESS
IMPORTING
!IV_FLEETID TYPE /AWS1/GMLFLEETIDORARN OPTIONAL
!IV_INSTANCEID TYPE /AWS1/GMLINSTANCEID OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_gmlgetinstaccoutput
RAISING
/AWS1/CX_GMLINTERNALSERVICEEX
/AWS1/CX_GMLINVALIDREQUESTEX
/AWS1/CX_GMLNOTFOUNDEXCEPTION
/AWS1/CX_GMLUNAUTHORIZEDEX
/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 that contains the instance you want to access. You can request access to instances in EC2 fleets with the following statuses:
ACTIVATING,ACTIVE, orERROR. Use either a fleet ID or an ARN value.You can access fleets in
ERRORstatus for a short period of time before Amazon GameLift Servers deletes them.
iv_instanceid TYPE /AWS1/GMLINSTANCEID /AWS1/GMLINSTANCEID¶
A unique identifier for the instance you want to access. You can access an instance in any status.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_gmlgetinstaccoutput /AWS1/CL_GMLGETINSTACCOUTPUT¶
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->getinstanceaccess(
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.
lo_instanceaccess = lo_result->get_instanceaccess( ).
IF lo_instanceaccess IS NOT INITIAL.
lv_fleetid = lo_instanceaccess->get_fleetid( ).
lv_instanceid = lo_instanceaccess->get_instanceid( ).
lv_ipaddress = lo_instanceaccess->get_ipaddress( ).
lv_operatingsystem = lo_instanceaccess->get_operatingsystem( ).
lo_instancecredentials = lo_instanceaccess->get_credentials( ).
IF lo_instancecredentials IS NOT INITIAL.
lv_nonemptystring = lo_instancecredentials->get_username( ).
lv_nonemptystring = lo_instancecredentials->get_secret( ).
ENDIF.
ENDIF.
ENDIF.