onvif-python 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- onvif/__init__.py +13 -0
- onvif/client.py +485 -0
- onvif/operator.py +130 -0
- onvif/services/__init__.py +75 -0
- onvif/services/accesscontrol.py +105 -0
- onvif/services/accessrules.py +47 -0
- onvif/services/actionengine.py +46 -0
- onvif/services/analytics/analytics.py +60 -0
- onvif/services/analytics/ruleengine.py +44 -0
- onvif/services/analyticsdevice.py +122 -0
- onvif/services/appmgmt.py +40 -0
- onvif/services/authenticationbehavior.py +83 -0
- onvif/services/credential.py +159 -0
- onvif/services/deviceio.py +165 -0
- onvif/services/devicemgmt.py +410 -0
- onvif/services/display.py +62 -0
- onvif/services/doorcontrol.py +93 -0
- onvif/services/events/events.py +41 -0
- onvif/services/events/notification.py +34 -0
- onvif/services/events/pullpoint.py +29 -0
- onvif/services/events/subscription.py +21 -0
- onvif/services/imaging.py +62 -0
- onvif/services/media.py +424 -0
- onvif/services/media2.py +310 -0
- onvif/services/provisioning.py +50 -0
- onvif/services/ptz.py +187 -0
- onvif/services/receiver.py +46 -0
- onvif/services/recording.py +136 -0
- onvif/services/replay.py +30 -0
- onvif/services/schedule.py +82 -0
- onvif/services/search.py +149 -0
- onvif/services/security/advancedsecurity.py +19 -0
- onvif/services/security/authorizationserver.py +31 -0
- onvif/services/security/dot1x.py +42 -0
- onvif/services/security/jwt.py +21 -0
- onvif/services/security/keystore.py +208 -0
- onvif/services/security/mediasigning.py +30 -0
- onvif/services/security/tlsserver.py +82 -0
- onvif/services/thermal.py +54 -0
- onvif/services/uplink.py +28 -0
- onvif/utils/__init__.py +4 -0
- onvif/utils/exceptions.py +33 -0
- onvif/utils/wsdl.py +297 -0
- onvif/wsdl/ver10/accesscontrol/wsdl/index.html +7 -0
- onvif/wsdl/ver10/accessrules/wsdl/accessrules.wsdl +702 -0
- onvif/wsdl/ver10/accessrules/wsdl/index.html +7 -0
- onvif/wsdl/ver10/actionengine.wsdl +1265 -0
- onvif/wsdl/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl +4159 -0
- onvif/wsdl/ver10/advancedsecurity/wsdl/index.html +7 -0
- onvif/wsdl/ver10/analyticsdevice.wsdl +709 -0
- onvif/wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl +502 -0
- onvif/wsdl/ver10/appmgmt/wsdl/index.html +7 -0
- onvif/wsdl/ver10/authenticationbehavior/wsdl/authenticationbehavior.wsdl +1382 -0
- onvif/wsdl/ver10/authenticationbehavior/wsdl/index.html +7 -0
- onvif/wsdl/ver10/credential/wsdl/credential.wsdl +2018 -0
- onvif/wsdl/ver10/credential/wsdl/index.html +7 -0
- onvif/wsdl/ver10/device/wsdl/devicemgmt.wsdl +4623 -0
- onvif/wsdl/ver10/deviceio.wsdl +1414 -0
- onvif/wsdl/ver10/display/display.wsdl +383 -0
- onvif/wsdl/ver10/display/wsdl/index.htm +383 -0
- onvif/wsdl/ver10/display.wsdl +521 -0
- onvif/wsdl/ver10/doorcontrol/wsdl/index.html +7 -0
- onvif/wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl +449 -0
- onvif/wsdl/ver10/events/wsdl/event-vs.wsdl +947 -0
- onvif/wsdl/ver10/events/wsdl/event.wsdl +947 -0
- onvif/wsdl/ver10/events/wsdl/index.html +7 -0
- onvif/wsdl/ver10/federatedsearch.wsdl +344 -0
- onvif/wsdl/ver10/media/wsdl/media.wsdl +3684 -0
- onvif/wsdl/ver10/pacs/accesscontrol.wsdl +1942 -0
- onvif/wsdl/ver10/pacs/doorcontrol.wsdl +1792 -0
- onvif/wsdl/ver10/pacs/types.xsd +181 -0
- onvif/wsdl/ver10/provisioning/wsdl/provisioning.wsdl +588 -0
- onvif/wsdl/ver10/receiver.wsdl +398 -0
- onvif/wsdl/ver10/recording.wsdl +1231 -0
- onvif/wsdl/ver10/replay.wsdl +221 -0
- onvif/wsdl/ver10/schedule/wsdl/index.html +7 -0
- onvif/wsdl/ver10/schedule/wsdl/schedule.wsdl +1383 -0
- onvif/wsdl/ver10/schema/common.xsd +422 -0
- onvif/wsdl/ver10/schema/metadatastream.xsd +520 -0
- onvif/wsdl/ver10/schema/onvif.xsd +9251 -0
- onvif/wsdl/ver10/search.wsdl +882 -0
- onvif/wsdl/ver10/thermal/wsdl/index.html +7 -0
- onvif/wsdl/ver10/thermal/wsdl/thermal.wsdl +777 -0
- onvif/wsdl/ver10/topics/topicns.xml +13 -0
- onvif/wsdl/ver10/uplink/wsdl/index.html +7 -0
- onvif/wsdl/ver10/uplink/wsdl/uplink.wsdl +256 -0
- onvif/wsdl/ver20/analytics/humanbody.xsd +490 -0
- onvif/wsdl/ver20/analytics/humanface.xsd +501 -0
- onvif/wsdl/ver20/analytics/index.html +7 -0
- onvif/wsdl/ver20/analytics/radiometry.xsd +389 -0
- onvif/wsdl/ver20/analytics/rules.xsd +127 -0
- onvif/wsdl/ver20/analytics/wsdl/analytics.wsdl +757 -0
- onvif/wsdl/ver20/analytics/wsdl/index.html +7 -0
- onvif/wsdl/ver20/imaging/wsdl/imaging.wsdl +603 -0
- onvif/wsdl/ver20/media/wsdl/index.html +7 -0
- onvif/wsdl/ver20/media/wsdl/media.wsdl +2862 -0
- onvif/wsdl/ver20/ptz/wsdl/ptz.wsdl +1450 -0
- onvif/wsdl/ver20/util/federated_search_documentation.html +1647 -0
- onvif/wsdl/ver20/util/fedsearch-docu-viewer.xsl +8 -0
- onvif/wsdl/ver20/util/onvif-wsdl-viewer.xsl +2580 -0
- onvif/wsdl/ver20/util/operationIndex.html +97 -0
- onvif_python-0.0.1.dist-info/METADATA +381 -0
- onvif_python-0.0.1.dist-info/RECORD +106 -0
- onvif_python-0.0.1.dist-info/WHEEL +5 -0
- onvif_python-0.0.1.dist-info/licenses/LICENSE.md +21 -0
- onvif_python-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# onvif/services/security/keystore.py
|
|
2
|
+
|
|
3
|
+
from ...operator import ONVIFOperator
|
|
4
|
+
from ...utils import ONVIFWSDL
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Keystore:
|
|
8
|
+
def __init__(self, xaddr=None, **kwargs):
|
|
9
|
+
definition = ONVIFWSDL.get_definition("keystore")
|
|
10
|
+
self.operator = ONVIFOperator(
|
|
11
|
+
definition["path"],
|
|
12
|
+
binding=f"{{{definition['namespace']}}}{definition['binding']}",
|
|
13
|
+
xaddr=xaddr,
|
|
14
|
+
**kwargs,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
def CreateRSAKeyPair(self, KeyLength, Alias=None):
|
|
18
|
+
return self.operator.call("CreateRSAKeyPair", KeyLength=KeyLength, Alias=Alias)
|
|
19
|
+
|
|
20
|
+
def CreateECCKeyPair(self, EllipticCurve, Alias=None):
|
|
21
|
+
return self.operator.call(
|
|
22
|
+
"CreateECCKeyPair", EllipticCurve=EllipticCurve, Alias=Alias
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def UploadKeyPairInPKCS8(
|
|
26
|
+
self,
|
|
27
|
+
KeyPair,
|
|
28
|
+
Alias=None,
|
|
29
|
+
EncryptionPassphraseID=None,
|
|
30
|
+
EncryptionPassphrase=None,
|
|
31
|
+
):
|
|
32
|
+
return self.operator.call(
|
|
33
|
+
"UploadKeyPairInPKCS8",
|
|
34
|
+
KeyPair=KeyPair,
|
|
35
|
+
Alias=Alias,
|
|
36
|
+
EncryptionPassphraseID=EncryptionPassphraseID,
|
|
37
|
+
EncryptionPassphrase=EncryptionPassphrase,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
def UploadCertificateWithPrivateKeyInPKCS12(
|
|
41
|
+
self,
|
|
42
|
+
CertWithPrivateKey,
|
|
43
|
+
CertificationPathAlias=None,
|
|
44
|
+
KeyAlias=None,
|
|
45
|
+
IgnoreAdditionalCertificates=None,
|
|
46
|
+
IntegrityPassphraseID=None,
|
|
47
|
+
EncryptionPassphraseID=None,
|
|
48
|
+
Passphrase=None,
|
|
49
|
+
):
|
|
50
|
+
return self.operator.call(
|
|
51
|
+
"UploadCertificateWithPrivateKeyInPKCS12",
|
|
52
|
+
CertWithPrivateKey=CertWithPrivateKey,
|
|
53
|
+
CertificationPathAlias=CertificationPathAlias,
|
|
54
|
+
KeyAlias=KeyAlias,
|
|
55
|
+
IgnoreAdditionalCertificates=IgnoreAdditionalCertificates,
|
|
56
|
+
IntegrityPassphraseID=IntegrityPassphraseID,
|
|
57
|
+
EncryptionPassphraseID=EncryptionPassphraseID,
|
|
58
|
+
Passphrase=Passphrase,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
def GetKeyStatus(self, KeyID):
|
|
62
|
+
return self.operator.call("GetKeyStatus", KeyID=KeyID)
|
|
63
|
+
|
|
64
|
+
def GetPrivateKeyStatus(self, KeyID):
|
|
65
|
+
return self.operator.call("GetPrivateKeyStatus", KeyID=KeyID)
|
|
66
|
+
|
|
67
|
+
def GetAllKeys(self):
|
|
68
|
+
return self.operator.call("GetAllKeys")
|
|
69
|
+
|
|
70
|
+
def DeleteKey(self, KeyID):
|
|
71
|
+
return self.operator.call("DeleteKey", KeyID=KeyID)
|
|
72
|
+
|
|
73
|
+
def CreatePKCS10CSR(self, Subject, KeyID, SignatureAlgorithm, CSRAttribute=None):
|
|
74
|
+
return self.operator.call(
|
|
75
|
+
"DeleteKey",
|
|
76
|
+
Subject=Subject,
|
|
77
|
+
KeyID=KeyID,
|
|
78
|
+
CSRAttribute=CSRAttribute,
|
|
79
|
+
SignatureAlgorithm=SignatureAlgorithm,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
def CreateSelfSignedCertificate(
|
|
83
|
+
self,
|
|
84
|
+
Subject,
|
|
85
|
+
KeyID,
|
|
86
|
+
SignatureAlgorithm,
|
|
87
|
+
X509Version=None,
|
|
88
|
+
Alias=None,
|
|
89
|
+
notValidBefore=None,
|
|
90
|
+
notValidAfter=None,
|
|
91
|
+
Extension=None,
|
|
92
|
+
):
|
|
93
|
+
return self.operator.call(
|
|
94
|
+
"CreateSelfSignedCertificate",
|
|
95
|
+
X509Version=X509Version,
|
|
96
|
+
Subject=Subject,
|
|
97
|
+
KeyID=KeyID,
|
|
98
|
+
Alias=Alias,
|
|
99
|
+
notValidBefore=notValidBefore,
|
|
100
|
+
notValidAfter=notValidAfter,
|
|
101
|
+
SignatureAlgorithm=SignatureAlgorithm,
|
|
102
|
+
Extension=Extension,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
def UploadCertificate(
|
|
106
|
+
self, Certificate, Alias=None, KeyAlias=None, PrivateKeyRequired=None
|
|
107
|
+
):
|
|
108
|
+
return self.operator.call(
|
|
109
|
+
"UploadCertificate",
|
|
110
|
+
Certificate=Certificate,
|
|
111
|
+
Alias=Alias,
|
|
112
|
+
KeyAlias=KeyAlias,
|
|
113
|
+
PrivateKeyRequired=PrivateKeyRequired,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def GetCertificate(self, CertificateID):
|
|
117
|
+
return self.operator.call("GetCertificate", CertificateID=CertificateID)
|
|
118
|
+
|
|
119
|
+
def GetAllCertificates(self):
|
|
120
|
+
return self.operator.call("GetAllCertificates")
|
|
121
|
+
|
|
122
|
+
def DeleteCertificate(self, CertificateID):
|
|
123
|
+
return self.operator.call("DeleteCertificate", CertificateID=CertificateID)
|
|
124
|
+
|
|
125
|
+
def CreateCertificationPath(self, CertificateIDs, Alias=None):
|
|
126
|
+
return self.operator.call(
|
|
127
|
+
"CreateCertificationPath", CertificateIDs=CertificateIDs, Alias=Alias
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
def GetCertificationPath(self, CertificationPathID):
|
|
131
|
+
return self.operator.call(
|
|
132
|
+
"GetCertificationPath", CertificationPathID=CertificationPathID
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
def GetAllCertificationPaths(self):
|
|
136
|
+
return self.operator.call("GetAllCertificationPaths")
|
|
137
|
+
|
|
138
|
+
def SetCertificationPath(self, CertificationPathID, CertificationPath):
|
|
139
|
+
return self.operator.call(
|
|
140
|
+
"SetCertificationPath",
|
|
141
|
+
CertificationPathID=CertificationPathID,
|
|
142
|
+
CertificationPath=CertificationPath,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
def DeleteCertificationPath(self, CertificationPathID):
|
|
146
|
+
return self.operator.call(
|
|
147
|
+
"DeleteCertificationPath", CertificationPathID=CertificationPathID
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
def UploadPassphrase(self, Passphrase, PassphraseAlias=None):
|
|
151
|
+
return self.operator.call(
|
|
152
|
+
"UploadPassphrase", Passphrase=Passphrase, PassphraseAlias=PassphraseAlias
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
def GetAllPassphrases(self):
|
|
156
|
+
return self.operator.call("GetAllPassphrases")
|
|
157
|
+
|
|
158
|
+
def DeletePassphrase(self, PassphraseID):
|
|
159
|
+
return self.operator.call("DeletePassphrase", PassphraseID=PassphraseID)
|
|
160
|
+
|
|
161
|
+
def UploadCRL(self, Crl, Alias=None, anyParameters=None):
|
|
162
|
+
return self.operator.call(
|
|
163
|
+
"UploadCRL", Crl=Crl, Alias=Alias, anyParameters=anyParameters
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
def GetCRL(self, CrlID):
|
|
167
|
+
return self.operator.call("GetCRL", CrlID=CrlID)
|
|
168
|
+
|
|
169
|
+
def GetAllCRLs(self):
|
|
170
|
+
return self.operator.call("GetAllCRLs")
|
|
171
|
+
|
|
172
|
+
def DeleteCRL(self, CrlID):
|
|
173
|
+
return self.operator.call("DeleteCRL", CrlID=CrlID)
|
|
174
|
+
|
|
175
|
+
def CreateCertPathValidationPolicy(
|
|
176
|
+
self, Parameters, TrustAnchor, Alias=None, anyParameters=None
|
|
177
|
+
):
|
|
178
|
+
return self.operator.call(
|
|
179
|
+
"CreateCertPathValidationPolicy",
|
|
180
|
+
Alias=Alias,
|
|
181
|
+
Parameters=Parameters,
|
|
182
|
+
TrustAnchor=TrustAnchor,
|
|
183
|
+
anyParameters=anyParameters,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
def GetCertPathValidationPolicy(self, CertPathValidationPolicyID):
|
|
187
|
+
return self.operator.call(
|
|
188
|
+
"GetCertPathValidationPolicy",
|
|
189
|
+
CertPathValidationPolicyID=CertPathValidationPolicyID,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
def GetAllCertPathValidationPolicies(self):
|
|
193
|
+
return self.operator.call("GetAllCertPathValidationPolicies")
|
|
194
|
+
|
|
195
|
+
def SetCertPathValidationPolicy(
|
|
196
|
+
self, CertPathValidationPolicy, CertPathValidationPolicyID=None
|
|
197
|
+
):
|
|
198
|
+
return self.operator.call(
|
|
199
|
+
"SetCertPathValidationPolicy",
|
|
200
|
+
CertPathValidationPolicyID=CertPathValidationPolicyID,
|
|
201
|
+
CertPathValidationPolicy=CertPathValidationPolicy,
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
def DeleteCertPathValidationPolicy(self, CertPathValidationPolicyID):
|
|
205
|
+
return self.operator.call(
|
|
206
|
+
"DeleteCertPathValidationPolicy",
|
|
207
|
+
CertPathValidationPolicyID=CertPathValidationPolicyID,
|
|
208
|
+
)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# onvif/services/security/mediasigning.py
|
|
2
|
+
|
|
3
|
+
from ...operator import ONVIFOperator
|
|
4
|
+
from ...utils import ONVIFWSDL
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class MediaSigning:
|
|
8
|
+
def __init__(self, xaddr=None, **kwargs):
|
|
9
|
+
definition = ONVIFWSDL.get_definition("mediasigning")
|
|
10
|
+
self.operator = ONVIFOperator(
|
|
11
|
+
definition["path"],
|
|
12
|
+
binding=f"{{{definition['namespace']}}}{definition['binding']}",
|
|
13
|
+
xaddr=xaddr,
|
|
14
|
+
**kwargs,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
def AddMediaSigningCertificateAssignment(self, CertificationPathID):
|
|
18
|
+
return self.operator.call(
|
|
19
|
+
"AddMediaSigningCertificateAssignment",
|
|
20
|
+
CertificationPathID=CertificationPathID,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
def RemoveMediaSigningCertificateAssignment(self, CertificationPathID):
|
|
24
|
+
return self.operator.call(
|
|
25
|
+
"RemoveMediaSigningCertificateAssignment",
|
|
26
|
+
CertificationPathID=CertificationPathID,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
def GetAssignedMediaSigningCertificates(self):
|
|
30
|
+
return self.operator.call("GetAssignedMediaSigningCertificates")
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# onvif/services/security/tlsserver.py
|
|
2
|
+
|
|
3
|
+
from ...operator import ONVIFOperator
|
|
4
|
+
from ...utils import ONVIFWSDL
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TLSServer:
|
|
8
|
+
def __init__(self, xaddr=None, **kwargs):
|
|
9
|
+
definition = ONVIFWSDL.get_definition("tlsserver")
|
|
10
|
+
self.operator = ONVIFOperator(
|
|
11
|
+
definition["path"],
|
|
12
|
+
binding=f"{{{definition['namespace']}}}{definition['binding']}",
|
|
13
|
+
xaddr=xaddr,
|
|
14
|
+
**kwargs,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
def AddServerCertificateAssignment(self, CertificationPathID):
|
|
18
|
+
return self.operator.call(
|
|
19
|
+
"AddServerCertificateAssignment", CertificationPathID=CertificationPathID
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def RemoveServerCertificateAssignment(self, CertificationPathID):
|
|
23
|
+
return self.operator.call(
|
|
24
|
+
"RemoveServerCertificateAssignment", CertificationPathID=CertificationPathID
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def ReplaceServerCertificateAssignment(
|
|
28
|
+
self, OldCertificationPathID, NewCertificationPathID
|
|
29
|
+
):
|
|
30
|
+
return self.operator.call(
|
|
31
|
+
"ReplaceServerCertificateAssignment",
|
|
32
|
+
OldCertificationPathID=OldCertificationPathID,
|
|
33
|
+
NewCertificationPathID=NewCertificationPathID,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
def GetAssignedServerCertificates(self):
|
|
37
|
+
return self.operator.call("GetAssignedServerCertificates")
|
|
38
|
+
|
|
39
|
+
def SetEnabledTLSVersions(self, Versions):
|
|
40
|
+
return self.operator.call("SetEnabledTLSVersions", Versions=Versions)
|
|
41
|
+
|
|
42
|
+
def GetEnabledTLSVersions(self):
|
|
43
|
+
return self.operator.call("GetEnabledTLSVersions")
|
|
44
|
+
|
|
45
|
+
def SetClientAuthenticationRequired(self, clientAuthenticationRequired):
|
|
46
|
+
return self.operator.call(
|
|
47
|
+
"SetClientAuthenticationRequired",
|
|
48
|
+
clientAuthenticationRequired=clientAuthenticationRequired,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
def GetClientAuthenticationRequired(self):
|
|
52
|
+
return self.operator.call("GetClientAuthenticationRequired")
|
|
53
|
+
|
|
54
|
+
def SetCnMapsToUser(self, cnMapsToUser):
|
|
55
|
+
return self.operator.call("SetCnMapsToUsername", cnMapsToUser=cnMapsToUser)
|
|
56
|
+
|
|
57
|
+
def GetCnMapsToUser(self):
|
|
58
|
+
return self.operator.call("GetCnMapsToUser")
|
|
59
|
+
|
|
60
|
+
def AddCertPathValidationPolicyAssignment(self, CertPathValidationPolicyID):
|
|
61
|
+
return self.operator.call(
|
|
62
|
+
"AddCertPathValidationPolicyAssignment",
|
|
63
|
+
CertPathValidationPolicyID=CertPathValidationPolicyID,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def RemoveCertPathValidationPolicyAssignment(self, CertPathValidationPolicyID):
|
|
67
|
+
return self.operator.call(
|
|
68
|
+
"RemoveCertPathValidationPolicyAssignment",
|
|
69
|
+
CertPathValidationPolicyID=CertPathValidationPolicyID,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
def ReplaceCertPathValidationPolicyAssignment(
|
|
73
|
+
self, OldCertPathValidationPolicyID, NewCertPathValidationPolicyID
|
|
74
|
+
):
|
|
75
|
+
return self.operator.call(
|
|
76
|
+
"ReplaceCertPathValidationPolicyAssignment",
|
|
77
|
+
OldCertPathValidationPolicyID=OldCertPathValidationPolicyID,
|
|
78
|
+
NewCertPathValidationPolicyID=NewCertPathValidationPolicyID,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
def GetAssignedCertPathValidationPolicies(self):
|
|
82
|
+
return self.operator.call("GetAssignedCertPathValidationPolicies")
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# onvif/services/thermal.py
|
|
2
|
+
|
|
3
|
+
from ..operator import ONVIFOperator
|
|
4
|
+
from ..utils import ONVIFWSDL
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Thermal:
|
|
8
|
+
def __init__(self, xaddr=None, **kwargs):
|
|
9
|
+
definition = ONVIFWSDL.get_definition("thermal")
|
|
10
|
+
self.operator = ONVIFOperator(
|
|
11
|
+
definition["path"],
|
|
12
|
+
binding=f"{{{definition['namespace']}}}{definition['binding']}",
|
|
13
|
+
service_path="Thermal", # fallback
|
|
14
|
+
xaddr=xaddr,
|
|
15
|
+
**kwargs,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
def GetServiceCapabilities(self):
|
|
19
|
+
return self.operator.call("GetServiceCapabilities")
|
|
20
|
+
|
|
21
|
+
def GetConfigurationOptions(self, VideoSourceToken):
|
|
22
|
+
return self.operator.call(
|
|
23
|
+
"GetConfigurationOptions", VideoSourceToken=VideoSourceToken
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def GetConfiguration(self, VideoSourceToken):
|
|
27
|
+
return self.operator.call("GetConfiguration", VideoSourceToken=VideoSourceToken)
|
|
28
|
+
|
|
29
|
+
def GetConfigurations(self):
|
|
30
|
+
return self.operator.call("GetConfigurations")
|
|
31
|
+
|
|
32
|
+
def SetConfiguration(self, VideoSourceToken, Configuration):
|
|
33
|
+
return self.operator.call(
|
|
34
|
+
"SetConfiguration",
|
|
35
|
+
VideoSourceToken=VideoSourceToken,
|
|
36
|
+
Configuration=Configuration,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def GetRadiometryConfigurationOptions(self, VideoSourceToken):
|
|
40
|
+
return self.operator.call(
|
|
41
|
+
"GetRadiometryConfigurationOptions", VideoSourceToken=VideoSourceToken
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
def GetRadiometryConfiguration(self, VideoSourceToken):
|
|
45
|
+
return self.operator.call(
|
|
46
|
+
"GetRadiometryConfiguration", VideoSourceToken=VideoSourceToken
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
def SetRadiometryConfiguration(self, VideoSourceToken, Configuration):
|
|
50
|
+
return self.operator.call(
|
|
51
|
+
"SetRadiometryConfiguration",
|
|
52
|
+
VideoSourceToken=VideoSourceToken,
|
|
53
|
+
Configuration=Configuration,
|
|
54
|
+
)
|
onvif/services/uplink.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# onvif/services/uplink.py
|
|
2
|
+
|
|
3
|
+
from ..operator import ONVIFOperator
|
|
4
|
+
from ..utils import ONVIFWSDL
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Uplink:
|
|
8
|
+
def __init__(self, xaddr=None, **kwargs):
|
|
9
|
+
definition = ONVIFWSDL.get_definition("uplink")
|
|
10
|
+
self.operator = ONVIFOperator(
|
|
11
|
+
definition["path"],
|
|
12
|
+
binding=f"{{{definition['namespace']}}}{definition['binding']}",
|
|
13
|
+
service_path="Uplink", # fallback
|
|
14
|
+
xaddr=xaddr,
|
|
15
|
+
**kwargs,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
def GetServiceCapabilities(self):
|
|
19
|
+
return self.operator.call("GetServiceCapabilities")
|
|
20
|
+
|
|
21
|
+
def GetUplinks(self):
|
|
22
|
+
return self.operator.call("GetUplinks")
|
|
23
|
+
|
|
24
|
+
def SetUplink(self, Configuration):
|
|
25
|
+
return self.operator.call("SetUplink", Configuration=Configuration)
|
|
26
|
+
|
|
27
|
+
def DeleteUplink(self, RemoteAddress):
|
|
28
|
+
return self.operator.call("SetUplink", RemoteAddress=RemoteAddress)
|
onvif/utils/__init__.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# onvif/utils/exceptions.py
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
(1) SOAP Errors
|
|
5
|
+
(2) Transport/Protocol Errors
|
|
6
|
+
(3) Application Errors
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from zeep.exceptions import Fault
|
|
10
|
+
import requests
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ONVIFOperationException(Exception):
|
|
14
|
+
def __init__(self, operation, original_exception):
|
|
15
|
+
self.operation = operation
|
|
16
|
+
self.original_exception = original_exception
|
|
17
|
+
|
|
18
|
+
if isinstance(original_exception, Fault):
|
|
19
|
+
# SOAP-level error
|
|
20
|
+
category = "SOAP Error"
|
|
21
|
+
code = getattr(original_exception, "faultcode", None)
|
|
22
|
+
detail = getattr(original_exception, "detail", None)
|
|
23
|
+
msg = f"{category}: code={code}, msg={str(original_exception)}, detail={detail}"
|
|
24
|
+
elif isinstance(original_exception, requests.exceptions.RequestException):
|
|
25
|
+
# Transport/Protocol error
|
|
26
|
+
category = "Protocol Error"
|
|
27
|
+
msg = f"{category}: {str(original_exception)}"
|
|
28
|
+
else:
|
|
29
|
+
# Application or generic error
|
|
30
|
+
category = "Application Error"
|
|
31
|
+
msg = f"{category}: {str(original_exception)}"
|
|
32
|
+
|
|
33
|
+
super().__init__(f"ONVIF operation '{operation}' failed: {msg}")
|