2016/10/13 - Amazon GameLift - 1 new 8 updated api methods
Changes New APIs to protect game developer resource (builds, alias, fleets, instances, game sessions and player sessions) against abuse.
Retrieves information about instances in a fleet.
To get information on a specific instance, specify both a fleet ID and instance ID. To get information for all instances in a fleet, specify a fleet ID only. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, an Instance object is returned for each result.
Request Syntax
client.describe_instances( FleetId='string', InstanceId='string', Limit=123, NextToken='string' )
string
[REQUIRED]
Unique identifier for a fleet. Specify the fleet to retrieve instance information for.
string
Unique identifier for an instance. Specify an instance to retrieve information for or leave blank to get information on all instances in the fleet.
integer
Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.
string
Token indicating the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To specify the start of the result set, do not specify a value.
dict
Response Syntax
{ 'Instances': [ { 'FleetId': 'string', 'InstanceId': 'string', 'IpAddress': 'string', 'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX', 'Type': 't2.micro'|'t2.small'|'t2.medium'|'t2.large'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge', 'Status': 'PENDING'|'ACTIVE'|'TERMINATING', 'CreationTime': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Represents the returned data in response to a request action.
Instances (list) --
Collection of objects containing properties for each instance returned.
(dict) --
Properties describing an instance of a virtual computing resource that is hosting game servers. Fleets contain zero or more instances.
FleetId (string) --
Unique identifier for the fleet that the instance belongs to.
InstanceId (string) --
Unique identifier for the instance.
IpAddress (string) --
IP address assigned to the instance.
OperatingSystem (string) --
Operating system being used on this instance.
Type (string) --
EC2 instance type that defines the computing resources of this instance.
Status (string) --
Current status of the instance. Possible statuses include the following:
PENDING – The instance is in the process of being created and launching server processes as defined in the fleet's runtime configuration.
ACTIVE – The instance has been successfully created and at least one server process has successfully launched and reported back to GameLift that it is ready to host a game session. The instance is now considered ready to host game sessions.
TERMINATING – The instance is in the process of shutting down. This may happen to reduce capacity during a scaling down event or to recycle resources in the event of a problem.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057").
NextToken (string) --
Token indicating where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.
{'ResourceCreationLimitPolicy': {'NewGameSessionsPerCreator': 'integer', 'PolicyPeriodInMinutes': 'integer'}}Response
{'FleetAttributes': {'ResourceCreationLimitPolicy': {'NewGameSessionsPerCreator': 'integer', 'PolicyPeriodInMinutes': 'integer'}}}
Creates a new fleet to run your game servers. A fleet is a set of Amazon Elastic Compute Cloud (Amazon EC2) instances, each of which can run multiple server processes to host game sessions. You configure a fleet to create instances with certain hardware specifications (see Amazon EC2 Instance Types for more information), and deploy a specified game build to each instance. A newly created fleet passes through several statuses; once it reaches the ACTIVE status, it can begin hosting game sessions.
To create a new fleet, provide a fleet name, an EC2 instance type, and a build ID of the game build to deploy. You can also configure the new fleet with the following settings: (1) a runtime configuration describing what server processes to run on each instance in the fleet (required to create fleet), (2) access permissions for inbound traffic, (3) fleet-wide game session protection, and (4) the location of default log files for GameLift to upload and store.
If the CreateFleet call is successful, Amazon GameLift performs the following tasks:
Creates a fleet record and sets the status to NEW (followed by other statuses as the fleet is activated).
Sets the fleet's capacity to 1 "desired", which causes GameLift to start one new EC2 instance.
Starts launching server processes on the instance. If the fleet is configured to run multiple server processes per instance, GameLift staggers each launch by a few seconds.
Begins writing events to the fleet event log, which can be accessed in the GameLift console.
Sets the fleet's status to ACTIVE once one server process in the fleet is ready to host a game session.
After a fleet is created, use the following actions to change fleet properties and configuration:
UpdateFleetAttributes -- Update fleet metadata, including name and description.
UpdateFleetCapacity -- Increase or decrease the number of instances you want the fleet to maintain.
UpdateFleetPortSettings -- Change the IP address and port ranges that allow access to incoming traffic.
UpdateRuntimeConfiguration -- Change how server processes are launched in the fleet, including launch path, launch parameters, and the number of concurrent processes.
Request Syntax
client.create_fleet( Name='string', Description='string', BuildId='string', ServerLaunchPath='string', ServerLaunchParameters='string', LogPaths=[ 'string', ], EC2InstanceType='t2.micro'|'t2.small'|'t2.medium'|'t2.large'|'c3.large'|'c3.xlarge'|'c3.2xlarge'|'c3.4xlarge'|'c3.8xlarge'|'c4.large'|'c4.xlarge'|'c4.2xlarge'|'c4.4xlarge'|'c4.8xlarge'|'r3.large'|'r3.xlarge'|'r3.2xlarge'|'r3.4xlarge'|'r3.8xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge', EC2InboundPermissions=[ { 'FromPort': 123, 'ToPort': 123, 'IpRange': 'string', 'Protocol': 'TCP'|'UDP' }, ], NewGameSessionProtectionPolicy='NoProtection'|'FullProtection', RuntimeConfiguration={ 'ServerProcesses': [ { 'LaunchPath': 'string', 'Parameters': 'string', 'ConcurrentExecutions': 123 }, ] }, ResourceCreationLimitPolicy={ 'NewGameSessionsPerCreator': 123, 'PolicyPeriodInMinutes': 123 } )
string
[REQUIRED]
Descriptive label associated with a fleet. Fleet names do not need to be unique.
string
Human-readable description of a fleet.
string
[REQUIRED]
Unique identifier of the build to be deployed on the new fleet. The build must have been successfully uploaded to GameLift and be in a READY status. This fleet setting cannot be changed once the fleet is created.
string
This parameter is no longer used. Instead, specify a server launch path using the RuntimeConfiguration parameter. (Requests that specify a server launch path and launch parameters instead of a runtime configuration will continue to work.)
string
This parameter is no longer used. Instead, specify server launch parameters in the RuntimeConfiguration parameter. (Requests that specify a server launch path and launch parameters instead of a runtime configuration will continue to work.)
list
Location of default log files. When a server process is shut down, Amazon GameLift captures and stores any log files in this location. These logs are in addition to game session logs; see more on game session logs in the Amazon GameLift Developer Guide . If no default log path for a fleet is specified, GameLift will automatically upload logs stored on each instance at C:\game\logs . Use the GameLift console to access stored logs.
(string) --
string
[REQUIRED]
Name of an EC2 instance type that is supported in Amazon GameLift. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. GameLift supports the following EC2 instance types. See Amazon EC2 Instance Types for detailed descriptions.
list
Range of IP addresses and port settings that permit inbound traffic to access server processes running on the fleet. If no inbound permissions are set, including both IP address range and port range, the server processes in the fleet cannot accept connections. You can specify one or more sets of permissions for a fleet.
(dict) --
A range of IP addresses and port settings that allow inbound traffic to connect to server processes on GameLift. Each game session hosted on a fleet is assigned a unique combination of IP address and port number, which must fall into the fleet's allowed ranges. This combination is included in the GameSession object.
FromPort (integer) -- [REQUIRED]
Starting value for a range of allowed port numbers.
ToPort (integer) -- [REQUIRED]
Ending value for a range of allowed port numbers. Port numbers are end-inclusive. This value must be higher than FromPort .
IpRange (string) -- [REQUIRED]
Range of allowed IP addresses. This value must be expressed in CIDR notation . Example: "000.000.000.000/[subnet mask] " or optionally the shortened version "0.0.0.0/[subnet mask] ".
Protocol (string) -- [REQUIRED]
Network communication protocol used by the fleet.
string
Game session protection policy to apply to all instances in this fleet. If this parameter is not set, instances in this fleet default to no protection. You can change a fleet's protection policy using UpdateFleetAttributes, but this change will only affect sessions created after the policy change. You can also set protection for individual instances using UpdateGameSession .
NoProtection – The game session can be terminated during a scale-down event.
FullProtection – If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.
dict
Instructions for launching server processes on each instance in the fleet. The runtime configuration for a fleet has a collection of server process configurations, one for each type of server process to run on an instance. A server process configuration specifies the location of the server executable, launch parameters, and the number of concurrent processes with that configuration to maintain on each instance. A CreateFleet request must include a runtime configuration with at least one server process configuration; otherwise the request will fail with an invalid request exception. (This parameter replaces the parameters ServerLaunchPath and ServerLaunchParameters ; requests that contain values for these parameters instead of a runtime configuration will continue to work.)
ServerProcesses (list) --
Collection of server process configurations describing what server processes to run on each instance in a fleet
(dict) --
A set of instructions for launching server processes on each instance in a fleet. Each instruction set identifies the location of the server executable, optional launch parameters, and the number of server processes with this configuration to maintain concurrently on the instance. Server process configurations make up a fleet's `` RuntimeConfiguration `` .
LaunchPath (string) -- [REQUIRED]
Location in the game build of the server executable. All game builds are installed on instances at the root C:\game\... , so an executable file located at MyGame\latest\server.exe has a launch path of "C:\game\MyGame\latest\server.exe ".
Parameters (string) --
Optional list of parameters to pass to the server executable on launch.
ConcurrentExecutions (integer) -- [REQUIRED]
Number of server processes using this configuration to run concurrently on an instance.
dict
Policy that limits the number of game sessions an individual player can create over a span of time for this fleet.
NewGameSessionsPerCreator (integer) --
Maximum number of game sessions an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used to evaluate the resource creation limit policy.
dict
Response Syntax
{ 'FleetAttributes': { 'FleetId': 'string', 'Description': 'string', 'Name': 'string', 'CreationTime': datetime(2015, 1, 1), 'TerminationTime': datetime(2015, 1, 1), 'Status': 'NEW'|'DOWNLOADING'|'VALIDATING'|'BUILDING'|'ACTIVATING'|'ACTIVE'|'DELETING'|'ERROR'|'TERMINATED', 'BuildId': 'string', 'ServerLaunchPath': 'string', 'ServerLaunchParameters': 'string', 'LogPaths': [ 'string', ], 'NewGameSessionProtectionPolicy': 'NoProtection'|'FullProtection', 'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX', 'ResourceCreationLimitPolicy': { 'NewGameSessionsPerCreator': 123, 'PolicyPeriodInMinutes': 123 } } }
Response Structure
(dict) --
Represents the returned data in response to a request action.
FleetAttributes (dict) --
Properties for the newly created fleet.
FleetId (string) --
Unique identifier for a fleet.
Description (string) --
Human-readable description of the fleet.
Name (string) --
Descriptive label associated with a fleet. Fleet names do not need to be unique.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
Status (string) --
Current status of the fleet.
Possible fleet statuses include the following:
NEW – A new fleet has been defined and desired instances is set to 1.
DOWNLOADING/VALIDATING/BUILDING/ACTIVATING – GameLift is setting up the new fleet, creating new instances with the game build and starting server processes.
ACTIVE – Hosts can now accept game sessions.
ERROR – An error occurred when downloading, validating, building, or activating the fleet.
DELETING – Hosts are responding to a delete fleet request.
TERMINATED – The fleet no longer exists.
BuildId (string) --
Unique identifier for a build.
ServerLaunchPath (string) --
Path to a game server executable in the fleet's build, specified for fleets created prior to 2016-08-04 (or AWS SDK v. 0.12.16). Server launch paths for fleets created after this date are specified in the fleet's `` RuntimeConfiguration `` .
ServerLaunchParameters (string) --
Game server launch parameters specified for fleets created prior to 2016-08-04 (or AWS SDK v. 0.12.16). Server launch parameters for fleets created after this date are specified in the fleet's `` RuntimeConfiguration `` .
LogPaths (list) --
Location of default log files. When a server process is shut down, Amazon GameLift captures and stores any log files in this location. These logs are in addition to game session logs; see more on game session logs in the Amazon GameLift Developer Guide . If no default log path for a fleet is specified, GameLift will automatically upload logs stored on each instance at C:\game\logs . Use the GameLift console to access stored logs.
(string) --
NewGameSessionProtectionPolicy (string) --
Type of game session protection to set for all new instances started in the fleet.
NoProtection – The game session can be terminated during a scale-down event.
FullProtection – If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.
OperatingSystem (string) --
Operating system of the fleet's computing resources. A fleet's operating system depends on the OS specified for the build that is deployed on this fleet.
ResourceCreationLimitPolicy (dict) --
Fleet policy to limit the number of game sessions an individual player can create over a span of time.
NewGameSessionsPerCreator (integer) --
Maximum number of game sessions an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used to evaluate the resource creation limit policy.
{'CreatorId': 'string', 'GameSessionId': 'string'}Response
{'GameSession': {'CreatorId': 'string', 'Status': ['ERROR']}}
Creates a multiplayer game session for players. This action creates a game session record and assigns the new session to an instance in the specified fleet, which initializes a new server process to host the game session. A fleet must be in an ACTIVE status before a game session can be created in it.
To create a game session, specify either a fleet ID or an alias ID and indicate the maximum number of players the game session allows. You can also provide a name and a set of properties for your game (optional). If successful, a GameSession object is returned containing session properties, including an IP address. By default, newly created game sessions are set to accept adding any new players to the game session. Use UpdateGameSession to change the creation policy.
Request Syntax
client.create_game_session( FleetId='string', AliasId='string', MaximumPlayerSessionCount=123, Name='string', GameProperties=[ { 'Key': 'string', 'Value': 'string' }, ], CreatorId='string', GameSessionId='string' )
string
Unique identifier for a fleet. Each request must reference either a fleet ID or alias ID, but not both.
string
Unique identifier for a fleet alias. Each request must reference either a fleet ID or alias ID, but not both.
integer
[REQUIRED]
Maximum number of players that can be connected simultaneously to the game session.
string
Descriptive label associated with a game session. Session names do not need to be unique.
list
Set of properties used to administer a game session. These properties are passed to the server process hosting it.
(dict) --
Set of key-value pairs containing information a server process requires to set up a game session. This object allows you to pass in any set of data needed for your game. For more information, see the Amazon GameLift Developer Guide .
Key (string) -- [REQUIRED]
TBD
Value (string) -- [REQUIRED]
TBD
string
Player ID identifying the person or entity creating the game session. This ID is used to enforce a resource protection policy (if one exists) that limits the number of concurrent active game sessions one player can have.
string
Custom string to include in the game session ID, with a maximum length of 48 characters. If this parameter is set, GameLift creates a game session ID in the following format: "arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<custom ID string>". For example, this full game session ID: "arn:aws:gamelift:us-west-2::gamesession/fleet-2ec2aae5-c2c7-43ca-b19d-8249fe5fddf2/my-game-session" includes the custom ID string "my-game-session". If this parameter is not set, GameLift creates a game session ID in the same format with an auto-generated ID string.
dict
Response Syntax
{ 'GameSession': { 'GameSessionId': 'string', 'Name': 'string', 'FleetId': 'string', 'CreationTime': datetime(2015, 1, 1), 'TerminationTime': datetime(2015, 1, 1), 'CurrentPlayerSessionCount': 123, 'MaximumPlayerSessionCount': 123, 'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string' } }
Response Structure
(dict) --
Represents the returned data in response to a request action.
GameSession (dict) --
Object containing the newly created game session record.
GameSessionId (string) --
Unique identifier for a game session. Game session ID format is as follows: "arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<ID string>". The value of <ID string> is either a custom ID string (if one was specified when the game session was created) an auto-generated string.
Name (string) --
Descriptive label associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players allowed in the game session.
Status (string) --
Current status of the game session. A game session must be in an ACTIVE status to have player sessions.
GameProperties (list) --
Set of custom properties for the game session.
(dict) --
Set of key-value pairs containing information a server process requires to set up a game session. This object allows you to pass in any set of data needed for your game. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
TBD
Value (string) --
TBD
IpAddress (string) --
IP address of the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
PlayerSessionCreationPolicy (string) --
Indicates whether or not the game session is accepting new players.
CreatorId (string) --
Player ID of the person or entity that created the game session. This ID is used to enforce a resource protection policy (if one exists) that limits the number of concurrent active game sessions one player can have.
{'FleetAttributes': {'ResourceCreationLimitPolicy': {'NewGameSessionsPerCreator': 'integer', 'PolicyPeriodInMinutes': 'integer'}}}
Retrieves fleet properties, including metadata, status, and configuration, for one or more fleets. You can request attributes for all fleets, or specify a list of one or more fleet IDs. When requesting multiple fleets, use the pagination parameters to retrieve results as a set of sequential pages. If successful, a FleetAttributes object is returned for each requested fleet ID. When specifying a list of fleet IDs, attribute objects are returned only for fleets that currently exist.
Note
Some API actions may limit the number of fleet IDs allowed in one request. If a request exceeds this limit, the request fails and the error message includes the maximum allowed.
Request Syntax
client.describe_fleet_attributes( FleetIds=[ 'string', ], Limit=123, NextToken='string' )
list
Unique identifiers for the fleet(s) that you want to retrieve attributes for. To request attributes for all fleets, leave this parameter empty.
(string) --
integer
Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. This parameter is ignored when the request specifies one or a list of fleet IDs.
string
Token indicating the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To specify the start of the result set, do not specify a value. This parameter is ignored when the request specifies one or a list of fleet IDs.
dict
Response Syntax
{ 'FleetAttributes': [ { 'FleetId': 'string', 'Description': 'string', 'Name': 'string', 'CreationTime': datetime(2015, 1, 1), 'TerminationTime': datetime(2015, 1, 1), 'Status': 'NEW'|'DOWNLOADING'|'VALIDATING'|'BUILDING'|'ACTIVATING'|'ACTIVE'|'DELETING'|'ERROR'|'TERMINATED', 'BuildId': 'string', 'ServerLaunchPath': 'string', 'ServerLaunchParameters': 'string', 'LogPaths': [ 'string', ], 'NewGameSessionProtectionPolicy': 'NoProtection'|'FullProtection', 'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX', 'ResourceCreationLimitPolicy': { 'NewGameSessionsPerCreator': 123, 'PolicyPeriodInMinutes': 123 } }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Represents the returned data in response to a request action.
FleetAttributes (list) --
Collection of objects containing attribute metadata for each requested fleet ID.
(dict) --
General properties describing a fleet.
FleetId (string) --
Unique identifier for a fleet.
Description (string) --
Human-readable description of the fleet.
Name (string) --
Descriptive label associated with a fleet. Fleet names do not need to be unique.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
Status (string) --
Current status of the fleet.
Possible fleet statuses include the following:
NEW – A new fleet has been defined and desired instances is set to 1.
DOWNLOADING/VALIDATING/BUILDING/ACTIVATING – GameLift is setting up the new fleet, creating new instances with the game build and starting server processes.
ACTIVE – Hosts can now accept game sessions.
ERROR – An error occurred when downloading, validating, building, or activating the fleet.
DELETING – Hosts are responding to a delete fleet request.
TERMINATED – The fleet no longer exists.
BuildId (string) --
Unique identifier for a build.
ServerLaunchPath (string) --
Path to a game server executable in the fleet's build, specified for fleets created prior to 2016-08-04 (or AWS SDK v. 0.12.16). Server launch paths for fleets created after this date are specified in the fleet's `` RuntimeConfiguration `` .
ServerLaunchParameters (string) --
Game server launch parameters specified for fleets created prior to 2016-08-04 (or AWS SDK v. 0.12.16). Server launch parameters for fleets created after this date are specified in the fleet's `` RuntimeConfiguration `` .
LogPaths (list) --
Location of default log files. When a server process is shut down, Amazon GameLift captures and stores any log files in this location. These logs are in addition to game session logs; see more on game session logs in the Amazon GameLift Developer Guide . If no default log path for a fleet is specified, GameLift will automatically upload logs stored on each instance at C:\game\logs . Use the GameLift console to access stored logs.
(string) --
NewGameSessionProtectionPolicy (string) --
Type of game session protection to set for all new instances started in the fleet.
NoProtection – The game session can be terminated during a scale-down event.
FullProtection – If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.
OperatingSystem (string) --
Operating system of the fleet's computing resources. A fleet's operating system depends on the OS specified for the build that is deployed on this fleet.
ResourceCreationLimitPolicy (dict) --
Fleet policy to limit the number of game sessions an individual player can create over a span of time.
NewGameSessionsPerCreator (integer) --
Maximum number of game sessions an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used to evaluate the resource creation limit policy.
NextToken (string) --
Token indicating where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.
{'GameSessionDetails': {'GameSession': {'CreatorId': 'string', 'Status': ['ERROR']}}}
Retrieves properties, including the protection policy in force, for one or more game sessions. This action can be used in several ways: (1) provide a GameSessionId to request details for a specific game session; (2) provide either a FleetId or an AliasId to request properties for all game sessions running on a fleet.
To get game session record(s), specify just one of the following: game session ID, fleet ID, or alias ID. You can filter this request by game session status. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a GameSessionDetail object is returned for each session matching the request.
Request Syntax
client.describe_game_session_details( FleetId='string', GameSessionId='string', AliasId='string', StatusFilter='string', Limit=123, NextToken='string' )
string
Unique identifier for a fleet. Specify a fleet to retrieve information on all game sessions active on the fleet.
string
Unique identifier for the game session to retrieve information on. Game session ID format is as follows: "arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<ID string>". The value of <ID string> is either a custom ID string (if one was specified when the game session was created) an auto-generated string.
string
Unique identifier for a fleet alias. Specify an alias to retrieve information on all game sessions active on the fleet.
string
Game session status to filter results on. Possible game session statuses include ACTIVE, TERMINATED , ACTIVATING and TERMINATING (the last two are transitory).
integer
Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.
string
Token indicating the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To specify the start of the result set, do not specify a value.
dict
Response Syntax
{ 'GameSessionDetails': [ { 'GameSession': { 'GameSessionId': 'string', 'Name': 'string', 'FleetId': 'string', 'CreationTime': datetime(2015, 1, 1), 'TerminationTime': datetime(2015, 1, 1), 'CurrentPlayerSessionCount': 123, 'MaximumPlayerSessionCount': 123, 'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string' }, 'ProtectionPolicy': 'NoProtection'|'FullProtection' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Represents the returned data in response to a request action.
GameSessionDetails (list) --
Collection of objects containing game session properties and the protection policy currently in force for each session matching the request.
(dict) --
A game session's properties and the protection policy currently in force.
GameSession (dict) --
Properties describing a game session.
GameSessionId (string) --
Unique identifier for a game session. Game session ID format is as follows: "arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<ID string>". The value of <ID string> is either a custom ID string (if one was specified when the game session was created) an auto-generated string.
Name (string) --
Descriptive label associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players allowed in the game session.
Status (string) --
Current status of the game session. A game session must be in an ACTIVE status to have player sessions.
GameProperties (list) --
Set of custom properties for the game session.
(dict) --
Set of key-value pairs containing information a server process requires to set up a game session. This object allows you to pass in any set of data needed for your game. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
TBD
Value (string) --
TBD
IpAddress (string) --
IP address of the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
PlayerSessionCreationPolicy (string) --
Indicates whether or not the game session is accepting new players.
CreatorId (string) --
Player ID of the person or entity that created the game session. This ID is used to enforce a resource protection policy (if one exists) that limits the number of concurrent active game sessions one player can have.
ProtectionPolicy (string) --
Current status of protection for the game session.
NoProtection – The game session can be terminated during a scale-down event.
FullProtection – If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.
NextToken (string) --
Token indicating where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.
{'GameSessions': {'CreatorId': 'string', 'Status': ['ERROR']}}
Retrieves a set of one or more game sessions and properties. This action can be used in several ways: (1) provide a GameSessionId to request properties for a specific game session; (2) provide a FleetId or an AliasId to request properties for all game sessions running on a fleet. You can also use SearchGameSessions , which allows you to retrieve all game sessions or filter on certain criteria, but only returns game sessions with a status of ACTIVE. If you need to retrieve the protection policy for each game session, use DescribeGameSessionDetails .
To get game session record(s), specify just one of the following: game session ID, fleet ID, or alias ID. You can filter this request by game session status. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a GameSession object is returned for each session matching the request.
Request Syntax
client.describe_game_sessions( FleetId='string', GameSessionId='string', AliasId='string', StatusFilter='string', Limit=123, NextToken='string' )
string
Unique identifier for a fleet. Specify a fleet to retrieve information on all game sessions active on the fleet.
string
Unique identifier for the game session to retrieve information on. Game session ID format is as follows: "arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<ID string>". The value of <ID string> is either a custom ID string (if one was specified when the game session was created) an auto-generated string.
string
Unique identifier for a fleet alias. Specify an alias to retrieve information on all game sessions active on the fleet.
string
Game session status to filter results on. Possible game session statuses include ACTIVE , TERMINATED , ACTIVATING , and TERMINATING (the last two are transitory).
integer
Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.
string
Token indicating the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To specify the start of the result set, do not specify a value.
dict
Response Syntax
{ 'GameSessions': [ { 'GameSessionId': 'string', 'Name': 'string', 'FleetId': 'string', 'CreationTime': datetime(2015, 1, 1), 'TerminationTime': datetime(2015, 1, 1), 'CurrentPlayerSessionCount': 123, 'MaximumPlayerSessionCount': 123, 'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Represents the returned data in response to a request action.
GameSessions (list) --
Collection of objects containing game session properties for each session matching the request.
(dict) --
Properties describing a game session.
GameSessionId (string) --
Unique identifier for a game session. Game session ID format is as follows: "arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<ID string>". The value of <ID string> is either a custom ID string (if one was specified when the game session was created) an auto-generated string.
Name (string) --
Descriptive label associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players allowed in the game session.
Status (string) --
Current status of the game session. A game session must be in an ACTIVE status to have player sessions.
GameProperties (list) --
Set of custom properties for the game session.
(dict) --
Set of key-value pairs containing information a server process requires to set up a game session. This object allows you to pass in any set of data needed for your game. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
TBD
Value (string) --
TBD
IpAddress (string) --
IP address of the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
PlayerSessionCreationPolicy (string) --
Indicates whether or not the game session is accepting new players.
CreatorId (string) --
Player ID of the person or entity that created the game session. This ID is used to enforce a resource protection policy (if one exists) that limits the number of concurrent active game sessions one player can have.
NextToken (string) --
Token indicating where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.
{'GameSessions': {'CreatorId': 'string', 'Status': ['ERROR']}}
Retrieves a set of game sessions that match a set of search criteria and sorts them in a specified order. Currently a game session search is limited to a single fleet. Search results include only game sessions that are in ACTIVE status. If you need to retrieve game sessions with a status other than active, use DescribeGameSessions . If you need to retrieve the protection policy for each game session, use DescribeGameSessionDetails .
You can search or sort by the following game session attributes:
gameSessionId -- ID value assigned to a game session. This unique value is returned in a GameSession object when a new game session is created.
gameSessionName -- Name assigned to a game session. This value is set when requesting a new game session with CreateGameSession or updating with UpdateGameSession . Game session names do not need to be unique to a game session.
creationTimeMillis -- Value indicating when a game session was created. It is expressed in Unix time as milliseconds.
playerSessionCount -- Number of players currently connected to a game session. This value changes rapidly as players join the session or drop out.
maximumSessions -- Maximum number of player sessions allowed for a game session. This value is set when requesting a new game session with CreateGameSession or updating with UpdateGameSession .
hasAvailablePlayerSessions -- Boolean value indicating whether or not a game session has reached its maximum number of players. When searching with this attribute, the search value must be true or false . It is highly recommended that all search requests include this filter attribute to optimize search performance and return only sessions that players can join.
To search or sort, specify either a fleet ID or an alias ID, and provide a search filter expression, a sort expression, or both. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a collection of GameSession objects matching the request is returned.
Note
Returned values for playerSessionCount and hasAvailablePlayerSessions change quickly as players join sessions and others drop out. Results should be considered a snapshot in time. Be sure to refresh search results often, and handle sessions that fill up before a player can join.
Request Syntax
client.search_game_sessions( FleetId='string', AliasId='string', FilterExpression='string', SortExpression='string', Limit=123, NextToken='string' )
string
Unique identifier for a fleet. Each request must reference either a fleet ID or alias ID, but not both.
string
Unique identifier for a fleet alias. Each request must reference either a fleet ID or alias ID, but not both.
string
String containing the search criteria for the session search. If no filter expression is included, the request returns results for all game sessions in the fleet that are in ACTIVE status.
A filter expression can contain one or multiple conditions. Each condition consists of the following:
Operand -- Name of a game session attribute. Valid values are gameSessionName , gameSessionId , creationTimeMillis , playerSessionCount , maximumSessions , hasAvailablePlayerSessions .
Comparator -- Valid comparators are: = , <> , < , > , <= , >= .
Value -- Value to be searched for. Values can be numbers, boolean values (true/false) or strings. String values are case sensitive, enclosed in single quotes. Special characters must be escaped. Boolean and string values can only be used with the comparators = and <> . For example, the following filter expression searches on gameSessionName : "FilterExpression": "gameSessionName = 'Matt\\'s Awesome Game 1'" .
To chain multiple conditions in a single expression, use the logical keywords AND , OR , and NOT and parentheses as needed. For example: x AND y AND NOT z , NOT (x OR y) .
Session search evaluates conditions from left to right using the following precedence rules:
= , <> , < , > , <= , >=
Parentheses
NOT
AND
OR
For example, this filter expression retrieves game sessions hosting at least ten players that have an open player slot: "maximumSessions>=10 AND hasAvailablePlayerSessions=true" .
string
Instructions on how to sort the search results. If no sort expression is included, the request returns results in random order. A sort expression consists of the following elements:
Operand -- Name of a game session attribute. Valid values are gameSessionName , gameSessionId , creationTimeMillis , playerSessionCount , maximumSessions , hasAvailablePlayerSessions .
Order -- Valid sort orders are ASC (ascending) and DESC (descending).
For example, this sort expression returns the oldest active sessions first: "SortExpression": "creationTimeMillis ASC" . Results with a null value for the sort operand are returned at the end of the list.
integer
Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. The maximum number of results returned is 20, even if this value is not set or is set higher than 20.
string
Token indicating the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To specify the start of the result set, do not specify a value.
dict
Response Syntax
{ 'GameSessions': [ { 'GameSessionId': 'string', 'Name': 'string', 'FleetId': 'string', 'CreationTime': datetime(2015, 1, 1), 'TerminationTime': datetime(2015, 1, 1), 'CurrentPlayerSessionCount': 123, 'MaximumPlayerSessionCount': 123, 'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Represents the returned data in response to a request action.
GameSessions (list) --
Collection of objects containing game session properties for each session matching the request.
(dict) --
Properties describing a game session.
GameSessionId (string) --
Unique identifier for a game session. Game session ID format is as follows: "arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<ID string>". The value of <ID string> is either a custom ID string (if one was specified when the game session was created) an auto-generated string.
Name (string) --
Descriptive label associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players allowed in the game session.
Status (string) --
Current status of the game session. A game session must be in an ACTIVE status to have player sessions.
GameProperties (list) --
Set of custom properties for the game session.
(dict) --
Set of key-value pairs containing information a server process requires to set up a game session. This object allows you to pass in any set of data needed for your game. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
TBD
Value (string) --
TBD
IpAddress (string) --
IP address of the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
PlayerSessionCreationPolicy (string) --
Indicates whether or not the game session is accepting new players.
CreatorId (string) --
Player ID of the person or entity that created the game session. This ID is used to enforce a resource protection policy (if one exists) that limits the number of concurrent active game sessions one player can have.
NextToken (string) --
Token indicating where to resume retrieving results on the next call to this action. If no token is returned, these results represent the end of the list.
{'ResourceCreationLimitPolicy': {'NewGameSessionsPerCreator': 'integer', 'PolicyPeriodInMinutes': 'integer'}}
Updates fleet properties, including name and description, for a fleet. To update metadata, specify the fleet ID and the property values you want to change. If successful, the fleet ID for the updated fleet is returned.
Request Syntax
client.update_fleet_attributes( FleetId='string', Name='string', Description='string', NewGameSessionProtectionPolicy='NoProtection'|'FullProtection', ResourceCreationLimitPolicy={ 'NewGameSessionsPerCreator': 123, 'PolicyPeriodInMinutes': 123 } )
string
[REQUIRED]
Unique identifier for the fleet you want to update attribute metadata for.
string
Descriptive label associated with a fleet. Fleet names do not need to be unique.
string
Human-readable description of a fleet.
string
Game session protection policy to apply to all new instances created in this fleet. Instances that already exist are not affected. You can set protection for individual instances using UpdateGameSession .
NoProtection – The game session can be terminated during a scale-down event.
FullProtection – If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.
dict
Policy that limits the number of game sessions an individual player can create over a span of time.
NewGameSessionsPerCreator (integer) --
Maximum number of game sessions an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used to evaluate the resource creation limit policy.
dict
Response Syntax
{ 'FleetId': 'string' }
Response Structure
(dict) --
Represents the returned data in response to a request action.
FleetId (string) --
Unique identifier for the updated fleet.
{'GameSession': {'CreatorId': 'string', 'Status': ['ERROR']}}
Updates game session properties. This includes the session name, maximum player count, protection policy, which controls whether or not an active game session can be terminated during a scale-down event, and the player session creation policy, which controls whether or not new players can join the session. To update a game session, specify the game session ID and the values you want to change. If successful, an updated GameSession object is returned.
Request Syntax
client.update_game_session( GameSessionId='string', MaximumPlayerSessionCount=123, Name='string', PlayerSessionCreationPolicy='ACCEPT_ALL'|'DENY_ALL', ProtectionPolicy='NoProtection'|'FullProtection' )
string
[REQUIRED]
Unique identifier for the game session to update. Game session ID format is as follows: "arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<ID string>". The value of <ID string> is either a custom ID string (if one was specified when the game session was created) an auto-generated string.
integer
Maximum number of players that can be simultaneously connected to the game session.
string
Descriptive label associated with a game session. Session names do not need to be unique.
string
Policy determining whether or not the game session accepts new players.
string
Game session protection policy to apply to this game session only.
NoProtection – The game session can be terminated during a scale-down event.
FullProtection – If the game session is in an ACTIVE status, it cannot be terminated during a scale-down event.
dict
Response Syntax
{ 'GameSession': { 'GameSessionId': 'string', 'Name': 'string', 'FleetId': 'string', 'CreationTime': datetime(2015, 1, 1), 'TerminationTime': datetime(2015, 1, 1), 'CurrentPlayerSessionCount': 123, 'MaximumPlayerSessionCount': 123, 'Status': 'ACTIVE'|'ACTIVATING'|'TERMINATED'|'TERMINATING'|'ERROR', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string' } }
Response Structure
(dict) --
Represents the returned data in response to a request action.
GameSession (dict) --
Object containing the updated game session metadata.
GameSessionId (string) --
Unique identifier for a game session. Game session ID format is as follows: "arn:aws:gamelift:<region>::gamesession/fleet-<fleet ID>/<ID string>". The value of <ID string> is either a custom ID string (if one was specified when the game session was created) an auto-generated string.
Name (string) --
Descriptive label associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057".
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players allowed in the game session.
Status (string) --
Current status of the game session. A game session must be in an ACTIVE status to have player sessions.
GameProperties (list) --
Set of custom properties for the game session.
(dict) --
Set of key-value pairs containing information a server process requires to set up a game session. This object allows you to pass in any set of data needed for your game. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
TBD
Value (string) --
TBD
IpAddress (string) --
IP address of the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a GameLift server process, an app needs both the IP address and port number.
PlayerSessionCreationPolicy (string) --
Indicates whether or not the game session is accepting new players.
CreatorId (string) --
Player ID of the person or entity that created the game session. This ID is used to enforce a resource protection policy (if one exists) that limits the number of concurrent active game sessions one player can have.