console/SWSStatisticsClient/__init__.py

10 lines
289 B
Python
Raw Normal View History

2016-10-14 11:21:48 +03:00
import requests
class SWSStatisticsClient(object):
def get_vm(self, vm_id, limit=96):
2016-11-03 09:08:12 +03:00
r = requests.get('http://server-stats.gocloud.ru/stats/v1/compute/vms/%s' % vm_id, params={'limit': limit})
2016-10-14 11:21:48 +03:00
if r.status_code == 200:
return r.json()
return None