Kin
Kin

Reputation: 4596

How to enable/disable action rules in VAPIX 3?

Does somebody faced VAPIX 3 api? I need to enable/disable action rules for camera. Leafing through some api from the internet i have not found any specific information for action rules, so i sniffed requests from web-panel. On required action it sends 4 soap requests:

curl 'http://**.***.***.***:****/vapix/services?timestamp=1395407004744' 
-X POST -H 'Host: **.***.***.***:****' 
-H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0' 
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' 
-H 'Accept-Language: en-US,en;q=0.5' 
-H 'Accept-Encoding: gzip, deflate' 
-H 'SOAPAction: http://www.axis.com/vapix/ws/action1/RemoveActionRule' 
-H 'Content-Type: text/xml; charset=utf-8' 
-H 'Referer: http://**.***.***.***:****/operator/action_rule_setup.shtml?doAction=modify&ruleId=18&timestamp=1395406986842'


curl 'http://**.***.***.***:****/vapix/services?timestamp=1395407005154' 
-X POST -H 'Host: **.***.***.***:****' 
-H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0' 
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' 
-H 'Accept-Language: en-US,en;q=0.5' 
-H 'Accept-Encoding: gzip, deflate' 
-H 'SOAPAction: http://www.axis.com/vapix/ws/action1/RemoveActionConfiguration' 
-H 'Content-Type: text/xml; charset=utf-8' 
-H 'Referer: http://**.***.***.***:****/operator/action_rule_setup.shtml?doAction=modify&ruleId=18&timestamp=1395406986842'


curl 'http://**.***.***.***:****/vapix/services?timestamp=1395407005333' 
-X POST 
-H 'Host: **.***.***.***:****' 
-H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0' 
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' 
-H 'Accept-Language: en-US,en;q=0.5' 
-H 'Accept-Encoding: gzip, deflate' 
-H 'SOAPAction: http://www.axis.com/vapix/ws/action1/AddActionConfiguration' 
-H 'Content-Type: text/xml; charset=utf-8' 
-H 'Referer: http://**.***.***.***:****/operator/action_rule_setup.shtml?doAction=modify&ruleId=18&timestamp=1395406986842'


curl 'http://**.***.***.***:****/vapix/services?timestamp=1395407005575' 
-X POST 
-H 'Host: **.***.***.***:****' 
-H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0' 
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' 
-H 'Accept-Language: en-US,en;q=0.5' 
-H 'Accept-Encoding: gzip, deflate' 
-H 'SOAPAction: http://www.axis.com/vapix/ws/action1/AddActionRule' 
-H 'Content-Type: text/xml; charset=utf-8' 
-H 'Referer: http://**.***.***.***:****/operator/action_rule_setup.shtml?doAction=modify&ruleId=18&timestamp=1395406986842'

Do i really need to delete/create actions for disable/enable it ?

Upvotes: 2

Views: 2001

Answers (1)

user1024112
user1024112

Reputation: 306

Yes, you need to create/recreate action rules in order the enable or disable them. If you look at the SOAP actions generated form the web interface, it actually does the same.

One work-around would be to combine the conditions in your rule with a virtual (or even non-virtual) input. The input is stateful and can be toggled with the ChangeVirtualInputState method in the EventService. You need to check if your camera supports inputs, though.

Upvotes: 1

Related Questions