NumOfConnections
The number of concurrent connections the user has to the session.
ConnectionToken
The authentication token used to connect to the session.
Additional info
The information that you get from this API needs to be used to build a URL that can be pasted in the host field of the NICE DCV native client or in the browser in order to connect to the NICE DCV session.
The format of this URL is the following:
https://{Ip}:{Port}{WebUrlPath}?authToken={ConnectionToken}#{SessionId}.
The NICE DCV URL is the following:
dcv://{Ip}:{Port}{WebUrlPath}?authToken={ConnectionToken}#{SessionId}.
NoteIf you're using Amazon EC2, the IP address should be the public one. If your configuration has NICE DCV hosts behind an ALB or gateway, specify the ALB/gateway address rather than the one returned by the SessionConnectionData API.
Example
Python Request
The following example gets connection information for a user with a user name of user1 and a session with an ID of sessionId12345.
def get_session_connection_api():
api_instance =
swagger_client.GetSessionConnectionDataApi(swagger_client.ApiClient(get_client_configuration())) set_request_headers(api_instance.api_client)
return api_instance
def get_url_to_connect(api_response):
ip_address = api_response.session.server.ip port = api_response.session.server.port
web_url_path = api_response.session.server.web_url_path connection_token = api_response.connection_token session_id = api_response.session.id
url = f'https://{ip_address}:{port}{web_url_path}?
authToken={connection_token}#{session_id}' return url
def get_session_connection_data(session_id, user):
api_response =
get_session_connection_api().get_session_connection_data(session_id=session_id, user=user)
GetSessionScreenshots
url_to_connect = get_url_to_connect(api_response)
print('Get Session Connection Data Response:', api_response) print('URL to connect: ', url_to_connect)
def main():
get_session_connection_data('sessionId12345', 'user1')
Response
The following is the sample output.
{
"CreationTime": "2020-10-06T10:15:31.633Z",
"LastDisconnectionTime": "2020-10-06T10:15:31.633Z", "NumOfConnections": 2
},
"ConnectionToken":
Gets screenshots of one or more NICE DCV sessions.
The image file type and resolution of the screenshot depends on the Session Manager Broker
configuration. To modify the image file type, configure the session-screenshot-format parameter.
To modify the resolution, configure the screenshot-max-width and
session-screenshot-max-height parameters. For more information, see Broker configuration file in the NICE DCV Session Manager Administrator Guide.
Topics
Request parameters
• Request parameters (p. 4)
• Response parameters (p. 7)
• Example (p. 8)
Request parameters
SessionId
The ID of the NICE DCV session from which to get the screenshot.
Type: String Required: Yes
Response parameters
RequestId
The unique ID of the request.
SuccessfulList
Information about the successful screenshots. This data structure includes the following nested response parameters:
SessionScreenshot
Information about the screenshots. This data structure includes the following nested response parameters:
SessionId
The ID of the NICE DCV session from which the screenshot was taken.
Images
Information about the images. This data structure includes the following nested response parameters:
Format
The format of the image. Possible values include: jpeg and png.
Data
The screenshot image base64 encoded format.
CreationTime
The date and time the screenshot was taken.
Primary
Indicates whether the screenshot is of the NICE DCV session's primary display.
UnsuccessfulList
Information about the unsuccessful screenshots. This data structure includes the following nested response parameters:
GetSesionScreenshotRequestData The original request that failed.
Example
SessionId
The ID of the NICE DCV session from which the screenshot was to be taken.
FailureReason
The reason for the failure.
Example
Python Request
The following example gets screenshots from two sessions (sessionId1 and sessionId2). Session sessionId2 doesn't exist and results in a failure.
from swagger_client.models.describe_servers_request_data import DescribeServersRequestData
def get_sessions_api():
api_instance =
swagger_client.ServersApi(swagger_client.ApiClient(get_client_configuration())) set_request_headers(api_instance.api_client)
return api_instance
def get_session_screenshots(session_ids):
request = [GetSessionScreenshotRequestData(session_id=session_id) for session_id in session_ids]
print('Get Session Screenshots Request:', request) api_instance = get_sessions_api()
api_response = api_instance.get_session_screenshots(body=request) print('Get Session Screenshots Response:', api_response)
def main():
get_session_screenshots(["sessionId1", "sessionId2"])
Response
The following is the sample output.
{
"RequestId": "542735ef-f6ab-47d8-90e5-23df31d8d166", "SuccessfulList": [
{
"UnsuccessfulList": [ {
"GetSessionScreenshotRequestData": { "SessionId": "sessionId2"
OpenServers
},
"FailureReason": "Dcv session not found."
} ] }
OpenServers
Opens one or more NICE DCV servers. Before you can create NICE DCV sessions on a NICE DCV server, you must change the server's state to open. After the NICE DCV server is open, you can create NICE DCV sessions on the server.
Topics
• Request parameters (p. 4)
• Response parameters (p. 7)
• Example (p. 8)
Request parameters
ServerId
The ID of the server to open.
Type: String Required: Yes
Response parameters
RequestId
The unique ID of the request.
SuccessfulList
Information about the NICE DCV servers that were successfully opened. This data structure includes the following nested response parameter:
ServerId
The ID of the server that was successfully opened.
UnsuccessfulList
Information about the NICE DCV servers that could not be opened. This data structure includes the following nested response parameters:
OpenServerRequestData
Information about the original request that failed. This data structure includes the following nested response parameter:
ServerId
The ID of the NICE DCV server that could not be opened.
FailureCode
The code of the failure.
Example
FailureReason
The reason for the failure.
Example
Python Request
The following example opens two NICE DCV servers (serverId1 and serverId2).
from swagger_client.models import OpenServerRequestData
def get_servers_api():
api_instance =
swagger_client.ServersApi(swagger_client.ApiClient(get_client_configuration())) set_request_headers(api_instance.api_client)
return api_instance def open_servers(server_ids):
request = [OpenServerRequestData(server_id=server_id) for server_id in server_ids]
print('Open Servers Request:', request) api_instance = get_servers_api()
api_response = api_instance.open_servers(body=request) print('Open Servers Response:', api_response)
def main():
open_servers(["serverId1", "serverId2"])
Response
The following is the sample output.
{ "RequestId": "1e64830f-0a27-41bf-8147-0f3411791b64", "SuccessfulList": [
{
"ServerId": "serverId1"
} ],
"UnsuccessfulList": [ {
"OpenServerRequestData": { "ServerId": "serverId2"
},
"FailureCode": "DCV_SERVER_NOT_FOUND", "FailureReason": "Dcv server not found."
} ] }
UpdateSessionPermissions
Updates the user permissions for a specific NICE DCV session.
Topics
Request parameters
• Request parameters (p. 4)
• Response parameters (p. 7)
• Example (p. 8)
Request parameters
SessionId
The ID of the session for which to change the permissions.
Type: String Required: Yes Owner
The owner of the session for which to change the permissions.
Type: String Required: Yes PermissionFile
The Base64-encoded content of the permissions file to use. For more information, see Configuring NICE DCV Authorization in the NICE DCV Administrator Guide.
Type: String Required: Yes
Response parameters
SessionId
The ID of the session.
Example
Python Request
The following example sets new permissions for a session with a session ID of SessionId1897.
from swagger_client.models.update_session_permissions_request_data import UpdateSessionPermissionsRequestData
def get_session_permissions_api():
api_instance =
swagger_client.SessionPermissionsApi(swagger_client.ApiClient(get_client_configuration())) set_request_headers(api_instance.api_client)
return api_instancedef update_session_permissions(session_permissions_to_update):
update_session_permissions_request = list()
for session_id, owner, permissions_base64_encoded in session_permissions_to_update:
a_request = UpdateSessionPermissionsRequestData(
session_id=session_id, owner=owner, permissions_file=permissions_base64_encoded)
Example
update_session_permissions_request.append(a_request)
print('Update Session Permissions Request:', update_session_permissions_request) api_instance = get_session_permissions_api()
api_response =
api_instance.update_session_permissions(body=update_session_permissions_request) print('Update Session Permissions Response:', api_response)
def main():
update_session_permissions([('SessionId1897', 'an owner 1890', 'file_base64_encoded')])
Response
The following is the sample output.
{
'request_id': 'd68ebf66-4022-42b5-ba65-99f89b18c341', 'successful_list': [
{'
session_id': 'SessionId1897' }
],
'unsuccessful_list': []
}
Release Notes