Skip to content

describe_sessions async

describe_sessions(
    *,
    config_overrides: Optional[AsyncAppStreamClientConfig] = None,
    stack_name: Optional[Name] = None,
    fleet_name: Optional[Name] = None,
    user_id: Optional[UserId] = None,
    next_token: Optional[String] = None,
    limit: Optional[Integer] = None,
    authentication_type: Optional[AuthenticationType] = None,
    instance_id: Optional[String] = None,
) -> DescribeSessionsResult

Retrieves a list that describes the streaming sessions for a specified stack and fleet. If a UserId is provided for the stack and fleet, only streaming sessions for that user are described. If an authentication type is not provided, the default is to authenticate users using a streaming URL.

Parameters:

  • stack_name (Optional[Name], default: None ) –

    The name of the stack. This value is case-sensitive.

  • fleet_name (Optional[Name], default: None ) –

    The name of the fleet. This value is case-sensitive.

  • user_id (Optional[UserId], default: None ) –

    The user identifier (ID). If you specify a user ID, you must also specify the authentication type.

  • next_token (Optional[String], default: None ) –

    The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.

  • limit (Optional[Integer], default: None ) –

    The size of each page of results. The default value is 20 and the maximum value is 50.

  • authentication_type (Optional[AuthenticationType], default: None ) –

    The authentication method. Specify API for a user authenticated using a streaming URL or SAML for a SAML federated user. The default is to authenticate users using a streaming URL.

  • instance_id (Optional[String], default: None ) –

    The identifier for the instance hosting the session.

Raises:

Source code in docs_src/capo_appstream/_services/async_app_stream.py
async def describe_sessions(
    self,
    *,
    config_overrides: Optional[AsyncAppStreamClientConfig] = None,
    stack_name: Optional["capo_appstream.types.name.Name"] = None,
    fleet_name: Optional["capo_appstream.types.name.Name"] = None,
    user_id: Optional["capo_appstream.types.user_id.UserId"] = None,
    next_token: Optional["capo_appstream.types.string.String"] = None,
    limit: Optional["capo_appstream.types.integer.Integer"] = None,
    authentication_type: Optional[
        "capo_appstream.types.authentication_type.AuthenticationType"
    ] = None,
    instance_id: Optional["capo_appstream.types.string.String"] = None,
) -> "capo_appstream.types.describe_sessions_result.DescribeSessionsResult":
    """<p>Retrieves a list that describes the streaming sessions for a specified stack and fleet. If a UserId is provided for the stack and fleet, only streaming sessions for that user are described. If an authentication type is not provided, the default is to authenticate users using a streaming URL.</p>

    Args:
        stack_name: <p>The name of the stack. This value is case-sensitive.</p>
        fleet_name: <p>The name of the fleet. This value is case-sensitive.</p>
        user_id: <p>The user identifier (ID). If you specify a user ID, you must also specify the authentication type.</p>
        next_token: <p>The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.</p>
        limit: <p>The size of each page of results. The default value is 20 and the maximum value is 50.</p>
        authentication_type: <p>The authentication method. Specify <code>API</code> for a user authenticated using a streaming URL or <code>SAML</code> for a SAML federated user. The default is to authenticate users using a streaming URL.</p>
        instance_id: <p>The identifier for the instance hosting the session.</p>

    Raises:
        capo_appstream.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Indicates an incorrect combination of parameters, or a missing parameter.</p>
        capo_appstream.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appstream.types.describe_sessions_request.DescribeSessionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_appstream.types.describe_sessions_result.DescribeSessionsResult"
    ]:
        import capo_appstream._operations.photon_admin_proxy_service.describe_sessions

        (
            output,
            http_response,
        ) = await capo_appstream._operations.photon_admin_proxy_service.describe_sessions.async_describe_sessions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeSessions")
    )
    input_: capo_appstream.types.describe_sessions_request.DescribeSessionsRequest = {}
    if stack_name is not None:
        input_["stack_name"] = stack_name
    if fleet_name is not None:
        input_["fleet_name"] = fleet_name
    if user_id is not None:
        input_["user_id"] = user_id
    if next_token is not None:
        input_["next_token"] = next_token
    if limit is not None:
        input_["limit"] = limit
    if authentication_type is not None:
        input_["authentication_type"] = authentication_type
    if instance_id is not None:
        input_["instance_id"] = instance_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output