-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathuplink.py
More file actions
56 lines (45 loc) · 2.17 KB
/
Copy pathuplink.py
File metadata and controls
56 lines (45 loc) · 2.17 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""Uplink service implementation."""
from onvif.operator import ONVIFOperator
from onvif.utils.service import ONVIFService
from onvif.utils.wsdl import ONVIFWSDL
# pylint: disable=invalid-name
class Uplink(ONVIFService):
"""Uplink service client.
| Property | Details |
| --- | --- |
| **First introduced** | ONVIF Release 18.12 (December 2018) |
| **Binding name** | `UplinkBinding` (`ver10/uplink/wsdl/uplink.wsdl`) |
| **Operations** | [uplink.wsdl](https://developer.onvif.org/pub/specs/branches/development/wsdl/ver10/uplink/wsdl/uplink.wsdl) |
| **Specification** | [Uplink.xml](https://developer.onvif.org/pub/specs/branches/development/doc/Uplink.xml) |
"""
def __init__(self, xaddr=None, **kwargs):
definition = ONVIFWSDL.get_definition("uplink")
self.operator = ONVIFOperator(
definition["path"],
binding=f"{{{definition['namespace']}}}{definition['binding']}",
service_path="Uplink", # fallback
xaddr=xaddr,
**kwargs,
)
def GetServiceCapabilities(self):
"""Returns the capabilities of the uplink service."""
return self.operator.call("GetServiceCapabilities")
def GetUplinks(self):
"""A device supporting uplinks shall support this command to retrieve the
configured uplink configurations.
The Status field shall signal whether a connection is Offline, Connecting or
Online.
"""
return self.operator.call("GetUplinks")
def SetUplink(self, Configuration):
"""A device supporting uplinks shall support this command to add or modify an
uplink configuration.
The Status property of the UplinkConfiguration shall be ignored by the device. A
device shall use the field RemoteAddress to decide whether to update an existing
entry or create a new entry.
"""
return self.operator.call("SetUplink", Configuration=Configuration)
def DeleteUplink(self, RemoteAddress):
"""A device supporting uplinks shall support this command to remove an uplink
configuration."""
return self.operator.call("DeleteUplink", RemoteAddress=RemoteAddress)