exportStreamSessionFiles method
Export the files that your application modifies or generates in a stream session, which can help you debug or verify your application. When your application runs, it generates output files such as logs, diagnostic information, crash dumps, save files, user data, screenshots, and so on. The files can be defined by the engine or frameworks that your application uses, or information that you've programmed your application to output.
You can only call this action on a stream session that is in progress,
specifically in one of the following statuses ACTIVE,
CONNECTED, PENDING_CLIENT_RECONNECTION, and
RECONNECTING. You must provide an Amazon Simple Storage
Service (Amazon S3) bucket to store the files in. When the session ends,
Amazon GameLift Streams produces a compressed folder that contains all of
the files and directories that were modified or created by the application
during the stream session. AWS uses your security credentials to
authenticate and authorize access to your Amazon S3 bucket.
Amazon GameLift Streams collects the following generated and modified
files. Find them in the corresponding folders in the .zip
archive.
-
application/: The folder where your application or game is stored.
-
profile/: The user profile folder. -
temp/: The system temp folder.
To verify the status of the exported files, use GetStreamSession.
To delete the files, delete the object in the S3 bucket.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter identifier :
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.
Parameter outputUri :
The S3 bucket URI where Amazon GameLift Streams uploads the set of
compressed exported files for this stream session. Amazon GameLift Streams
generates a ZIP file name based on the stream session metadata.
Alternatively, you can provide a custom file name with a .zip
file extension.
Example 1: If you provide an S3 URI called
s3://amzn-s3-demo-destination-bucket/MyGame_Session1.zip,
then Amazon GameLift Streams will save the files at that location.
Example 2: If you provide an S3 URI called
s3://amzn-s3-demo-destination-bucket/MyGameSessions_ExportedFiles/,
then Amazon GameLift Streams will save the files at
s3://amzn-s3-demo-destination-bucket/MyGameSessions_ExportedFiles/YYYYMMDD-HHMMSS-appId-sg-Id-sessionId.zip
or another similar name.
Parameter streamSessionIdentifier :
An Amazon
Resource Name (ARN) or ID that uniquely identifies the stream session
resource. Example ARN:
arn:aws:gameliftstreams:us-west-2:111122223333:streamsession/sg-1AB2C3De4/ABC123def4567.
Example ID: ABC123def4567.
Implementation
Future<void> exportStreamSessionFiles({
required String identifier,
required String outputUri,
required String streamSessionIdentifier,
}) async {
final $payload = <String, dynamic>{
'OutputUri': outputUri,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/streamgroups/${Uri.encodeComponent(identifier)}/streamsessions/${Uri.encodeComponent(streamSessionIdentifier)}/exportfiles',
exceptionFnMap: _exceptionFns,
);
}