agent/cloud_node_statistics.py

17 lines
358 B
Python
Raw Normal View History

2015-12-14 05:02:08 +03:00
# coding: utf-8
2016-04-20 03:39:25 +03:00
from SWSCloudNode import Node
from SWSCloudNode import lxc
2015-12-14 05:02:08 +03:00
2016-04-20 03:39:25 +03:00
cls_lxc = lxc.lxc()
cls_node = Node()
2015-12-14 05:02:08 +03:00
2016-04-20 03:39:25 +03:00
containers = cls_lxc.list()
2015-12-14 05:02:08 +03:00
for container in containers:
# print container
2016-04-20 03:39:25 +03:00
info = cls_lxc.info(container)
2015-12-14 05:02:08 +03:00
info['container_id'] = info['name']
2016-04-20 03:39:25 +03:00
print cls_node.report_container_stats(info['container_id'], info)
2015-12-14 05:02:08 +03:00
# print info