Retrieves a list of Amazon GameLift Streams stream sessions that a stream group is hosting.
To retrieve stream sessions, specify the stream group, and optionally filter by stream session status. You can paginate the results as needed.
This operation returns the requested stream sessions in no particular order.
Parameters:
-
status
(Optional[StreamSessionStatus], default:
None
)
–
Filter by the stream session status. You can specify one status in each request to retrieve only sessions that are currently in that status.
-
export_files_status
(Optional[ExportFilesStatus], default:
None
)
–
Filter by the exported files status. You can specify one status in each request to retrieve only sessions that currently have that exported files status.
Exported files can be in one of the following states:
-
SUCCEEDED: The exported files are successfully stored in an S3 bucket.
-
FAILED: The session ended but Amazon GameLift Streams couldn't collect and upload the files to S3.
-
PENDING: Either the stream session is still in progress, or uploading the exported files to the S3 bucket is in progress.
-
next_token
(Optional[NextToken], default:
None
)
–
The token that marks the start of the next set of results. Use this token when you retrieve results as sequential pages. To get the first page of results, omit a token value. To get the remaining pages, provide the token returned with the previous result set.
-
max_results
(Optional[MaxResults], default:
None
)
–
The number of results to return. Use this parameter with NextToken to return results in sequential pages. Default value is 25.
-
identifier
(Identifier)
–
The unique identifier of a Amazon GameLift Streams stream group to retrieve the stream session for. You can use either the stream group ID or the Amazon Resource Name (ARN).
Raises:
-
AccessDeniedException
–
You don't have the required permissions to access this Amazon GameLift Streams resource. Correct the permissions before you try again.
-
InternalServerException
–
The service encountered an internal error and is unable to complete the request.
-
ResourceNotFoundException
–
The resource specified in the request was not found. Correct the request before you try again.
-
ThrottlingException
–
The request was denied due to request throttling. Retry the request after the suggested wait time.
-
ValidationException
–
One or more parameter values in the request fail to satisfy the specified constraints. Correct the invalid parameter values before retrying the request.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_gameliftstreams/_services/game_lift_streams.py
| def list_stream_sessions(
self,
identifier: "capo_gameliftstreams.types.identifier.Identifier",
*,
config_overrides: Optional[GameLiftStreamsClientConfig] = None,
status: Optional[
"capo_gameliftstreams.types.stream_session_status.StreamSessionStatus"
] = None,
export_files_status: Optional[
"capo_gameliftstreams.types.export_files_status.ExportFilesStatus"
] = None,
next_token: Optional["capo_gameliftstreams.types.next_token.NextToken"] = None,
max_results: Optional[
"capo_gameliftstreams.types.max_results.MaxResults"
] = None,
) -> "capo_gameliftstreams.types.list_stream_sessions_output.ListStreamSessionsOutput":
"""<p>Retrieves a list of Amazon GameLift Streams stream sessions that a stream group is hosting.</p> <p>To retrieve stream sessions, specify the stream group, and optionally filter by stream session status. You can paginate the results as needed.</p> <p>This operation returns the requested stream sessions in no particular order.</p>
Args:
status: <p>Filter by the stream session status. You can specify one status in each request to retrieve only sessions that are currently in that status.</p>
export_files_status: <p>Filter by the exported files status. You can specify one status in each request to retrieve only sessions that currently have that exported files status.</p> <p> Exported files can be in one of the following states: </p> <ul> <li> <p> <code>SUCCEEDED</code>: The exported files are successfully stored in an S3 bucket.</p> </li> <li> <p> <code>FAILED</code>: The session ended but Amazon GameLift Streams couldn't collect and upload the files to S3.</p> </li> <li> <p> <code>PENDING</code>: Either the stream session is still in progress, or uploading the exported files to the S3 bucket is in progress.</p> </li> </ul>
next_token: <p>The token that marks the start of the next set of results. Use this token when you retrieve results as sequential pages. To get the first page of results, omit a token value. To get the remaining pages, provide the token returned with the previous result set. </p>
max_results: <p>The number of results to return. Use this parameter with <code>NextToken</code> to return results in sequential pages. Default value is <code>25</code>. </p>
identifier: <p>The unique identifier of a Amazon GameLift Streams stream group to retrieve the stream session for. You can use either the stream group ID or the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a>.</p>
Raises:
capo_gameliftstreams.errors.access_denied_exception.AccessDeniedException: <p>You don't have the required permissions to access this Amazon GameLift Streams resource. Correct the permissions before you try again.</p>
capo_gameliftstreams.errors.internal_server_exception.InternalServerException: <p>The service encountered an internal error and is unable to complete the request.</p>
capo_gameliftstreams.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request was not found. Correct the request before you try again.</p>
capo_gameliftstreams.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request after the suggested wait time.</p>
capo_gameliftstreams.errors.validation_exception.ValidationException: <p>One or more parameter values in the request fail to satisfy the specified constraints. Correct the invalid parameter values before retrying the request.</p>
capo_gameliftstreams.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_gameliftstreams.types.list_stream_sessions_input.ListStreamSessionsInput]",
) -> OperationResponse[
"capo_gameliftstreams.types.list_stream_sessions_output.ListStreamSessionsOutput"
]:
import capo_gameliftstreams._operations.game_lift_streams.list_stream_sessions
output, http_response = (
capo_gameliftstreams._operations.game_lift_streams.list_stream_sessions.list_stream_sessions(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_gameliftstreams.types.list_stream_sessions_output.ListStreamSessionsOutput",
) -> dict[str, Any]:
import capo_gameliftstreams.types.list_stream_sessions_output
return (
capo_gameliftstreams.types.list_stream_sessions_output.redact_sensitive(
output
)
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("ListStreamSessions", redact_output=_redact_output),
)
input_: capo_gameliftstreams.types.list_stream_sessions_input.ListStreamSessionsInput = {
"identifier": identifier
}
if status is not None:
input_["status"] = status
if export_files_status is not None:
input_["export_files_status"] = export_files_status
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|