Example #1
0
 def decode(rsp, agent):
     _ret_ = rsp['_ret_']
     image = [raritan.rpc.webcam.StorageManager.StorageImage.decode(x0, agent) for x0 in rsp['image']]
     typecheck.is_int(_ret_, DecodeException)
     for x0 in image:
         typecheck.is_struct(x0, raritan.rpc.webcam.StorageManager.StorageImage, DecodeException)
     return (_ret_, image)
 def getPolicy(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getPolicy', args)
     _ret_ = raritan.rpc.auth.Policy.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.auth.Policy, DecodeException)
     return _ret_
 def getReading(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getReading', args)
     _ret_ = raritan.rpc.lhxmodel.Sensor.Reading.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.lhxmodel.Sensor.Reading, DecodeException)
     return _ret_
Example #4
0
 def decode(rsp, agent):
     info = raritan.rpc.usermgmt.UserInfo.decode(rsp['info'], agent)
     privileges = [raritan.rpc.usermgmt.Role.Privilege.decode(x0, agent) for x0 in rsp['privileges']]
     typecheck.is_struct(info, raritan.rpc.usermgmt.UserInfo, DecodeException)
     for x0 in privileges:
         typecheck.is_struct(x0, raritan.rpc.usermgmt.Role.Privilege, DecodeException)
     return (info, privileges)
Example #5
0
 def encode(password, info):
     typecheck.is_string(password, AssertionError)
     typecheck.is_struct(info, raritan.rpc.usermgmt.UserInfo, AssertionError)
     args = {}
     args['password'] = password
     args['info'] = raritan.rpc.usermgmt.UserInfo.encode(info)
     return args
 def getThresholds(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getThresholds', args)
     _ret_ = raritan.rpc.lhxmodel.Sensor.NumThresholds.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.lhxmodel.Sensor.NumThresholds, DecodeException)
     return _ret_
 def getErrorStatus(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getErrorStatus', args)
     _ret_ = raritan.rpc.powerlogic.PowerMeter.ErrorStatus.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.powerlogic.PowerMeter.ErrorStatus, DecodeException)
     return _ret_
Example #8
0
 def encode(reqInfo, challenge):
     typecheck.is_struct(reqInfo, raritan.rpc.cert.ServerSSLCert.ReqInfo, AssertionError)
     typecheck.is_string(challenge, AssertionError)
     args = {}
     args['reqInfo'] = raritan.rpc.cert.ServerSSLCert.ReqInfo.encode(reqInfo)
     args['challenge'] = challenge
     return args
        def __init__(self, oldState, newState, source):
            super(raritan.rpc.lhxmodel.Lhx.OpStateChangedEvent, self).__init__(source)
            typecheck.is_struct(oldState, raritan.rpc.lhxmodel.Lhx.OpState, AssertionError)
            typecheck.is_struct(newState, raritan.rpc.lhxmodel.Lhx.OpState, AssertionError)

            self.oldState = oldState
            self.newState = newState
 def getOpState(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getOpState', args)
     _ret_ = raritan.rpc.lhxmodel.Lhx.OpState.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.lhxmodel.Lhx.OpState, DecodeException)
     return _ret_
Example #11
0
 def encode(name, info):
     typecheck.is_string(name, AssertionError)
     typecheck.is_struct(info, raritan.rpc.usermgmt.Role.Info, AssertionError)
     args = {}
     args['name'] = name
     args['info'] = raritan.rpc.usermgmt.Role.Info.encode(info)
     return args
 def getCapabilities(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getCapabilities', args)
     _ret_ = raritan.rpc.lhxmodel.Lhx.Capabilities.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.lhxmodel.Lhx.Capabilities, DecodeException)
     return _ret_
Example #13
0
    def __init__(self, id, supportedFormats):
        typecheck.is_string(id, AssertionError)
        for x0 in supportedFormats:
            typecheck.is_struct(x0, raritan.rpc.webcam.Format, AssertionError)

        self.id = id
        self.supportedFormats = supportedFormats
