open-flacon api历史数据

#!-*- coding:utf8 -*-

import requests
import time
import json

end = int(time.time()) start = end - 3600 #查询过去一小时的数据 d = { "start": start, "end": end, "cf": "AVERAGE", "endpoint_counters": [ { "endpoint": "host1", "counter": "cpu.idle", }, { "endpoint": "host1", "counter": "load.1min", }, ], } url = "http://127.0.0.1:9966/graph/history" r = requests.post(url, data=json.dumps(d)) print r.text

猜你喜欢

转载自www.cnblogs.com/oracle614/p/11844564.html