本文整理汇总了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函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:35,代码来源:sensor.py
示例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)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py
示例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)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:30,代码来源:sdr.py
示例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)
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:7,代码来源:event.py
示例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)
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:7,代码来源:sensor.py
示例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
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:7,代码来源:sdr.py
示例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])
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py
示例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)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py
示例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)
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:7,代码来源:lan.py
示例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
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py
示例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)
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:25,代码来源:sensor.py
示例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
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py
示例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)
开发者ID:sadig,项目名称:python-ipmi,代码行数:7,代码来源:hpm.py
示例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)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:7,代码来源:picmg.py
示例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)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:9,代码来源:picmg.py
示例16: sel_entries
def sel_entries(self):
"""Generator which returns all SEL entries."""
req = create_request_by_name('GetSelInfo')
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
if rsp.entries == 0:
return
reservation_id = self.get_sel_reservation_id()
next_record_id = 0
while True:
req = create_request_by_name('GetSelEntry')
req.reservation_id = reservation_id
req.record_id = next_record_id
req.offset = 0
self.max_req_len = 0xff # read entire record
record_data = ByteBuffer()
while True:
req.length = self.max_req_len
if (self.max_req_len != 0xff
and (req.offset + req.length) > 16):
req.length = 16 - req.offset
rsp = self.send_message(req)
if rsp.completion_code == constants.CC_CANT_RET_NUM_REQ_BYTES:
if self.max_req_len == 0xff:
self.max_req_len = 16
else:
self.max_req_len -= 1
continue
else:
check_completion_code(rsp.completion_code)
record_data.append_array(rsp.record_data)
req.offset = len(record_data)
if len(record_data) >= 16:
break
next_record_id = rsp.next_record_id
yield SelEntry(record_data)
if next_record_id == 0xffff:
break
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:44,代码来源:sel.py
示例17: write_fru_data
def write_fru_data(self, data, offset=0, fru_id=0):
req = create_request_by_name('WriteFruData')
req.fru_id = fru_id
for chunk in chunks(data, self.write_length):
req.offset = offset
req.data = chunk
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
offset += len(chunk)
开发者ID:jjjesus,项目名称:python-ipmi,代码行数:10,代码来源:fru.py
示例18: _get_device_sdr_chunk
def _get_device_sdr_chunk(self, reservation_id, record_id, offset, length):
req = create_request_by_name('GetDeviceSdr')
req.reservation_id = reservation_id
req.record_id = record_id
req.offset = offset
req.bytes_to_read = length
rsp = get_sdr_chunk_helper(self.send_message, req, \
self.reserve_device_sdr_repository)
return (rsp.next_record_id, rsp.record_data)
开发者ID:Teslafly,项目名称:python-ipmi,代码行数:11,代码来源:sensor.py
示例19: delete_sdr
def delete_sdr(self, record_id):
"""Deletes the sensor record specified by 'record_id'.
"""
reservation_id = self.reserve_device_sdr_repository()
req = create_request_by_name('DeleteSdr')
req.reservation_id = reservation_id
req.record_id = record_id
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
return rsp.record_id
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:11,代码来源:sdr.py
示例20: i2c_write_read
def i2c_write_read(self, type, id, channel, address, count, data=None):
req = create_request_by_name('MasterWriteRead')
req.bus_id.type = type
req.bus_id.id= id
req.bus_id.channel = channel
req.bus_id.slave_address = address
req.read_count = count
if data:
req.data = data
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)
return rsp.data
开发者ID:erik-smit,项目名称:python-ipmi,代码行数:12,代码来源:bmc.py
注:本文中的pyipmi.msgs.create_request_by_name函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论