Example #14
0
        def __init__(self, oldSettings, newSettings, actUserName, actIpAddr, source):
            super(raritan.rpc.emdmodel.Emd.SettingsChangedEvent, self).__init__(actUserName, actIpAddr, source)
            typecheck.is_struct(oldSettings, raritan.rpc.emdmodel.Emd.Settings, AssertionError)
            typecheck.is_struct(newSettings, raritan.rpc.emdmodel.Emd.Settings, AssertionError)

            self.oldSettings = oldSettings
            self.newSettings = newSettings
 def getInfo(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getInfo', args)
     _ret_ = raritan.rpc.logging.LogInfo.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.logging.LogInfo, DecodeException)
     return _ret_
Example #16
0
 def decode(rsp, agent):
     _ret_ = rsp['_ret_']
     meta = [raritan.rpc.webcam.StorageManager.ImageStorageMetaData.decode(x0, agent) for x0 in rsp['meta']]
     typecheck.is_int(_ret_, DecodeException)
     for x0 in meta:
         typecheck.is_struct(x0, raritan.rpc.webcam.StorageManager.ImageStorageMetaData, DecodeException)
     return (_ret_, meta)
        def __init__(self, oldMetaData, newMetaData, source):
            super(raritan.rpc.lhxmodel.Parameter.MetaDataChangedEvent, self).__init__(source)
            typecheck.is_struct(oldMetaData, raritan.rpc.lhxmodel.Parameter.MetaData, AssertionError)
            typecheck.is_struct(newMetaData, raritan.rpc.lhxmodel.Parameter.MetaData, AssertionError)

            self.oldMetaData = oldMetaData
            self.newMetaData = newMetaData
 def getValue(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getValue', args)
     _ret_ = raritan.rpc.lhxmodel.Parameter.Value.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.lhxmodel.Parameter.Value, DecodeException)
     return _ret_
 def getMetaData(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getMetaData', args)
     _ret_ = raritan.rpc.smartcard.CardReader.MetaData.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.smartcard.CardReader.MetaData, DecodeException)
     return _ret_
Example #20
0
    def __init__(self, oldSettings, newSettings, rolename, actUserName, actIpAddr, source):
        super(raritan.rpc.usermgmt.RoleChanged, self).__init__(rolename, actUserName, actIpAddr, source)
        typecheck.is_struct(oldSettings, raritan.rpc.usermgmt.Role.Info, AssertionError)
        typecheck.is_struct(newSettings, raritan.rpc.usermgmt.Role.Info, AssertionError)

        self.oldSettings = oldSettings
        self.newSettings = newSettings
 def getSettings(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getSettings', args)
     _ret_ = raritan.rpc.emdmodel.Emd.Settings.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.emdmodel.Emd.Settings, DecodeException)
     return _ret_
Example #22
0
        def __init__(self, oldSetup, newSetup, source):
            super(raritan.rpc.powerlogic.PowerMeter.SetupChangedEvent, self).__init__(source)
            typecheck.is_struct(oldSetup, raritan.rpc.powerlogic.PowerMeter.Setup, AssertionError)
            typecheck.is_struct(newSetup, raritan.rpc.powerlogic.PowerMeter.Setup, AssertionError)

            self.oldSetup = oldSetup
            self.newSetup = newSetup
