DescribeSessions - NICE DCV Session Manager

DescribeSessions

Describes one or more NICE DCV sessions.

Request parameters

SessionIds

The IDs of the sessions to describe.

Type: String

Required: No

NextToken

The token to use to retrieve the next page of results.

Type: String

Required: No

Filters

Additional filters to apply to the request. Supported filters include:

  • tag:key—The tags assigned to the session.

  • owner—The session owner.

Type: String

Required: No

Response parameters

Id

The unique ID of the session.

Name

The name of the session.

Owner

The owner of the session.

Server

Information about the server on which the session is running. This data structure includes the following nested response parameters:

  • Ip

    The IP address of the NICE DCV server host.

  • Hostname

    The hostname of the NICE DCV server host.

  • Port

    The port over which the NICE DCV server communicates with NICE DCV clients.

  • Tags

    The tags assigned to the session. This data structure includes the following nested response parameters:

    • Key

      The tag key.

    • Value

      The tag value.

Type

The type of session.

State

The current state of the session. Possible values are:

  • CREATING - the Broker is in the process of creating the session.

  • READY - the session is ready to accept client connections.

  • DELETING - the session is being deleted.

  • DELETED - the session has been deleted.

  • UNKNOWN - unable to determine the session's state. The Broker and the Agent might be unable to communicate.

CreationTime

The date and time the session was created.

LastDisconnectionTime

The date and time of the last client disconnection.

NumOfConnections

The number of active client connections.

StorageRoot

Specifies the path to the folder used for session storage. For more information about the NICE DCV session storage, see Enabling Session Storage in the NICE DCV Administrator Guide.

Type: String

Required: No

Example

Python

Request

The following example describes sessions that are owned by user1 and have a tag of os=windows.

from swagger_client.models.describe_sessions_request_data import DescribeSessionsRequestData from swagger_client.models.key_value_pair import KeyValuePair def get_sessions_api(): api_instance = swagger_client.SessionsApi(swagger_client.ApiClient(get_client_configuration())) set_request_headers(api_instance.api_client) return api_instance def describe_sessions(session_ids=None, next_token=None, tags=None, owner=None): filters = list() if tags: for tag in tags: filter_key_value_pair = KeyValuePair(key='tag:' + tag['Key'], value=tag['Value']) filters.append(filter_key_value_pair) if owner: filter_key_value_pair = KeyValuePair(key='owner', value=owner) filters.append(filter_key_value_pair) request = DescribeSessionsRequestData(session_ids=session_ids, filters=filters, next_token=next_token) print('Describe Sessions Request:', request) api_instance = get_sessions_api() api_response = api_instance.describe_sessions(body=request) print('Describe Sessions Response', api_response) def main(): describe_sessions( owner='user1', tags=[{'Key': 'os', 'Value': 'windows'}])

Response

The following is the sample output.

{ "Sessions": [ { "Id": "SessionId1897", "Name": "a session name", "Owner": "an owner 1890", "Server": { "Ip": "1.1.1.123", "Hostname": "server hostname", "Port": "1222", "Tags": [ { "Key": "os", "Value": "windows" }, { "Key": "ram", "Value": "4gb" } ] }, "Type": "VIRTUAL", "State": "READY", "CreationTime": "2020-10-06T10:15:31.633Z", "LastDisconnectionTime": "2020-10-06T10:15:31.633Z", "NumOfConnections": 2, "StorageRoot" : "/storage/root" }, { "Id": "SessionId1895", "Name": "a session name", "Owner": "an owner 1890", "Server": { "Ip": "1.1.1.123", "Hostname": "server hostname", "Port": "1222", "Tags": [ { "Key": "os", "Value": "windows" }, { "Key": "ram", "Value": "4gb" } ] }, "Type": "VIRTUAL", "State": "DELETING", "CreationTime": "2020-10-06T10:15:31.633Z", "LastDisconnectionTime": "2020-10-06T10:15:31.633Z", "NumOfConnections": 2, "StorageRoot" : "/storage/root" } ] }