コード例 #1
0
def request_list(hostname, out_format):
    entity = utils.ENTITY_EXTERNAL_ENVIROMENT
    instant = 1

    json = '{"entity":%d, "instant":%d}' % (entity, instant)
    url = 'http://%s/api/v1/hwmon/get/device/maxtemp' % hostname
    utils.response_output(out_format, utils.http_request(url, json))

    json = '{"entity":%d, "instant":%d}' % (entity, instant)
    url = 'http://%s/api/v1/hwmon/get/device/abstemp' % hostname
    utils.response_output(out_format, utils.http_request(url, json))
コード例 #2
0
def request_list(hostname, out_format):
    entity = utils.ENTITY_AIC
    instant = 1

    json = '{"entity":%d, "instant":%d, "value":%f}' % (entity, instant, 100.0)
    url='http://%s/api/v1/hwmon/set/device/maxtemp' % hostname
    utils.response_output(out_format, utils.http_request(url, json))

    json = '{"entity":%d, "instant":%d, "value":%f}' % (entity, instant, 52.12)
    url='http://%s/api/v1/hwmon/set/device/abstemp' % hostname
    utils.response_output(out_format, utils.http_request(url, json))
コード例 #3
0
def request_list(hostname, out_format):
    entity = utils.ENTITY_PROCESSOR
    instant = 1

    json = '{"entity":%d, "instant":%d, "value":%f}' % (entity, instant, 165.0)
    url='http://%s/api/v1/hwmon/set/device/maxpower' % hostname
    utils.response_output(out_format, utils.http_request(url, json))

    json = '{"entity":%d, "instant":%d, "value":%f}' % (entity, instant, 65.0)
    url='http://%s/api/v1/hwmon/set/device/averagepower' % hostname
    utils.response_output(out_format, utils.http_request(url, json))
コード例 #4
0
def request_list(hostname, out_format):
    entity = utils.ENTITY_CPU
    instant = 1

    json = '{"entity":%d, "instant":%d, "value":{"maxtdp":%d, "cores":%d, "id":%d}}' % (
        entity, instant, 165, 64, 0x8086)
    url = 'http://%s/api/v1/hwmon/set/device/cpu/info' % hostname
    utils.response_output(out_format, utils.http_request(url, json))

    instant = 2
    json = '{"entity":%d, "instant":%d, "value":{"maxtdp":%d, "cores":%d, "id":%d}}' % (
        entity, instant, 165, 64, 0x8086)
    url = 'http://%s/api/v1/hwmon/set/device/cpu/info' % hostname
    utils.response_output(out_format, utils.http_request(url, json))
コード例 #5
0
ファイル: map_device_fan.py プロジェクト: YuanYuLin/go_hwmon
def request_list(hostname, out_format):
    json = '{"entity":-1, "instant":-1}'

    url = 'http://%s/api/v1/hwmon/get/map/alldevicefan' % hostname
    utils.response_output(out_format, utils.http_request(url, json))

    url = 'http://%s/api/v1/hwmon/get/map/allfandutyout' % hostname
    utils.response_output(out_format, utils.http_request(url, json))

    url = 'http://%s/api/v1/hwmon/get/map/allexpectduty' % hostname
    utils.response_output(out_format, utils.http_request(url, json))
コード例 #6
0
def request_list(hostname, out_format):
    entity = utils.ENTITY_PROCESSOR
    instant = 1

    json = '{"entity":%d, "instant":%d, "value":%f}' % (entity, instant, 0.0)
    url = 'http://%s/api/v1/hwmon/set/device/maxtemp' % hostname
    utils.response_output(out_format, utils.http_request(url, json))

    json = '{"entity":%d, "instant":%d, "value":%f}' % (entity, instant, -20.0)
    url = 'http://%s/api/v1/hwmon/set/device/reltemp' % hostname
    utils.response_output(out_format, utils.http_request(url, json))

    instant = 2

    json = '{"entity":%d, "instant":%d, "value":%f}' % (entity, instant, 0.0)
    url = 'http://%s/api/v1/hwmon/set/device/maxtemp' % hostname
    utils.response_output(out_format, utils.http_request(url, json))

    json = '{"entity":%d, "instant":%d, "value":%f}' % (entity, instant, -10.0)
    url = 'http://%s/api/v1/hwmon/set/device/reltemp' % hostname
    utils.response_output(out_format, utils.http_request(url, json))
コード例 #7
0
ファイル: exit_hwmon.py プロジェクト: YuanYuLin/go_hwmon
def request_list(hostname, out_format):
    json = '{"entity":%d, "instant":%d}' % (-1, -1)
    url = 'http://%s/api/v1/hwmon/exit/main' % hostname
    utils.response_output(out_format, utils.http_request(url, json))