Example #23
0
 def encode(reqInfo, days):
     typecheck.is_struct(reqInfo, raritan.rpc.cert.ServerSSLCert.ReqInfo, AssertionError)
     typecheck.is_int(days, AssertionError)
     args = {}
     args['reqInfo'] = raritan.rpc.cert.ServerSSLCert.ReqInfo.encode(reqInfo)
     args['days'] = days
     return args
 def getStatus(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getStatus', args)
     _ret_ = raritan.rpc.firmware.UpdateStatus.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.firmware.UpdateStatus, DecodeException)
     return _ret_
        def __init__(self, oldThresholds, newThresholds, actUserName, actIpAddr, source):
            super(raritan.rpc.lhxmodel.Sensor.ThresholdsChangedEvent, self).__init__(actUserName, actIpAddr, source)
            typecheck.is_struct(oldThresholds, raritan.rpc.lhxmodel.Sensor.NumThresholds, AssertionError)
            typecheck.is_struct(newThresholds, raritan.rpc.lhxmodel.Sensor.NumThresholds, AssertionError)

            self.oldThresholds = oldThresholds
            self.newThresholds = newThresholds
 def readDeviceIdentification(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'readDeviceIdentification', args)
     _ret_ = raritan.rpc.modbus.Device.DeviceID.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.modbus.Device.DeviceID, DecodeException)
     return _ret_
        def __init__(self, oldReading, newReading, source):
            super(raritan.rpc.lhxmodel.Sensor.StateChangedEvent, self).__init__(source)
            typecheck.is_struct(oldReading, raritan.rpc.lhxmodel.Sensor.Reading, AssertionError)
            typecheck.is_struct(newReading, raritan.rpc.lhxmodel.Sensor.Reading, AssertionError)

            self.oldReading = oldReading
            self.newReading = newReading
Example #28
0
 def encode(webcam, image):
     typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
     typecheck.is_struct(image, raritan.rpc.webcam.Image, AssertionError)
     args = {}
     args['webcam'] = Interface.encode(webcam)
     args['image'] = raritan.rpc.webcam.Image.encode(image)
     return args
Example #29
0
        def __init__(self, oldProperties, newProperties, source):
            super(raritan.rpc.portsmodel.Port.PropertiesChangedEvent, self).__init__(source)
            typecheck.is_struct(oldProperties, raritan.rpc.portsmodel.Port.Properties, AssertionError)
            typecheck.is_struct(newProperties, raritan.rpc.portsmodel.Port.Properties, AssertionError)

            self.oldProperties = oldProperties
            self.newProperties = newProperties
Example #30
0
        def __init__(self, oldStatus, newStatus, source):
            super(raritan.rpc.powerlogic.PowerMeter.ErrorStatusChangedEvent, self).__init__(source)
            typecheck.is_struct(oldStatus, raritan.rpc.powerlogic.PowerMeter.ErrorStatus, AssertionError)
            typecheck.is_struct(newStatus, raritan.rpc.powerlogic.PowerMeter.ErrorStatus, AssertionError)

            self.oldStatus = oldStatus
            self.newStatus = newStatus
Example #31
0
        def __init__(self, type, numDecDigits, numRangeMin, numRangeMax, numThresholdMin, numThresholdMax, label, id):
            typecheck.is_struct(type, raritan.rpc.sensors.Sensor.TypeSpec, AssertionError)
            typecheck.is_int(numDecDigits, AssertionError)
            typecheck.is_double(numRangeMin, AssertionError)
            typecheck.is_double(numRangeMax, AssertionError)
            typecheck.is_double(numThresholdMin, AssertionError)
            typecheck.is_double(numThresholdMax, AssertionError)
            typecheck.is_string(label, AssertionError)
            typecheck.is_string(id, AssertionError)

            self.type = type
            self.numDecDigits = numDecDigits
            self.numRangeMin = numRangeMin
            self.numRangeMax = numRangeMax
            self.numThresholdMin = numThresholdMin
            self.numThresholdMax = numThresholdMax
            self.label = label
            self.id = id
Example #32
0
 def getImages(self, webcam, start, count, direction):
     agent = self.agent
     typecheck.is_interface(webcam, raritan.rpc.webcam.Webcam, AssertionError)
     typecheck.is_long(start, AssertionError)
     typecheck.is_int(count, AssertionError)
     typecheck.is_enum(direction, raritan.rpc.webcam.StorageManager.Direction, AssertionError)
     args = {}
     args['webcam'] = Interface.encode(webcam)
     args['start'] = start
     args['count'] = count
     args['direction'] = raritan.rpc.webcam.StorageManager.Direction.encode(direction)
     rsp = agent.json_rpc(self.target, 'getImages', args)
     _ret_ = rsp['_ret_']
     image = [raritan.rpc.webcam.StorageManager.StorageImage.decode(x0, agent) for x0 in rsp['image']]
     typecheck.is_int(_ret_, DecodeException)
     for x0 in image:
         typecheck.is_struct(x0, raritan.rpc.webcam.StorageManager.StorageImage, DecodeException)
     return (_ret_, image)
