Difference between revisions of "VALT Module"
IVSWikiBlue (talk | contribs) (→Parameters) |
IVSWikiBlue (talk | contribs) (→Parameters) |
||
(One intermediate revision by the same user not shown) | |||
Line 4: | Line 4: | ||
===Parameters=== | ===Parameters=== | ||
− | <pre> | + | <pre>valtauth(https,server,username,password)</pre> |
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 491: | Line 491: | ||
===Parameters=== | ===Parameters=== | ||
− | <pre> | + | <pre>creategroup(https,server,accesstoken,groupname,infoid,markerid)</pre> |
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 569: | Line 569: | ||
|No | |No | ||
|} | |} | ||
+ | |||
===Example=== | ===Example=== | ||
<pre>valt.creategroup(https,server,auth,splitline[0],30,71,rights=rightslist,max_record_duration=180,video_access_users=[14,15,17],video_access_groups=[2,6],retention_type="days",retention_for=365)</pre> | <pre>valt.creategroup(https,server,auth,splitline[0],30,71,rights=rightslist,max_record_duration=180,video_access_users=[14,15,17],video_access_groups=[2,6],retention_type="days",retention_for=365)</pre> |
Latest revision as of 12:02, 27 May 2020
Contents
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
Deprecated
Checks the state of a room and returns True if it is recording, or 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 actual 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 actual 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
startrecording(https,server,accesstoken,room,name)
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 actual 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
valt.startrecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4,"My Recording")
stoprecording
Usage
Stops the current recording in the specified room.
Parameters
stoprecording(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 actual room ID number, not the room name. This can be obtained from the database. |
Example
valt.stoprecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)
pauserecording
Usage
Pauses the current recording in the specified room.
Parameters
pauserecording(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 actual room ID number, not the room name. This can be obtained from the database. |
Example
valt.pauserecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)
resumerecording
Usage
Unpauses the current recording in the specified room.
Parameters
resumerecording(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 actual room ID number, not the room name. This can be obtained from the database. |
Example
valt.resumerecording(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)
addmarker
Usage
Adds a marker to the recording in progress in the specified room.
Parameters
addmarker(https,server,accesstoken,room,markername,color)
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 actual room ID number, not the room name. This can be obtained from the database. |
markername | String | Name for the marker in the Valt application. |
color | String | Color for the marker, valid values are white, gray, red, yellow, purple, cyan, blue, green, and orange. |
Example
valt.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
getrecordingtime(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 actual room ID number, not the room name. This can be obtained from the database. |
Example
current_recording_time = valt.getrecordingtime(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)
ispaused
Usage
Deprecated
Checks the state of a room and returns True if it is paused, or False if it is not.
Parameters
ispaused(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 actual room ID number, not the room name. This can be obtained from the database. |
Example
if valt.ispaused(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4):
islocked
Usage
Deprecated
Checks the state of a room and returns True if it is locked and False if it is not.
Parameters
islocked(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 actual room ID number, not the room name. This can be obtained from the database. |
Example
if valt.islocked(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4):
getcameras
Usage
Returns a nested list, containing details for the cameras in the specified room. Primarily used with the AXIS module to enable/disable privacy mode on cameras.
Parameters
getcameras,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 actual room ID number, not the room name. This can be obtained from the database. |
Example
cameras = valt.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
getschedule(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 actual room ID number, not the room name. This can be obtained from the database. |
Example
schedules = valt.getschedule(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)
getroomname
Usage
Returns the name of the room in VALT.
Parameters
getroomname(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 actual room ID number, not the room name. This can be obtained from the database. |
Example
roomname = valt.getroomname(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)
getroomstatus
Usage
Returns a value indicating the current status of the room. This should be used instead of islocked, ispaused, or isrecording as it also includes better error handling.
Room Status | Return Value |
ERROR | 0 |
Available | 1 |
Recording | 2 |
Paused | 3 |
Locked | 4 |
Parameters
getroomstatus(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 actual room ID number, not the room name. This can be obtained from the database. |
Example
roomstatus = valt.getroomstatus(True,'valt.example.com','3e2c3e461736ce73830ed8d6d9d5dae6',4)
creategroup
Usage
Connects to the VALT server and creates a user group with the specified rights, templates, retention period, and video access.
Parameters
creategroup(https,server,accesstoken,groupname,infoid,markerid)
Parameter | Type | Value | Required |
---|---|---|---|
https | Boolean | True if the server uses HTTPS, otherwise False. | Yes |
server | String | IP address or DNS name of the VALT application server. | Yes |
accesstoken | String | The authentication token returned by the function valtauth. | Yes |
Group name | String | The name that will be given the to group in VALT. | Yes |
infoid | Int | The id number of the information template that will be assigned to the group as the default. | Yes |
markerid | Int | The id number of the marker template that will be assigned to the group as the default. | Yes |
rights | List (of strings) | All the rights that should be granted to the new group in VALT. | No |
max_record_duration | Int | The maximum record duration in minutes. | No |
rooms | List (of ints) | Room ids the new group should be granted access to in VALT. | No |
video_access_users | List (of ints) | User ids the new group should be granted video access to in VALT. | No |
video_access_groups | List (of ints) | Group ids the new group should be granted video access to in VALT. | No |
retention_type | String | Retention Type (Valid Values: infinitely, until, days, hours, minutes) | No |
retention_until | String | Date formatted as MM-DD-YYYY | No |
retention_for | Int | Value in hours, minutes, or days (as specified by retention_type) the video will retained for. | No |
Example
valt.creategroup(https,server,auth,splitline[0],30,71,rights=rightslist,max_record_duration=180,video_access_users=[14,15,17],video_access_groups=[2,6],retention_type="days",retention_for=365)