Difference between revisions of "Valt Module"

From IVS Wiki
Jump to: navigation, search
(isrecording)
(getrecordingid)
Line 63: Line 63:
 
If the room is currently recording, it returns the ID of the active recording. You should check if the room is recording using the isrecording function prior to getting the recording ID.
 
If the room is currently recording, it returns the ID of the active recording. You should check if the room is recording using the isrecording function prior to getting the recording ID.
 
===Parameters===
 
===Parameters===
 +
getrecordingid(https,server,accesstoken,room)
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 86: Line 87:
 
|}
 
|}
 
===Example===
 
===Example===
current_recording = getrecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)
+
current_recording = valt.getrecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)
 +
 
 
==startrecording==
 
==startrecording==
 
===Usage===
 
===Usage===

Revision as of 15:24, 19 December 2018

valtauth

Usage

Connects to the valt server and returns an authentication token.

Parameters

valtauth(https,server,username,password)

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
username String Valt Username
password String Valt Password

Example

auth = valt.valtauth(True,'valt.example.com','admin','admin')

isrecording

Usage

Checks the state of a room and returns True if it is recording and False if it is not.

Parameters

isrecording(https,server,accesstoken,room)

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

if valt.isrecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4):

getrecordingid

Usage

If the room is currently recording, it returns the ID of the active recording. You should check if the room is recording using the isrecording function prior to getting the recording ID.

Parameters

getrecordingid(https,server,accesstoken,room)

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

current_recording = valt.getrecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)

startrecording

Usage

Starts a new recording in the specified room.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.
name String The name that will be associated with the recording in Valt.

Example

startrecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4,"My Recording")

stoprecording

Usage

Stops the current recording in the specified room.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

stoprecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)

pauserecording

Usage

Pauses the current recording in the specified room.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

pauserecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)

resumerecording

Usage

Unpauses the current recording in the specified room.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

resumerecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)

addmarker

Usage

Adds a marker to the recording in progress in the specified room.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.
markername String Name for the maker in the Valt application
color String Color for the marker, valid values are white, gray, red, yellow, purple, cyan, blue, green, and orange.

Example

addmarker(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4,"My Marker","red")

getrecordingtime

Usage

Returns the current time value of the recording in the specified room. Primarily used by the add marker function to specify the time for the marker.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

current_recording_time = getrecordingtime(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)

ispaused

Usage

Checks the state of a room and returns True if it is paused and False if it is not.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

if ispaused(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4):

islocked

Usage

Checks the state of a room and returns True if it is locked and False if it is not.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

if islocked(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4):

getcameras

Usage

Returns a nested listed containing details for the cameras in the specified room. Primarily used with the axis module to enable/disable privacy mode on cameras.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

cameras = getcameras(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)

getschedule

Usage

Returns a nested list of all upcoming schedules for the specified room. The returned list contains the start and end time for each schedule.

Parameters

Parameter Type Value
https Boolean True if the server uses https otherwise False
server String IP address or DNS name of the Valt application server
accesstoken String The authentication token returned by the function valtauth
room Integer The room number of the room in the Valt application. This must be the actually room ID number, not the room name. This can be obtained from the database.

Example

schedules = getschedule(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)