Example #33
0
 def performRequest(self, requests):
     agent = self.agent
     for x0 in requests:
         typecheck.is_struct(x0, raritan.rpc.bulkrpc.Request,
                             AssertionError)
     args = {}
     args["requests"] = [
         raritan.rpc.bulkrpc.Request.encode(x0) for x0 in requests
     ]
     rsp = agent.json_rpc(self.target, "performRequest", args)
     responses = [
         raritan.rpc.bulkrpc.Response.decode(x0, agent)
         for x0 in rsp["responses"]
     ]
     for x0 in responses:
         typecheck.is_struct(x0, raritan.rpc.bulkrpc.Response,
                             DecodeException)
     return responses
Example #34
0
        def __init__(self, subject, issuer, invalidBefore, invalidAfter,
                     serialNumber, keyLength):
            typecheck.is_struct(
                subject, raritan.rpc.cert.ServerSSLCert.CommonAttributes,
                AssertionError)
            typecheck.is_struct(
                issuer, raritan.rpc.cert.ServerSSLCert.CommonAttributes,
                AssertionError)
            typecheck.is_string(invalidBefore, AssertionError)
            typecheck.is_string(invalidAfter, AssertionError)
            typecheck.is_string(serialNumber, AssertionError)
            typecheck.is_int(keyLength, AssertionError)

            self.subject = subject
            self.issuer = issuer
            self.invalidBefore = invalidBefore
            self.invalidAfter = invalidAfter
            self.serialNumber = serialNumber
            self.keyLength = keyLength
Example #35
0
 def getChunk(self, refId, count, direction, categories):
     agent = self.agent
     typecheck.is_int(refId, AssertionError)
     typecheck.is_int(count, AssertionError)
     typecheck.is_enum(direction, raritan.rpc.logging.RangeDirection,
                       AssertionError)
     for x0 in categories:
         typecheck.is_string(x0, AssertionError)
     args = {}
     args['refId'] = refId
     args['count'] = count
     args['direction'] = raritan.rpc.logging.RangeDirection.encode(
         direction)
     args['categories'] = [x0 for x0 in categories]
     rsp = agent.json_rpc(self.target, 'getChunk', args)
     _ret_ = raritan.rpc.logging.LogChunk.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.logging.LogChunk,
                         DecodeException)
     return _ret_
