def set_entity_info_state(res_hdl, state): """Set the entity info presence state.""" # Build db query parameters attr = '%s = %s' % (consts.INFO_PRESENCE, str(state)) condition = '%s = %s' % (consts.TBL_RESOURCE_HDL, str(res_hdl)) db.sql_set_attr(consts.TABLE_INFO, attr, condition)
def set_entity_fan_status(res_hdl, status): """Set the platform media entity fan fault status.""" # Build db query parameters attr = '%s = %s' % (consts.FAN_FAULT, str(status)) condition = '%s = %s' % (consts.TBL_RESOURCE_HDL, str(res_hdl)) db.sql_set_attr(consts.TABLE_FAN, attr, condition)
def set_entity_info_status(res_hdl, status): """Set the entity info fault status.""" # Build db query parameters attr = '%s = %s' % (consts.INFO_FAULT, str(status)) condition = '%s = %s' % (consts.TBL_RESOURCE_HDL, str(res_hdl)) db.sql_set_attr(consts.TABLE_INFO, attr, condition)
def set_thermal_temp(res_hdl, status): """Set the thermal sensor temperature.""" # Build db query parameters attr = '%s = %s' % (consts.THERMAL_TEMPERATURE, str(status)) condition = '%s = %s' % (consts.TBL_RESOURCE_HDL, str(res_hdl)) db.sql_set_attr(consts.TABLE_THERMAL_SENSOR, attr, condition)
def set_thermal_status(res_hdl, status): """Set the thermal sensor fault status.""" # Build db query parameters attr = '%s = %s' % (consts.THERMAL_FAULT, str(status)) condition = '%s = %s' % (consts.TBL_RESOURCE_HDL, str(res_hdl)) db.sql_set_attr(consts.TABLE_THERMAL_SENSOR, attr, condition)
def set_port_optics_state(res_hdl, state): """Set the port optics state.""" # Build db query parameters attr = '%s = %s' % (consts.MEDIA_PRESENCE, str(state)) condition = '%s = %s' % (consts.TBL_RESOURCE_HDL, str(res_hdl)) db.sql_set_attr(consts.TABLE_MEDIA, attr, condition)
def set_media_attr(res_hdl, parameter, value): """Set the sdi Media database table attribute to the value satisfying the condition.""" # Build db query parameters attr = '%s = %s' % (parameter, value) condition = '%s = %s' % (consts.TBL_RESOURCE_HDL, str(res_hdl)) db.sql_set_attr(consts.TABLE_MEDIA, attr, condition)
def set_media_param_attr(res_hdl, parameter, value): """Set the sdi Media Param database table attribute satisfying the condition.""" # Build db query parameters attr = '%s = %s' % (consts.MEDIA_PARAM_VALUE, str(value)) condition = '%s = %s and %s = %s' % (consts.TBL_RESOURCE_HDL, str(res_hdl), consts.MEDIA_PARAM_TYPE, str(parameter)) db.sql_set_attr(consts.TABLE_MEDIA_PARAMS, attr, condition)
def set_media_vendor_info_attr(res_hdl, parameter, value): """Set the sdi Media Vendor Info database table attribute satisfying the condition.""" # Build db query parameters attr = '%s = %s' % (consts.MEDIA_VENDOR_INFO_VALUE, str(value)) condition = '%s = %s and %s = %s' % (consts.TBL_RESOURCE_HDL, str(res_hdl), consts.MEDIA_VENDOR_INFO_TYPE, str(parameter)) db.sql_set_attr(consts.TABLE_MEDIA_VENDOR_INFO, attr, condition)