GameLiftStreams / Client / create_stream_url
create_stream_url¶
- GameLiftStreams.Client.create_stream_url(**kwargs)¶
Creates a stream URL that grants temporary access to a stream session in a web browser without requiring an Amazon Web Services account or client integration.
You can use the stream URL to start a stream session up to the number of times set by
UsageLimit, until it expires afterUrlExpiresAfterMinutes. Each successful use starts a new stream session.To make the request idempotent, provide a
ClientToken.See also: AWS API Documentation
Request Syntax
response = client.create_stream_url( Identifier='string', ApplicationIdentifier='string', Protocol='WebRTC', UrlExpiresAfterMinutes=123, UsageLimit=123, Description='string', Locations=[ 'string', ], SessionLengthSeconds=123, AdditionalLaunchArgs=[ 'string', ], AdditionalEnvironmentVariables={ 'string': 'string' }, RoleArn='string', DisplayConfiguration={ 'Resolution': { 'Width': 123, 'Height': 123 } }, ClientToken='string' )
- Parameters:
Identifier (string) –
[REQUIRED]
An Amazon Resource Name (ARN) or ID that uniquely identifies the stream group resource. Example ARN:
arn:aws:gameliftstreams:us-west-2:111122223333:streamgroup/sg-1AB2C3De4. Example ID:sg-1AB2C3De4.The stream session runs in this stream group.
ApplicationIdentifier (string) –
[REQUIRED]
An Amazon Resource Name (ARN) or ID that uniquely identifies the application resource. Example ARN:
arn:aws:gameliftstreams:us-west-2:111122223333:application/a-9ZY8X7Wv6. Example ID:a-9ZY8X7Wv6.This application must be associated with the stream group.
Protocol (string) –
[REQUIRED]
The data transport protocol for the stream session. Amazon GameLift Streams supports
WebRTC.UrlExpiresAfterMinutes (integer) –
[REQUIRED]
The number of minutes after creation that the stream URL remains valid. After this period, the status of the stream URL changes to
EXPIREDand it can no longer start stream sessions. The minimum is 1 minute. For the maximum, see Regions, quotas, and limitations in the Amazon GameLift Streams Developer Guide.UsageLimit (integer) – The maximum number of times the stream URL can start a stream session. Each successful use reduces the remaining uses by one. The minimum is 1, and the default is 1. For the maximum, see Regions, quotas, and limitations in the Amazon GameLift Streams Developer Guide.
Description (string) – A descriptive label for the stream URL.
Locations (list) –
[REQUIRED]
A list of locations, in order of preference, where Amazon GameLift Streams can place the stream session. Specify each location by its Amazon Web Services Region code, for example
us-east-1. For a complete list of locations that Amazon GameLift Streams supports, refer to Regions, quotas, and limitations in the Amazon GameLift Streams Developer Guide.(string) –
SessionLengthSeconds (integer) – The maximum length of time, in seconds, that a stream session started from this stream URL can run. Valid values are 1-86400 seconds (1 second to 24 hours). The default is 43200 seconds (12 hours).
AdditionalLaunchArgs (list) –
A list of CLI arguments that are sent to the streaming server when a stream session launches. You can use this to configure the application or stream session details. You can also provide custom arguments that Amazon GameLift Streams passes to your game client.
AdditionalEnvironmentVariablesandAdditionalLaunchArgshave similar purposes.AdditionalEnvironmentVariablespasses data using environment variables; whileAdditionalLaunchArgspasses data using command-line arguments.(string) –
AdditionalEnvironmentVariables (dict) –
A set of options that you can use to control the stream session runtime environment, expressed as a set of key-value pairs. You can use this to configure the application or stream session details. You can also provide custom environment variables that Amazon GameLift Streams passes to your game client.
Note
If you want to debug your application with environment variables, we recommend that you do so in a local environment outside of Amazon GameLift Streams. For more information, refer to the Compatibility Guidance in the troubleshooting section of the Developer Guide.
AdditionalEnvironmentVariablesandAdditionalLaunchArgshave similar purposes.AdditionalEnvironmentVariablespasses data using environment variables; whileAdditionalLaunchArgspasses data using command-line arguments.(string) –
(string) –
RoleArn (string) – The Amazon Resource Name (ARN) of the IAM role that Amazon GameLift Streams assumes during stream sessions started from this stream URL. For more information, see Provide AWS credentials to your streaming application in the Amazon GameLift Streams Developer Guide.
DisplayConfiguration (dict) –
The display settings, such as resolution, for stream sessions started from this stream URL.
Resolution (dict) –
The resolution to apply to the stream session’s virtual monitor. When specified, this value overrides the default resolution of 1920 × 1080.
Width (integer) – [REQUIRED]
The width of the stream session’s virtual monitor, in pixels. The value must be an even number.
Height (integer) – [REQUIRED]
The height of the stream session’s virtual monitor, in pixels. The value must be an even number.
ClientToken (string) –
A unique, case-sensitive identifier that you provide to ensure this request is idempotent. If you retry a request with the same
ClientToken, Amazon GameLift Streams returns the original response without performing the operation again.This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'Arn': 'string', 'StreamUrlId': 'string', 'StreamUrl': 'string', 'Status': 'ACTIVE'|'EXPIRED'|'REVOKED'|'LIMIT_REACHED', 'StatusReason': 'userRevoked'|'revokedAndTerminatingSessions'|'revokedAndSessionsTerminated'|'streamGroupDeleted'|'applicationDeleted', 'ExpiresAt': datetime(2015, 1, 1), 'CreatedAt': datetime(2015, 1, 1), 'UsageLimit': 123, 'RemainingUses': 123, 'StreamGroupArn': 'string', 'ApplicationArn': 'string', 'Protocol': 'WebRTC', 'Locations': [ 'string', ], 'SessionLengthSeconds': 123, 'Description': 'string', 'AdditionalLaunchArgs': [ 'string', ], 'AdditionalEnvironmentVariables': { 'string': 'string' }, 'RoleArn': 'string', 'DisplayConfiguration': { 'Resolution': { 'Width': 123, 'Height': 123 } } }
Response Structure
(dict) –
Arn (string) –
The Amazon Resource Name (ARN) that uniquely identifies the stream URL across all Amazon Web Services Regions. Format is
arn:aws:gameliftstreams:[AWS Region]:[AWS account]:streamurl/[stream group resource ID]/[stream URL resource ID].StreamUrlId (string) –
The unique identifier for the stream URL resource, for example
su-1AB2C3De4.StreamUrl (string) –
The shareable stream URL. Distribute this URL to end users so that they can start and play a stream session in a hosted web player. Treat the stream URL as a secret. Anyone who has it can start a stream session until the stream URL expires, is revoked, or reaches its usage limit.
Status (string) –
The current status of the stream URL. Possible statuses include the following:
ACTIVE: The stream URL is valid and can start stream sessions.EXPIRED: The stream URL has passed its expiration time and can no longer start stream sessions.REVOKED: The stream URL was revoked and can no longer start stream sessions.LIMIT_REACHED: The stream URL has been used the maximum number of times and can no longer start stream sessions.
StatusReason (string) –
Additional information about why the stream URL is in its current status. Amazon GameLift Streams populates this value when the status is
REVOKED. Possible values include the following:userRevoked: You revoked the stream URL.revokedAndTerminatingSessions: You revoked the stream URL and Amazon GameLift Streams is ending its running stream sessions.revokedAndSessionsTerminated: You revoked the stream URL and its running stream sessions have ended.streamGroupDeleted: The stream group was deleted, which revoked the stream URL.applicationDeleted: The application was deleted, which revoked the stream URL.
ExpiresAt (datetime) –
The date and time when the stream URL expires and stops accepting new stream sessions. Timestamps are expressed using in ISO8601 format, such as:
2022-12-27T22:29:40+00:00(UTC).CreatedAt (datetime) –
A timestamp that indicates when this resource was created. Timestamps are expressed using in ISO8601 format, such as:
2022-12-27T22:29:40+00:00(UTC).UsageLimit (integer) –
The maximum number of times the stream URL can start a stream session.
RemainingUses (integer) –
The number of times the stream URL can still be used to start a stream session.
StreamGroupArn (string) –
The stream group that runs the stream sessions.
This value is an Amazon Resource Name (ARN) that uniquely identifies the stream group resource. Example ARN:
arn:aws:gameliftstreams:us-west-2:111122223333:streamgroup/sg-1AB2C3De4.ApplicationArn (string) –
The application that runs in the stream sessions.
This value is an Amazon Resource Name (ARN) that uniquely identifies the application resource. Example ARN:
arn:aws:gameliftstreams:us-west-2:111122223333:application/a-9ZY8X7Wv6.Protocol (string) –
The data transport protocol used for stream sessions started from this stream URL.
Locations (list) –
The list of locations, in order of preference, where Amazon GameLift Streams places the stream session. For a complete list of locations that Amazon GameLift Streams supports, refer to Regions, quotas, and limitations in the Amazon GameLift Streams Developer Guide.
(string) –
SessionLengthSeconds (integer) –
The maximum length of time, in seconds, that a stream session started from this stream URL can run.
Description (string) –
The descriptive label for the stream URL.
AdditionalLaunchArgs (list) –
The command-line arguments passed to the application when a stream session starts.
(string) –
AdditionalEnvironmentVariables (dict) –
The environment variables made available to the application when a stream session starts.
(string) –
(string) –
RoleArn (string) –
The Amazon Resource Name (ARN) of the IAM role that Amazon GameLift Streams assumes during stream sessions started from this stream URL. For more information, see Provide AWS credentials to your streaming application in the Amazon GameLift Streams Developer Guide.
DisplayConfiguration (dict) –
The display settings, such as resolution, for stream sessions started from this stream URL.
Resolution (dict) –
The resolution to apply to the stream session’s virtual monitor. When specified, this value overrides the default resolution of 1920 × 1080.
Width (integer) –
The width of the stream session’s virtual monitor, in pixels. The value must be an even number.
Height (integer) –
The height of the stream session’s virtual monitor, in pixels. The value must be an even number.
Exceptions
GameLiftStreams.Client.exceptions.AccessDeniedExceptionGameLiftStreams.Client.exceptions.ResourceNotFoundExceptionGameLiftStreams.Client.exceptions.ThrottlingExceptionGameLiftStreams.Client.exceptions.InternalServerExceptionGameLiftStreams.Client.exceptions.ConflictExceptionGameLiftStreams.Client.exceptions.ValidationExceptionGameLiftStreams.Client.exceptions.ServiceQuotaExceededException