Example #36
0
 def getNetworkConfigRoutesIPv6(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getNetworkConfigRoutesIPv6', args)
     static_routes = [
         raritan.rpc.net.IPv6RoutingEntry.decode(x0, agent)
         for x0 in rsp['static_routes']
     ]
     active_routes = [
         raritan.rpc.net.IPv6RoutingEntry.decode(x0, agent)
         for x0 in rsp['active_routes']
     ]
     for x0 in static_routes:
         typecheck.is_struct(x0, raritan.rpc.net.IPv6RoutingEntry,
                             DecodeException)
     for x0 in active_routes:
         typecheck.is_struct(x0, raritan.rpc.net.IPv6RoutingEntry,
                             DecodeException)
     return (static_routes, active_routes)
Example #37
0
        def __init__(self, enabled, minute, hour, dayOfMonth, month, dayOfWeek):
            typecheck.is_bool(enabled, AssertionError)
            for x0 in minute:
                typecheck.is_struct(x0, raritan.rpc.event.TimerEventManager.Range, AssertionError)
            for x0 in hour:
                typecheck.is_struct(x0, raritan.rpc.event.TimerEventManager.Range, AssertionError)
            for x0 in dayOfMonth:
                typecheck.is_struct(x0, raritan.rpc.event.TimerEventManager.Range, AssertionError)
            for x0 in month:
                typecheck.is_struct(x0, raritan.rpc.event.TimerEventManager.Range, AssertionError)
            for x0 in dayOfWeek:
                typecheck.is_struct(x0, raritan.rpc.event.TimerEventManager.Range, AssertionError)

            self.enabled = enabled
            self.minute = minute
            self.hour = hour
            self.dayOfMonth = dayOfMonth
            self.month = month
            self.dayOfWeek = dayOfWeek
Example #38
0
    def __init__(self, enabled, defaultPolicyIn, defaultPolicyOut, ruleSetIn,
                 ruleSetOut):
        typecheck.is_bool(enabled, AssertionError)
        typecheck.is_enum(defaultPolicyIn, raritan.rpc.security.IpfwPolicy,
                          AssertionError)
        typecheck.is_enum(defaultPolicyOut, raritan.rpc.security.IpfwPolicy,
                          AssertionError)
        for x0 in ruleSetIn:
            typecheck.is_struct(x0, raritan.rpc.security.IpfwRule,
                                AssertionError)
        for x0 in ruleSetOut:
            typecheck.is_struct(x0, raritan.rpc.security.IpfwRule,
                                AssertionError)

        self.enabled = enabled
        self.defaultPolicyIn = defaultPolicyIn
        self.defaultPolicyOut = defaultPolicyOut
        self.ruleSetIn = ruleSetIn
        self.ruleSetOut = ruleSetOut
Example #39
0
 def getEntries(self, refId, count, direction):
     agent = self.agent
     typecheck.is_int(refId, AssertionError)
     typecheck.is_int(count, AssertionError)
     typecheck.is_enum(direction, raritan.rpc.logging.RangeDirection,
                       AssertionError)
     args = {}
     args['refId'] = refId
     args['count'] = count
     args['direction'] = raritan.rpc.logging.RangeDirection.encode(
         direction)
     rsp = agent.json_rpc(self.target, 'getEntries', args)
     entries = [
         raritan.rpc.logging.LogEntry.decode(x0, agent)
         for x0 in rsp['entries']
     ]
     for x0 in entries:
         typecheck.is_struct(x0, raritan.rpc.logging.LogEntry,
                             DecodeException)
     return entries
Example #40
0
        def __init__(self, negate, operation, matchType, eventId, conditions):
            typecheck.is_bool(negate, AssertionError)
            typecheck.is_enum(
                operation, raritan.rpc.event.Engine.Condition.Op, AssertionError
            )
            typecheck.is_enum(
                matchType, raritan.rpc.event.Engine.Condition.MatchType, AssertionError
            )
            for x0 in eventId:
                typecheck.is_string(x0, AssertionError)
            for x0 in conditions:
                typecheck.is_struct(
                    x0, raritan.rpc.event.Engine.Condition, AssertionError
                )

            self.negate = negate
            self.operation = operation
            self.matchType = matchType
            self.eventId = eventId
            self.conditions = conditions
Example #41
0
        def __init__(self, eventDescType, eventType, dynNodeContext, idComp,
                     name, entries):
            typecheck.is_enum(eventDescType,
                              raritan.rpc.event.Engine.EventDesc.Type,
                              AssertionError)
            typecheck.is_enum(eventType, raritan.rpc.event.Event.Type,
                              AssertionError)
            typecheck.is_string(dynNodeContext, AssertionError)
            typecheck.is_string(idComp, AssertionError)
            typecheck.is_string(name, AssertionError)
            for x0 in entries:
                typecheck.is_struct(x0, raritan.rpc.event.Engine.EventDesc,
                                    AssertionError)

            self.eventDescType = eventDescType
            self.eventType = eventType
            self.dynNodeContext = dynNodeContext
            self.idComp = idComp
            self.name = name
            self.entries = entries
Example #42
0
        def __init__(
            self,
            havePendingReq,
            havePendingCert,
            pendingReqInfo,
            pendingCertInfo,
            activeCertInfo,
            maxSignDays,
        ):
            typecheck.is_bool(havePendingReq, AssertionError)
            typecheck.is_bool(havePendingCert, AssertionError)
            typecheck.is_struct(pendingReqInfo,
                                raritan.rpc.cert.ServerSSLCert.ReqInfo,
                                AssertionError)
            typecheck.is_struct(pendingCertInfo,
                                raritan.rpc.cert.ServerSSLCert.CertInfo,
                                AssertionError)
            typecheck.is_struct(activeCertInfo,
                                raritan.rpc.cert.ServerSSLCert.CertInfo,
                                AssertionError)
            typecheck.is_int(maxSignDays, AssertionError)

            self.havePendingReq = havePendingReq
            self.havePendingCert = havePendingCert
            self.pendingReqInfo = pendingReqInfo
            self.pendingCertInfo = pendingCertInfo
            self.activeCertInfo = activeCertInfo
            self.maxSignDays = maxSignDays
Example #43
0
    def __init__(self, enabled, locked, blocked, needPasswordChange, auxInfo,
                 snmpV3Settings, sshPublicKey, preferences, roleIds):
        typecheck.is_bool(enabled, AssertionError)
        typecheck.is_bool(locked, AssertionError)
        typecheck.is_bool(blocked, AssertionError)
        typecheck.is_bool(needPasswordChange, AssertionError)
        typecheck.is_struct(auxInfo, raritan.rpc.usermgmt.AuxInfo,
                            AssertionError)
        typecheck.is_struct(snmpV3Settings,
                            raritan.rpc.usermgmt.SnmpV3Settings,
                            AssertionError)
        typecheck.is_string(sshPublicKey, AssertionError)
        typecheck.is_struct(preferences, raritan.rpc.usermgmt.Preferences,
                            AssertionError)
        for x0 in roleIds:
            typecheck.is_int(x0, AssertionError)

        self.enabled = enabled
        self.locked = locked
        self.blocked = blocked
        self.needPasswordChange = needPasswordChange
        self.auxInfo = auxInfo
        self.snmpV3Settings = snmpV3Settings
        self.sshPublicKey = sshPublicKey
        self.preferences = preferences
        self.roleIds = roleIds
Example #44
0
        def __init__(self, id, name, isSystem, isEnabled, isAutoRearm, hasMatched, condition, actionIds, arguments):
            typecheck.is_string(id, AssertionError)
            typecheck.is_string(name, AssertionError)
            typecheck.is_bool(isSystem, AssertionError)
            typecheck.is_bool(isEnabled, AssertionError)
            typecheck.is_bool(isAutoRearm, AssertionError)
            typecheck.is_bool(hasMatched, AssertionError)
            typecheck.is_struct(condition, raritan.rpc.event.Engine.Condition, AssertionError)
            for x0 in actionIds:
                typecheck.is_string(x0, AssertionError)
            for x0 in arguments:
                typecheck.is_struct(x0, raritan.rpc.event.KeyValue, AssertionError)

            self.id = id
            self.name = name
            self.isSystem = isSystem
            self.isEnabled = isEnabled
            self.isAutoRearm = isAutoRearm
            self.hasMatched = hasMatched
            self.condition = condition
            self.actionIds = actionIds
            self.arguments = arguments
Example #45
0
        def __init__(self, l1l2, l2l3, l3l1):
            typecheck.is_struct(l1l2, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError)
            typecheck.is_struct(l2l3, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError)
            typecheck.is_struct(l3l1, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError)

            self.l1l2 = l1l2
            self.l2l3 = l2l3
            self.l3l1 = l3l1
Example #46
0
 def getFilteredEntries(self, refId, count, direction, eventClasses):
     agent = self.agent
     typecheck.is_int(refId, AssertionError)
     typecheck.is_int(count, AssertionError)
     typecheck.is_enum(direction, raritan.rpc.logging.RangeDirection,
                       AssertionError)
     for x0 in eventClasses:
         typecheck.is_string(x0, AssertionError)
     args = {}
     args["refId"] = refId
     args["count"] = count
     args["direction"] = raritan.rpc.logging.RangeDirection.encode(
         direction)
     args["eventClasses"] = [x0 for x0 in eventClasses]
     rsp = agent.json_rpc(self.target, "getFilteredEntries", args)
     entries = [
         raritan.rpc.logging.LogEntry.decode(x0, agent)
         for x0 in rsp["entries"]
     ]
     for x0 in entries:
         typecheck.is_struct(x0, raritan.rpc.logging.LogEntry,
                             DecodeException)
     return entries
Example #47
0
        def __init__(self, l1, l2, l3, average):
            typecheck.is_struct(l1, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError)
            typecheck.is_struct(l2, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError)
            typecheck.is_struct(l3, raritan.rpc.powerlogic.PowerMeter.MinMaxReading, AssertionError)
            typecheck.is_interface(average, raritan.rpc.sensors.NumericSensor, AssertionError)

            self.l1 = l1
            self.l2 = l2
            self.l3 = l3
            self.average = average
Example #48
0
 def getNetworkConfigInterface(self):
     agent = self.agent
     args = {}
     rsp = agent.json_rpc(self.target, 'getNetworkConfigInterface', args)
     state = raritan.rpc.net.InterfaceState.decode(rsp['state'], agent)
     lan = raritan.rpc.net.LanInterfaceSettings.decode(rsp['lan'], agent)
     lancurrent = raritan.rpc.net.LanInterfaceParameters.decode(
         rsp['lancurrent'], agent)
     wlan = raritan.rpc.net.WirelessInterfaceSettings.decode(
         rsp['wlan'], agent)
     typecheck.is_struct(state, raritan.rpc.net.InterfaceState,
                         DecodeException)
     typecheck.is_struct(lan, raritan.rpc.net.LanInterfaceSettings,
                         DecodeException)
     typecheck.is_struct(lancurrent, raritan.rpc.net.LanInterfaceParameters,
                         DecodeException)
     typecheck.is_struct(wlan, raritan.rpc.net.WirelessInterfaceSettings,
                         DecodeException)
     return (state, lan, lancurrent, wlan)
Example #49
0
    def __init__(self, format, controls, name, location, refreshInterval):
        typecheck.is_struct(format, raritan.rpc.webcam.Format, AssertionError)
        typecheck.is_struct(controls, raritan.rpc.webcam.Controls, AssertionError)
        typecheck.is_string(name, AssertionError)
        typecheck.is_struct(location, raritan.rpc.webcam.Location, AssertionError)
        typecheck.is_int(refreshInterval, AssertionError)

        self.format = format
        self.controls = controls
        self.name = name
        self.location = location
        self.refreshInterval = refreshInterval
Example #50
0
 def decode(rsp, agent):
     state = raritan.rpc.net.InterfaceState.decode(rsp['state'], agent)
     lan = raritan.rpc.net.LanInterfaceSettings.decode(
         rsp['lan'], agent)
     lancurrent = raritan.rpc.net.LanInterfaceParameters.decode(
         rsp['lancurrent'], agent)
     wlan = raritan.rpc.net.WirelessInterfaceSettings.decode(
         rsp['wlan'], agent)
     typecheck.is_struct(state, raritan.rpc.net.InterfaceState,
                         DecodeException)
     typecheck.is_struct(lan, raritan.rpc.net.LanInterfaceSettings,
                         DecodeException)
     typecheck.is_struct(lancurrent,
                         raritan.rpc.net.LanInterfaceParameters,
                         DecodeException)
     typecheck.is_struct(wlan,
                         raritan.rpc.net.WirelessInterfaceSettings,
                         DecodeException)
     return (state, lan, lancurrent, wlan)
Example #51
0
        def __init__(self, model, version, setpointWaterValveCfg, setpointVentilatorsCfg, defaultFanSpeedCfg):
            typecheck.is_string(model, AssertionError)
            typecheck.is_string(version, AssertionError)
            typecheck.is_struct(setpointWaterValveCfg, raritan.rpc.lhxmodel.Lhx.ParamCfg, AssertionError)
            typecheck.is_struct(setpointVentilatorsCfg, raritan.rpc.lhxmodel.Lhx.ParamCfg, AssertionError)
            typecheck.is_struct(defaultFanSpeedCfg, raritan.rpc.lhxmodel.Lhx.ParamCfg, AssertionError)

            self.model = model
            self.version = version
            self.setpointWaterValveCfg = setpointWaterValveCfg
            self.setpointVentilatorsCfg = setpointVentilatorsCfg
            self.defaultFanSpeedCfg = defaultFanSpeedCfg
Example #52
0
 def decode(rsp, agent):
     _ret_ = raritan.rpc.usermgmt.UserCapabilities.decode(
         rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.usermgmt.UserCapabilities,
                         DecodeException)
     return _ret_
Example #53
0
 def encode(info):
     typecheck.is_struct(info, raritan.rpc.usermgmt.Role.Info,
                         AssertionError)
     args = {}
     args['info'] = raritan.rpc.usermgmt.Role.Info.encode(info)
     return args
Example #54
0
        def __init__(self, http2httpsRedir, userBlockTimeout,
                     userMaxFailedLogins, ipFw, ipV6Fw, roleAccessControl,
                     roleAccessControlV6, pwSettings, idleTimeout, singleLogin,
                     sshSettings):
            typecheck.is_bool(http2httpsRedir, AssertionError)
            typecheck.is_int(userBlockTimeout, AssertionError)
            typecheck.is_int(userMaxFailedLogins, AssertionError)
            typecheck.is_struct(ipFw, raritan.rpc.security.IpFw,
                                AssertionError)
            typecheck.is_struct(ipV6Fw, raritan.rpc.security.IpFw,
                                AssertionError)
            typecheck.is_struct(roleAccessControl,
                                raritan.rpc.security.RoleAccessControl,
                                AssertionError)
            typecheck.is_struct(roleAccessControlV6,
                                raritan.rpc.security.RoleAccessControl,
                                AssertionError)
            typecheck.is_struct(pwSettings,
                                raritan.rpc.security.PasswordSettings,
                                AssertionError)
            typecheck.is_int(idleTimeout, AssertionError)
            typecheck.is_bool(singleLogin, AssertionError)
            typecheck.is_struct(sshSettings, raritan.rpc.security.SSHSettings,
                                AssertionError)

            self.http2httpsRedir = http2httpsRedir
            self.userBlockTimeout = userBlockTimeout
            self.userMaxFailedLogins = userMaxFailedLogins
            self.ipFw = ipFw
            self.ipV6Fw = ipV6Fw
            self.roleAccessControl = roleAccessControl
            self.roleAccessControlV6 = roleAccessControlV6
            self.pwSettings = pwSettings
            self.idleTimeout = idleTimeout
            self.singleLogin = singleLogin
            self.sshSettings = sshSettings
Example #55
0
 def decode(rsp, agent):
     _ret_ = raritan.rpc.emdmodel.Emd.Settings.decode(
         rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.emdmodel.Emd.Settings,
                         DecodeException)
     return _ret_
Example #56
0
 def decode(rsp, agent):
     _ret_ = raritan.rpc.test.Display.Info.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.test.Display.Info,
                         DecodeException)
     return _ret_
Example #57
0
 def decode(rsp, agent):
     _ret_ = raritan.rpc.test.Result.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.test.Result,
                         DecodeException)
     return _ret_
Example #58
0
 def decode(rsp, agent):
     _ret_ = raritan.rpc.usermgmt.Preferences.decode(
         rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.usermgmt.Preferences,
                         DecodeException)
     return _ret_
Example #59
0
 def encode(prefs):
     typecheck.is_struct(prefs, raritan.rpc.usermgmt.Preferences,
                         AssertionError)
     args = {}
     args['prefs'] = raritan.rpc.usermgmt.Preferences.encode(prefs)
     return args
Example #60
0
 def decode(rsp, agent):
     _ret_ = raritan.rpc.usermgmt.Role.Info.decode(rsp['_ret_'], agent)
     typecheck.is_struct(_ret_, raritan.rpc.usermgmt.Role.Info,
                         DecodeException)
     return _ret_