示例#1
0
def getPastRecordingsForID(server: utils.HikVisionServer, ChannelID,
                           startTime="", endTime=""):
    dictdata = utils.xml2dict(b"""<CMSearchDescription version="1.0"
        xmlns="http://www.isapi.org/ver20/XMLSchema">
        <searchID>{812F04E0-4089-11A3-9A0C-0305E82C2906}</searchID>
        <trackIDList>
        <trackID>9</trackID>
        <trackID>22</trackID>
        <trackID>43</trackID>
        </trackIDList>
        <timeSpanList>
        <timeSpan>
        <startTime>2013-06-10T12:00:00Z</startTime>
        <endTime>2013-06-10T13:30:00Z</endTime>
        </timeSpan>
        </timeSpanList>
        <contentTypeList>
        <contentType>video</contentType>
        </contentTypeList>
        <maxResults>40</maxResults>
        <metadataList>
        <metadataDescriptor>recordType.meta.hikvision.com/motion</metadataDescriptor>
        </metadataList>
        </CMSearchDescription>""")
    dictdata['CMSearchDescription']['trackIDList']['trackID'] = ChannelID
    (dictdata['CMSearchDescription']['timeSpanList']
             ['timeSpan']['startTime']) = startTime
    (dictdata['CMSearchDescription']['timeSpanList']
             ['timeSpan']['endTime']) = endTime
    data = utils.dict2xml(dictdata)
    return utils.getXML(server, "ContentMgmt/search", data)
示例#2
0
def getConfigurationData(server: utils.HikVisionServer):
    """
    Get device’s configuration data.
    """
    return utils.getXML(server, "System/configurationData")
示例#3
0
def getDeviceInfo(server: utils.HikVisionServer):
    """
    Returns the device info as a dictionary
    """
    return utils.getXML(server, "System/deviceInfo")
示例#4
0
def getCapabilities(server: utils.HikVisionServer):
    """
    It is used to get device capability.
    """
    return utils.getXML(server, "System/capabilities")
示例#5
0
def getChannelByID(server: utils.HikVisionServer, ChannelID):
    """
    It is used to get the properties of a particular streaming channel for the
    device
    """
    return utils.getXML(server, "Streaming/channels/" + ChannelID)
示例#6
0
def status(server: utils.HikVisionServer):
    """
    It is used to get a device streaming status
    """
    return utils.getXML(server, "Streaming/status")
示例#7
0
def getChannels(server: utils.HikVisionServer):
    """
    It is used to get the properties of streaming channels for the device
    """
    return utils.getXML(server, "Streaming/channels")