-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebctrlSOAP.py
More file actions
29 lines (23 loc) · 1012 Bytes
/
webctrlSOAP.py
File metadata and controls
29 lines (23 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sys, SOAPpy
# Initialize connection to WebCtrl
class webctrlSOAP:
def __init__(self, username = 'verickson', password= 'acerpa1982'):
self.bacuser = username
self.password = password
def setValue(self, serverAddr, bacAddrPath, newVal):
host = 'http://%s/_common/services/EvalService?wsdl' % (serverAddr)
server = SOAPpy.SOAPProxy(host)
server.SetValue(self.bacuser, self.password, bacAddrPath, '%s' % newVal)
return True
def getValue(self, serverAddr, bacAddrPath):
host = 'http://%s/_common/services/EvalService?wsdl' % (serverAddr)
server = SOAPpy.SOAPProxy(host)
value = server.GetValue(self.bacuser, self.password, bacAddrPath)
return value
if __name__ == "__main__":
if len(sys.argv) > 1:
obj = webctrlSOAP()
if sys.argv[1] == "setValue":
print obj.setValue(sys.argv[2], sys.argv[3], sys.argv[4])
elif sys.argv[1] == "getValue":
print obj.getValue(sys.argv[2], sys.argv[3])