本文整理汇总了Python中pyipmi.msgs.create_request_by_name函数的典型用法代码示例。如果您正苦于以下问题:Python create_request_by_name函数的具体用法?Python create_request_by_name怎么用?Python create_request_by_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_request_by_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_sensor_thresholds
def set_sensor_thresholds(self, sensor_number, lun=0, unr=None, ucr=None,
unc=None, lnc=None, lcr=None, lnr=None):
"""Set the sensor thresholds that are not 'None'
`sensor_number`
`unr` for upper non-recoverable
`ucr` for upper critical
`unc` for upper non-critical
`lnc` for lower non-critical
`lcr` for lower critical
`lnr` for lower non-recoverable
"""
req = create_request_by_name('SetSensorThresholds')
req.sensor_number = sensor_number
req.lun = lun
if unr is not None:
req.set_mask.unr = 1
req.threshold.unr = unr
if ucr is not None:
req.set_mask.ucr = 1
req.threshold.ucr = ucr
if unc is not None:
req.set_mask.unc = 1
req.threshold.unc = unc
if lnc is not None:
req.set_mask.lnc = 1
req.threshold.lnc = lnc
if lcr is not None:
req.set_mask.lcr = 1
req.threshold.lcr = lcr
if lnr is not None:
req.set_mask.lnr = 1
req.threshold.lnr = lnr
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
示例2: get_led_state
def get_led_state(self, fru_id, led_id):
req = create_request_by_name('GetFruLedState')
req.fru_id = fru_id
req.led_id = led_id
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
return LedState(rsp)
示例3: _get_sdr_chunk
def _get_sdr_chunk(self, reservation_id, record_id, offset, length):
print length
req = create_request_by_name('GetSdr')
req.reservation_id = reservation_id
req.record_id = record_id
req.offset = offset
req.bytes_to_read = length
retry = 5
while True:
retry -= 1
if retry == 0:
raise RetryError()
rsp = self.send_message(req)
if rsp.completion_code == constants.CC_OK:
break
elif rsp.completion_code == constants.CC_RES_CANCELED:
req.reservation_id = self.reserve_sdr_repository()
time.sleep(0.1)
continue
elif rsp.completion_code == constants.CC_TIMEOUT:
time.sleep(0.1)
continue
elif rsp.completion_code == constants.CC_RESP_COULD_NOT_BE_PRV:
time.sleep(0.1 * retry)
continue
else:
check_completion_code(rsp.completion_code)
return (rsp.next_record_id, rsp.data)
示例4: get_event_receiver
def get_event_receiver(self):
req = create_request_by_name('GetEventReceiver')
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
ipmb_address = rsp.event_receiver.ipmb_i2c_slave_address
lun = rsp.event_receiver.lun
return (ipmb_address, lun)
示例5: rearm_sensor_events
def rearm_sensor_events(self, sensor_number):
"""Rearm sensor events for the given sensor number.
"""
req = create_request_by_name('RearmSensorEvents')
req.sensor_number = sensor_number
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
示例6: _clear_sdr_repository
def _clear_sdr_repository(self, cmd, reservation_id):
req = create_request_by_name('ClearSdrRepository')
req.reservation_id = reservation_id
req.cmd = cmd
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
return rsp.status.erase_in_progress
示例7: get_power_channel_status
def get_power_channel_status(self, starting_number):
req = create_request_by_name('GetPowerChannelStatus')
req.starting_power_channel_number = starting_number
req.power_channel_count = 1
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
return PowerChannelStatus(rsp.data[0])
示例8: clear_fru_deactivation_lock
def clear_fru_deactivation_lock(self, fru_id):
req = create_request_by_name('SetFruActivationPolicy')
req.fru_id = fru_id
req.mask.deactivation_locked = 1
req.set.deactivation_locked = 0
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
示例9: set_lan_configuration_parameters
def set_lan_configuration_parameters(self, channel, parameter_selector, data):
req = create_request_by_name('SetLanConfigurationParameters')
req.command.channel_number = channel
req.parameter_selector = parameter_selector
req.data = data
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
示例10: get_signaling_class
def get_signaling_class(self, interface, channel):
req = create_request_by_name('GetSignalingClass')
req.channel_info.channel_number = channel
req.channel_info.interface = interface
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
return rsp.channel_signaling.class_capability
示例11: set_sensor_thresholds
def set_sensor_thresholds(self, sensor_number, lun=0, unr=None, ucr=None,
unc=None, lnc=None, lcr=None, lnr=None):
"""Set the sensor thresholds that are not 'None'
`sensor_number`
`unr` for upper non-recoverable
`ucr` for upper critical
`unc` for upper non-critical
`lnc` for lower non-critical
`lcr` for lower critical
`lnr` for lower non-recoverable
"""
req = create_request_by_name('SetSensorThresholds')
req.sensor_number = sensor_number
req.lun = lun
thresholds = dict(unr=unr, ucr=ucr, unc=unc, lnc=lnc, lcr=lcr, lnr=lnr)
for k, v in thresholds.items():
if v is not None:
setattr(req.set_mask, k, 1)
setattr(req.threshold, k, v)
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
示例12: fru_control
def fru_control(self, fru_id, option):
req = create_request_by_name('FruControl')
req.fru_id = fru_id
req.option = option
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
return rsp.rsp_data
示例13: get_component_property
def get_component_property(self, component_id, property_id):
req = create_request_by_name('GetComponentProperties')
req.id = component_id
req.selector = property_id
rsp = self.send_message(req)
self._check_completion_code(rsp)
return ComponentProperty.create_from_id(property_id, rsp)
示例14: get_power_level
def get_power_level(self, fru_id, power_type):
req = create_request_by_name('GetPowerLevel')
req.fru_id = fru_id
req.power_type = power_type
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
return PowerLevel(rsp)
示例15: get_fan_level
def get_fan_level(self, fru_id):
req = create_request_by_name('GetFanLevel')
req.fru_id = fru_id
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
local_control_fan_level = None
if rsp.data:
local_control_fan_level = rsp.data[0]
return (rsp.override_fan_level, local_control_fan_level)