2018/02/15 - Amazon GameLift - 8 updated api methods
Changes Updates to allow Fleets to run on On-Demand or Spot instances.
{'FleetType': 'ON_DEMAND | SPOT'}Response
{'FleetAttributes': {'FleetType': 'ON_DEMAND | SPOT', 'InstanceType': '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 | r4.large | r4.xlarge | ' 'r4.2xlarge | r4.4xlarge | r4.8xlarge | ' 'r4.16xlarge | m3.medium | m3.large | ' 'm3.xlarge | m3.2xlarge | m4.large | ' 'm4.xlarge | m4.2xlarge | m4.4xlarge | ' 'm4.10xlarge'}}
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 set up a fleet to use instances with certain hardware specifications (see Amazon EC2 Instance Types for more information), and deploy your game build to run on each instance.
To create a new fleet, you must specify the following: (1) a fleet name, (2) the build ID of a successfully uploaded game build, (3) an EC2 instance type, and (4) a run-time configuration, which describes the server processes to run on each instance in the fleet. If you don't specify a fleet type (on-demand or spot), the new fleet uses on-demand instances by default.
You can also configure the new fleet with the following settings:
Fleet description
Access permissions for inbound traffic
Fleet-wide game session protection
Resource usage limits
VPC peering connection (see VPC Peering with Amazon GameLift Fleets )
If you use Amazon CloudWatch for metrics, you can add the new fleet to a metric group. By adding multiple fleets to a metric group, you can view aggregated metrics for all the fleets in the group.
If the CreateFleet call is successful, Amazon GameLift performs the following tasks. You can track the process of a fleet by checking the fleet status or by monitoring fleet creation events:
Creates a fleet record. Status: NEW .
Begins writing events to the fleet event log, which can be accessed in the Amazon GameLift console. Sets the fleet's target capacity to 1 (desired instances), which triggers Amazon GameLift to start one new EC2 instance.
Downloads the game build to the new instance and installs it. Statuses: DOWNLOADING , VALIDATING , BUILDING .
Starts launching server processes on the instance. If the fleet is configured to run multiple server processes per instance, Amazon GameLift staggers each launch by a few seconds. Status: ACTIVATING .
Sets the fleet's status to ACTIVE as soon as one server process is ready to host a game session.
Fleet-related operations include:
CreateFleet
ListFleets
Describe fleets:
DescribeFleetAttributes
DescribeFleetPortSettings
DescribeFleetUtilization
DescribeRuntimeConfiguration
DescribeFleetEvents
Update fleets:
UpdateFleetAttributes
UpdateFleetCapacity
UpdateFleetPortSettings
UpdateRuntimeConfiguration
Manage fleet capacity:
DescribeFleetCapacity
UpdateFleetCapacity
PutScalingPolicy (automatic scaling)
DescribeScalingPolicies (automatic scaling)
DeleteScalingPolicy (automatic scaling)
DescribeEC2InstanceLimits
DeleteFleet
See also: AWS API Documentation
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'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'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 }, ], 'MaxConcurrentGameSessionActivations': 123, 'GameSessionActivationTimeoutSeconds': 123 }, ResourceCreationLimitPolicy={ 'NewGameSessionsPerCreator': 123, 'PolicyPeriodInMinutes': 123 }, MetricGroups=[ 'string', ], PeerVpcAwsAccountId='string', PeerVpcId='string', FleetType='ON_DEMAND'|'SPOT' )
string
[REQUIRED]
Descriptive label that is associated with a fleet. Fleet names do not need to be unique.
string
Human-readable description of a fleet.
string
[REQUIRED]
Unique identifier for a build to be deployed on the new fleet. The build must have been successfully uploaded to Amazon 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 run-time 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 run-time configuration will continue to work.)
list
This parameter is no longer used. Instead, to specify where Amazon GameLift should store log files once a server process shuts down, use the Amazon GameLift server API ProcessReady() and specify one or more directory paths in logParameters . See more information in the Server API Reference .
(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. Amazon 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 Amazon 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 run-time 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 run-time configuration with at least one server process configuration; otherwise the request fails with an invalid request exception. (This parameter replaces the parameters ServerLaunchPath and ServerLaunchParameters ; requests that contain values for these parameters instead of a run-time configuration will continue to work.)
ServerProcesses (list) --
Collection of server process configurations that describe which 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 of the server executable in a game build. All game builds are installed on instances at the root : for Windows instances C:\game , and for Linux instances /local/game . A Windows game build with an executable file located at MyGame\latest\server.exe must have a launch path of "C:\game\MyGame\latest\server.exe ". A Linux game build with an executable file located at MyGame/latest/server.exe must have a launch path of "/local/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.
MaxConcurrentGameSessionActivations (integer) --
Maximum number of game sessions with status ACTIVATING to allow on an instance simultaneously. This setting limits the amount of instance resources that can be used for new game activations at any one time.
GameSessionActivationTimeoutSeconds (integer) --
Maximum amount of time (in seconds) that a game session can remain in status ACTIVATING . If the game session is not active before the timeout, activation is terminated and the game session status is changed to TERMINATED .
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 that an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used in evaluating the resource creation limit policy.
list
Name of a metric group to add this fleet to. A metric group tracks metrics across all fleets in the group. Use an existing metric group name to add this fleet to the group, or use a new name to create a new metric group. A fleet can only be included in one metric group at a time.
(string) --
string
Unique identifier for the AWS account with the VPC that you want to peer your Amazon GameLift fleet with. You can find your Account ID in the AWS Management Console under account settings.
string
Unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same region where your fleet is deployed. To get VPC information, including IDs, use the Virtual Private Cloud service tools, including the VPC Dashboard in the AWS Management Console.
string
Indicates whether to use on-demand instances or spot instances for this fleet. If empty, the default is ON_DEMAND. Both categories of instances use identical hardware and configurations, based on the instance type selected for this fleet. You can acquire on-demand instances at any time for a fixed price and keep them as long as you need them. Spot instances have lower prices, but spot pricing is variable, and while in use they can be interrupted (with a two-minute notification). Learn more about Amazon GameLift spot instances with at Choose Computing Resources .
dict
Response Syntax
{ 'FleetAttributes': { 'FleetId': 'string', 'FleetArn': 'string', 'FleetType': 'ON_DEMAND'|'SPOT', 'InstanceType': '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'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge', '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 }, 'MetricGroups': [ 'string', ] } }
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.
FleetArn (string) --
Identifier for a fleet that is unique across all regions.
FleetType (string) --
Indicates whether the fleet uses on-demand or spot instances. A spot instance in use may be interrupted with a two-minute notification.
InstanceType (string) --
EC2 instance type indicating the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. See Amazon EC2 Instance Types for detailed descriptions.
Description (string) --
Human-readable description of the fleet.
Name (string) --
Descriptive label that is 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 (for example "1469498468.057").
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "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 -- Amazon 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 before 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 before 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, Amazon GameLift automatically uploads logs that are stored on each instance at C:\game\logs (for Windows) or /local/game/logs (for Linux). Use the Amazon 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 that an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used in evaluating the resource creation limit policy.
MetricGroups (list) --
Names of metric groups that this fleet is included in. In Amazon CloudWatch, you can view metrics for an individual fleet or aggregated metrics for fleets that are in a fleet metric group. A fleet can be included in only one metric group at a time.
(string) --
{'GameSession': {'StatusReason': 'INTERRUPTED'}}
Creates a multiplayer game session for players. This action creates a game session record and assigns an available server process in the specified fleet to host the game session. A fleet must have an ACTIVE status before a game session can be created in it.
To create a game session, specify either fleet ID or alias ID and indicate a maximum number of players to allow in the game session. You can also provide a name and game-specific properties for this game session. If successful, a GameSession object is returned containing the game session properties and other settings you specified.
Idempotency tokens. You can add a token that uniquely identifies game session requests. This is useful for ensuring that game session requests are idempotent. Multiple requests with the same idempotency token are processed only once; subsequent requests return the original result. All response values are the same with the exception of game session status, which may change.
Resource creation limits. If you are creating a game session on a fleet with a resource creation limit policy in force, then you must specify a creator ID. Without this ID, Amazon GameLift has no way to evaluate the policy for this new game session request.
Player acceptance policy. By default, newly created game sessions are open to new players. You can restrict new player access by using UpdateGameSession to change the game session's player session creation policy.
Game session logs. Logs are retained for all active game sessions for 14 days. To access the logs, call GetGameSessionLogUrl to download the log files.
Available in Amazon GameLift Local.
Game-session-related operations include:
CreateGameSession
DescribeGameSessions
DescribeGameSessionDetails
SearchGameSessions
UpdateGameSession
GetGameSessionLogUrl
Game session placements
StartGameSessionPlacement
DescribeGameSessionPlacement
StopGameSessionPlacement
See also: AWS API Documentation
Request Syntax
client.create_game_session( FleetId='string', AliasId='string', MaximumPlayerSessionCount=123, Name='string', GameProperties=[ { 'Key': 'string', 'Value': 'string' }, ], CreatorId='string', GameSessionId='string', IdempotencyToken='string', GameSessionData='string' )
string
Unique identifier for a fleet to create a game session in. Each request must reference either a fleet ID or alias ID, but not both.
string
Unique identifier for an alias associated with the fleet to create a game session in. 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 that is associated with a game session. Session names do not need to be unique.
list
Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).
(dict) --
Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .
Key (string) -- [REQUIRED]
Game property identifier.
Value (string) -- [REQUIRED]
Game property value.
string
Unique identifier for a player 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
This parameter is no longer preferred. Please use ``IdempotencyToken`` instead. Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. (A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .)
string
Custom string that uniquely identifies a request for a new game session. Maximum token length is 48 characters. If provided, this string is included in the new game session's ID. (A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .) Idempotency tokens remain in use for 30 days after a game session has ended; game session objects are retained for this time period and then deleted.
string
Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).
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', 'StatusReason': 'INTERRUPTED', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string', 'GameSessionData': 'string', 'MatchmakerData': 'string' } }
Response Structure
(dict) --
Represents the returned data in response to a request action.
GameSession (dict) --
Object that describes the newly created game session record.
GameSessionId (string) --
Unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .
Name (string) --
Descriptive label that is associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet that the game session is running on.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players that can be connected simultaneously to the game session.
Status (string) --
Current status of the game session. A game session must have an ACTIVE status to have player sessions.
StatusReason (string) --
Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.
GameProperties (list) --
Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .
(dict) --
Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
Game property identifier.
Value (string) --
Game property value.
IpAddress (string) --
IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a Amazon GameLift game server, 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) --
Unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.
GameSessionData (string) --
Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).
MatchmakerData (string) --
Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).
{'FleetAttributes': {'FleetType': 'ON_DEMAND | SPOT', 'InstanceType': '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 | r4.large | r4.xlarge | ' 'r4.2xlarge | r4.4xlarge | r4.8xlarge | ' 'r4.16xlarge | m3.medium | m3.large | ' 'm3.xlarge | m3.2xlarge | m4.large | ' 'm4.xlarge | m4.2xlarge | m4.4xlarge | ' 'm4.10xlarge'}}
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.
Fleet-related operations include:
CreateFleet
ListFleets
Describe fleets:
DescribeFleetAttributes
DescribeFleetPortSettings
DescribeFleetUtilization
DescribeRuntimeConfiguration
DescribeFleetEvents
Update fleets:
UpdateFleetAttributes
UpdateFleetCapacity
UpdateFleetPortSettings
UpdateRuntimeConfiguration
Manage fleet capacity:
DescribeFleetCapacity
UpdateFleetCapacity
PutScalingPolicy (automatic scaling)
DescribeScalingPolicies (automatic scaling)
DeleteScalingPolicy (automatic scaling)
DescribeEC2InstanceLimits
DeleteFleet
See also: AWS API Documentation
Request Syntax
client.describe_fleet_attributes( FleetIds=[ 'string', ], Limit=123, NextToken='string' )
list
Unique identifier for a fleet(s) 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 that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning 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', 'FleetArn': 'string', 'FleetType': 'ON_DEMAND'|'SPOT', 'InstanceType': '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'|'r4.large'|'r4.xlarge'|'r4.2xlarge'|'r4.4xlarge'|'r4.8xlarge'|'r4.16xlarge'|'m3.medium'|'m3.large'|'m3.xlarge'|'m3.2xlarge'|'m4.large'|'m4.xlarge'|'m4.2xlarge'|'m4.4xlarge'|'m4.10xlarge', '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 }, 'MetricGroups': [ 'string', ] }, ], '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.
Fleet-related operations include:
CreateFleet
ListFleets
Describe fleets:
DescribeFleetAttributes
DescribeFleetPortSettings
DescribeFleetUtilization
DescribeRuntimeConfiguration
DescribeFleetEvents
Update fleets:
UpdateFleetAttributes
UpdateFleetCapacity
UpdateFleetPortSettings
UpdateRuntimeConfiguration
Manage fleet capacity:
DescribeFleetCapacity
UpdateFleetCapacity
PutScalingPolicy (automatic scaling)
DescribeScalingPolicies (automatic scaling)
DeleteScalingPolicy (automatic scaling)
DescribeEC2InstanceLimits
DeleteFleet
FleetId (string) --
Unique identifier for a fleet.
FleetArn (string) --
Identifier for a fleet that is unique across all regions.
FleetType (string) --
Indicates whether the fleet uses on-demand or spot instances. A spot instance in use may be interrupted with a two-minute notification.
InstanceType (string) --
EC2 instance type indicating the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. See Amazon EC2 Instance Types for detailed descriptions.
Description (string) --
Human-readable description of the fleet.
Name (string) --
Descriptive label that is 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 (for example "1469498468.057").
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "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 -- Amazon 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 before 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 before 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, Amazon GameLift automatically uploads logs that are stored on each instance at C:\game\logs (for Windows) or /local/game/logs (for Linux). Use the Amazon 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 that an individual can create during the policy period.
PolicyPeriodInMinutes (integer) --
Time span used in evaluating the resource creation limit policy.
MetricGroups (list) --
Names of metric groups that this fleet is included in. In Amazon CloudWatch, you can view metrics for an individual fleet or aggregated metrics for fleets that are in a fleet metric group. A fleet can be included in only one metric group at a time.
(string) --
NextToken (string) --
Token that indicates 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.
{'Events': {'EventCode': ['INSTANCE_INTERRUPTED']}}
Retrieves entries from the specified fleet's event log. You can specify a time range to limit the result set. Use the pagination parameters to retrieve results as a set of sequential pages. If successful, a collection of event log entries matching the request are returned.
Fleet-related operations include:
CreateFleet
ListFleets
Describe fleets:
DescribeFleetAttributes
DescribeFleetPortSettings
DescribeFleetUtilization
DescribeRuntimeConfiguration
DescribeFleetEvents
Update fleets:
UpdateFleetAttributes
UpdateFleetCapacity
UpdateFleetPortSettings
UpdateRuntimeConfiguration
Manage fleet capacity:
DescribeFleetCapacity
UpdateFleetCapacity
PutScalingPolicy (automatic scaling)
DescribeScalingPolicies (automatic scaling)
DeleteScalingPolicy (automatic scaling)
DescribeEC2InstanceLimits
DeleteFleet
See also: AWS API Documentation
Request Syntax
client.describe_fleet_events( FleetId='string', StartTime=datetime(2015, 1, 1), EndTime=datetime(2015, 1, 1), Limit=123, NextToken='string' )
string
[REQUIRED]
Unique identifier for a fleet to get event logs for.
datetime
Earliest date to retrieve event logs for. If no start time is specified, this call returns entries starting from when the fleet was created to the specified end time. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057").
datetime
Most recent date to retrieve event logs for. If no end time is specified, this call returns entries from the specified start time up to the present. Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057").
integer
Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.
string
Token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning of the result set, do not specify a value.
dict
Response Syntax
{ 'Events': [ { 'EventId': 'string', 'ResourceId': 'string', 'EventCode': 'GENERIC_EVENT'|'FLEET_CREATED'|'FLEET_DELETED'|'FLEET_SCALING_EVENT'|'FLEET_STATE_DOWNLOADING'|'FLEET_STATE_VALIDATING'|'FLEET_STATE_BUILDING'|'FLEET_STATE_ACTIVATING'|'FLEET_STATE_ACTIVE'|'FLEET_STATE_ERROR'|'FLEET_INITIALIZATION_FAILED'|'FLEET_BINARY_DOWNLOAD_FAILED'|'FLEET_VALIDATION_LAUNCH_PATH_NOT_FOUND'|'FLEET_VALIDATION_EXECUTABLE_RUNTIME_FAILURE'|'FLEET_VALIDATION_TIMED_OUT'|'FLEET_ACTIVATION_FAILED'|'FLEET_ACTIVATION_FAILED_NO_INSTANCES'|'FLEET_NEW_GAME_SESSION_PROTECTION_POLICY_UPDATED'|'SERVER_PROCESS_INVALID_PATH'|'SERVER_PROCESS_SDK_INITIALIZATION_TIMEOUT'|'SERVER_PROCESS_PROCESS_READY_TIMEOUT'|'SERVER_PROCESS_CRASHED'|'SERVER_PROCESS_TERMINATED_UNHEALTHY'|'SERVER_PROCESS_FORCE_TERMINATED'|'SERVER_PROCESS_PROCESS_EXIT_TIMEOUT'|'GAME_SESSION_ACTIVATION_TIMEOUT'|'FLEET_CREATION_EXTRACTING_BUILD'|'FLEET_CREATION_RUNNING_INSTALLER'|'FLEET_CREATION_VALIDATING_RUNTIME_CONFIG'|'FLEET_VPC_PEERING_SUCCEEDED'|'FLEET_VPC_PEERING_FAILED'|'FLEET_VPC_PEERING_DELETED'|'INSTANCE_INTERRUPTED', 'Message': 'string', 'EventTime': datetime(2015, 1, 1), 'PreSignedLogUrl': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Represents the returned data in response to a request action.
Events (list) --
Collection of objects containing event log entries for the specified fleet.
(dict) --
Log entry describing an event that involves Amazon GameLift resources (such as a fleet). In addition to tracking activity, event codes and messages can provide additional information for troubleshooting and debugging problems.
EventId (string) --
Unique identifier for a fleet event.
ResourceId (string) --
Unique identifier for an event resource, such as a fleet ID.
EventCode (string) --
Type of event being logged. The following events are currently in use:
Fleet creation events:
FLEET_CREATED -- A fleet record was successfully created with a status of NEW . Event messaging includes the fleet ID.
FLEET_STATE_DOWNLOADING -- Fleet status changed from NEW to DOWNLOADING . The compressed build has started downloading to a fleet instance for installation.
FLEET_BINARY_DOWNLOAD_FAILED -- The build failed to download to the fleet instance.
FLEET_CREATION_EXTRACTING_BUILD – The game server build was successfully downloaded to an instance, and the build files are now being extracted from the uploaded build and saved to an instance. Failure at this stage prevents a fleet from moving to ACTIVE status. Logs for this stage display a list of the files that are extracted and saved on the instance. Access the logs by using the URL in PreSignedLogUrl .
FLEET_CREATION_RUNNING_INSTALLER – The game server build files were successfully extracted, and the Amazon GameLift is now running the build's install script (if one is included). Failure in this stage prevents a fleet from moving to ACTIVE status. Logs for this stage list the installation steps and whether or not the install completed successfully. Access the logs by using the URL in PreSignedLogUrl .
FLEET_CREATION_VALIDATING_RUNTIME_CONFIG -- The build process was successful, and the Amazon GameLift is now verifying that the game server launch paths, which are specified in the fleet's run-time configuration, exist. If any listed launch path exists, Amazon GameLift tries to launch a game server process and waits for the process to report ready. Failures in this stage prevent a fleet from moving to ACTIVE status. Logs for this stage list the launch paths in the run-time configuration and indicate whether each is found. Access the logs by using the URL in PreSignedLogUrl .
FLEET_STATE_VALIDATING -- Fleet status changed from DOWNLOADING to VALIDATING .
FLEET_VALIDATION_LAUNCH_PATH_NOT_FOUND -- Validation of the run-time configuration failed because the executable specified in a launch path does not exist on the instance.
FLEET_STATE_BUILDING -- Fleet status changed from VALIDATING to BUILDING .
FLEET_VALIDATION_EXECUTABLE_RUNTIME_FAILURE -- Validation of the run-time configuration failed because the executable specified in a launch path failed to run on the fleet instance.
FLEET_STATE_ACTIVATING -- Fleet status changed from BUILDING to ACTIVATING .
FLEET_ACTIVATION_FAILED - The fleet failed to successfully complete one of the steps in the fleet activation process. This event code indicates that the game build was successfully downloaded to a fleet instance, built, and validated, but was not able to start a server process. A possible reason for failure is that the game server is not reporting "process ready" to the Amazon GameLift service.
FLEET_STATE_ACTIVE -- The fleet's status changed from ACTIVATING to ACTIVE . The fleet is now ready to host game sessions.
VPC peering events:
FLEET_VPC_PEERING_SUCCEEDED -- A VPC peering connection has been established between the VPC for an Amazon GameLift fleet and a VPC in your AWS account.
FLEET_VPC_PEERING_FAILED -- A requested VPC peering connection has failed. Event details and status information (see DescribeVpcPeeringConnections ) provide additional detail. A common reason for peering failure is that the two VPCs have overlapping CIDR blocks of IPv4 addresses. To resolve this, change the CIDR block for the VPC in your AWS account. For more information on VPC peering failures, see http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/invalid-peering-configurations.html
FLEET_VPC_PEERING_DELETED -- A VPC peering connection has been successfully deleted.
Spot instance events:
INSTANCE_INTERRUPTED -- A spot instance was interrupted by EC2 with a two-minute notification.
Other fleet events:
FLEET_SCALING_EVENT -- A change was made to the fleet's capacity settings (desired instances, minimum/maximum scaling limits). Event messaging includes the new capacity settings.
FLEET_NEW_GAME_SESSION_PROTECTION_POLICY_UPDATED -- A change was made to the fleet's game session protection policy setting. Event messaging includes both the old and new policy setting.
FLEET_DELETED -- A request to delete a fleet was initiated.
GENERIC_EVENT -- An unspecified event has occurred.
Message (string) --
Additional information related to the event.
EventTime (datetime) --
Time stamp indicating when this event occurred. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
PreSignedLogUrl (string) --
Location of stored logs with additional detail that is related to the event. This is useful for debugging issues. The URL is valid for 15 minutes. You can also access fleet creation logs through the Amazon GameLift console.
NextToken (string) --
Token that indicates 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': {'StatusReason': 'INTERRUPTED'}}}
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 or GameSessionArn 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.
Game-session-related operations include:
CreateGameSession
DescribeGameSessions
DescribeGameSessionDetails
SearchGameSessions
UpdateGameSession
GetGameSessionLogUrl
Game session placements
StartGameSessionPlacement
DescribeGameSessionPlacement
StopGameSessionPlacement
See also: AWS API Documentation
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 to retrieve all game sessions active on the fleet.
string
Unique identifier for the game session to retrieve.
string
Unique identifier for an alias associated with the fleet to retrieve all game sessions for.
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 that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning 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', 'StatusReason': 'INTERRUPTED', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string', 'GameSessionData': 'string', 'MatchmakerData': '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 plus the protection policy currently in force.
GameSession (dict) --
Object that describes a game session.
GameSessionId (string) --
Unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .
Name (string) --
Descriptive label that is associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet that the game session is running on.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players that can be connected simultaneously to the game session.
Status (string) --
Current status of the game session. A game session must have an ACTIVE status to have player sessions.
StatusReason (string) --
Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.
GameProperties (list) --
Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .
(dict) --
Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
Game property identifier.
Value (string) --
Game property value.
IpAddress (string) --
IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a Amazon GameLift game server, 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) --
Unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.
GameSessionData (string) --
Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).
MatchmakerData (string) --
Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).
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 that indicates 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': {'StatusReason': 'INTERRUPTED'}}
Retrieves a set of one or more game sessions. Request a specific game session or request all game sessions on a fleet. Alternatively, use SearchGameSessions to request a set of active game sessions that are filtered by certain criteria. To retrieve protection policy settings for game sessions, use DescribeGameSessionDetails .
To get game sessions, specify 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 game session matching the request.
Available in Amazon GameLift Local.
Game-session-related operations include:
CreateGameSession
DescribeGameSessions
DescribeGameSessionDetails
SearchGameSessions
UpdateGameSession
GetGameSessionLogUrl
Game session placements
StartGameSessionPlacement
DescribeGameSessionPlacement
StopGameSessionPlacement
See also: AWS API Documentation
Request Syntax
client.describe_game_sessions( FleetId='string', GameSessionId='string', AliasId='string', StatusFilter='string', Limit=123, NextToken='string' )
string
Unique identifier for a fleet to retrieve all game sessions for.
string
Unique identifier for the game session to retrieve. You can use either a GameSessionId or GameSessionArn value.
string
Unique identifier for an alias associated with the fleet to retrieve all game sessions for.
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 that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning 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', 'StatusReason': 'INTERRUPTED', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string', 'GameSessionData': 'string', 'MatchmakerData': '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.
A game session in ACTIVE status can host players. When a game session ends, its status is set to TERMINATED .
Once the session ends, the game session object is retained for 30 days. This means you can reuse idempotency token values after this time. Game session logs are retained for 14 days.
Game-session-related operations include:
CreateGameSession
DescribeGameSessions
DescribeGameSessionDetails
SearchGameSessions
UpdateGameSession
GetGameSessionLogUrl
Game session placements
StartGameSessionPlacement
DescribeGameSessionPlacement
StopGameSessionPlacement
GameSessionId (string) --
Unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .
Name (string) --
Descriptive label that is associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet that the game session is running on.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players that can be connected simultaneously to the game session.
Status (string) --
Current status of the game session. A game session must have an ACTIVE status to have player sessions.
StatusReason (string) --
Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.
GameProperties (list) --
Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .
(dict) --
Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
Game property identifier.
Value (string) --
Game property value.
IpAddress (string) --
IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a Amazon GameLift game server, 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) --
Unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.
GameSessionData (string) --
Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).
MatchmakerData (string) --
Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).
NextToken (string) --
Token that indicates 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': {'StatusReason': 'INTERRUPTED'}}
Retrieves all active game sessions that match a set of search criteria and sorts them in a specified order. You can search or sort by the following game session attributes:
gameSessionId -- Unique identifier for the game session. You can use either a GameSessionId or GameSessionArn value.
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.
gameSessionProperties -- Custom data defined in a game session's GameProperty parameter. GameProperty values are stored as key:value pairs; the filter expression must indicate the key and a string to search the data values for. For example, to search for game sessions with custom data containing the key:value pair "gameMode:brawl", specify the following: gameSessionProperties.gameMode = "brawl". All custom data values are searched as strings.
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 .
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.
hasAvailablePlayerSessions -- Boolean value indicating whether a game session has reached its maximum number of players. It is highly recommended that all search requests include this filter attribute to optimize search performance and return only sessions that players can join.
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.
To search or sort, specify either a fleet ID or an alias ID, and provide a search filter expression, a sort expression, or both. If successful, a collection of GameSession objects matching the request is returned. Use the pagination parameters to retrieve results as a set of sequential pages.
You can search for game sessions one fleet at a time only. To find game sessions across multiple fleets, you must search each fleet separately and combine the results. This search feature finds only game sessions that are in ACTIVE status. To locate games in statuses other than active, use DescribeGameSessionDetails .
Game-session-related operations include:
CreateGameSession
DescribeGameSessions
DescribeGameSessionDetails
SearchGameSessions
UpdateGameSession
GetGameSessionLogUrl
Game session placements
StartGameSessionPlacement
DescribeGameSessionPlacement
StopGameSessionPlacement
See also: AWS API Documentation
Request Syntax
client.search_game_sessions( FleetId='string', AliasId='string', FilterExpression='string', SortExpression='string', Limit=123, NextToken='string' )
string
Unique identifier for a fleet to search for active game sessions. Each request must reference either a fleet ID or alias ID, but not both.
string
Unique identifier for an alias associated with the fleet to search for active game sessions. 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 , gameSessionProperties , maximumSessions , creationTimeMillis , playerSessionCount , hasAvailablePlayerSessions .
Comparator -- Valid comparators are: = , <> , < , > , <= , >= .
Value -- Value to be searched for. Values may be numbers, boolean values (true/false) or strings depending on the operand. String values are case sensitive and must be 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 , gameSessionProperties , maximumSessions , creationTimeMillis , playerSessionCount , 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 that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning 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', 'StatusReason': 'INTERRUPTED', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string', 'GameSessionData': 'string', 'MatchmakerData': '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.
A game session in ACTIVE status can host players. When a game session ends, its status is set to TERMINATED .
Once the session ends, the game session object is retained for 30 days. This means you can reuse idempotency token values after this time. Game session logs are retained for 14 days.
Game-session-related operations include:
CreateGameSession
DescribeGameSessions
DescribeGameSessionDetails
SearchGameSessions
UpdateGameSession
GetGameSessionLogUrl
Game session placements
StartGameSessionPlacement
DescribeGameSessionPlacement
StopGameSessionPlacement
GameSessionId (string) --
Unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .
Name (string) --
Descriptive label that is associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet that the game session is running on.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players that can be connected simultaneously to the game session.
Status (string) --
Current status of the game session. A game session must have an ACTIVE status to have player sessions.
StatusReason (string) --
Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.
GameProperties (list) --
Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .
(dict) --
Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
Game property identifier.
Value (string) --
Game property value.
IpAddress (string) --
IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a Amazon GameLift game server, 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) --
Unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.
GameSessionData (string) --
Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).
MatchmakerData (string) --
Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).
NextToken (string) --
Token that indicates 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.
{'GameSession': {'StatusReason': 'INTERRUPTED'}}
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.
Game-session-related operations include:
CreateGameSession
DescribeGameSessions
DescribeGameSessionDetails
SearchGameSessions
UpdateGameSession
GetGameSessionLogUrl
Game session placements
StartGameSessionPlacement
DescribeGameSessionPlacement
StopGameSessionPlacement
See also: AWS API Documentation
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.
integer
Maximum number of players that can be connected simultaneously to the game session.
string
Descriptive label that is 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', 'StatusReason': 'INTERRUPTED', 'GameProperties': [ { 'Key': 'string', 'Value': 'string' }, ], 'IpAddress': 'string', 'Port': 123, 'PlayerSessionCreationPolicy': 'ACCEPT_ALL'|'DENY_ALL', 'CreatorId': 'string', 'GameSessionData': 'string', 'MatchmakerData': 'string' } }
Response Structure
(dict) --
Represents the returned data in response to a request action.
GameSession (dict) --
Object that contains the updated game session metadata.
GameSessionId (string) --
Unique identifier for the game session. A game session ARN has the following format: arn:aws:gamelift:<region>::gamesession/<fleet ID>/<custom ID string or idempotency token> .
Name (string) --
Descriptive label that is associated with a game session. Session names do not need to be unique.
FleetId (string) --
Unique identifier for a fleet that the game session is running on.
CreationTime (datetime) --
Time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
TerminationTime (datetime) --
Time stamp indicating when this data object was terminated. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
CurrentPlayerSessionCount (integer) --
Number of players currently in the game session.
MaximumPlayerSessionCount (integer) --
Maximum number of players that can be connected simultaneously to the game session.
Status (string) --
Current status of the game session. A game session must have an ACTIVE status to have player sessions.
StatusReason (string) --
Provides additional information about game session status. INTERRUPTED indicates that the game session was hosted on a spot instance that was reclaimed, causing the active game session to be terminated.
GameProperties (list) --
Set of custom properties for a game session, formatted as key:value pairs. These properties are passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ). You can search for active game sessions based on this custom data with SearchGameSessions .
(dict) --
Set of key-value pairs that contain information about a game session. When included in a game session request, these properties communicate details to be used when setting up the new game session, such as to specify a game mode, level, or map. Game properties are passed to the game server process when initiating a new game session; the server process uses the properties as appropriate. For more information, see the Amazon GameLift Developer Guide .
Key (string) --
Game property identifier.
Value (string) --
Game property value.
IpAddress (string) --
IP address of the game session. To connect to a Amazon GameLift game server, an app needs both the IP address and port number.
Port (integer) --
Port number for the game session. To connect to a Amazon GameLift game server, 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) --
Unique identifier for a player. This ID is used to enforce a resource protection policy (if one exists), that limits the number of game sessions a player can create.
GameSessionData (string) --
Set of custom game session properties, formatted as a single string value. This data is passed to a game server process in the GameSession object with a request to start a new game session (see Start a Game Session ).
MatchmakerData (string) --
Information about the matchmaking process that was used to create the game session. It is in JSON syntax, formated as a string. In addition the matchmaking configuration used, it contains data on all players assigned to the match, including player attributes and team assignments. For more details on matchmaker data, see Match Data . Matchmaker data is useful when requesting match backfills, and is updated whenever new players are added during a successful backfill (see StartMatchBackfill ).