Revision 334c1b75 tools/cloud

b/tools/cloud
610 610
        body = json.dumps({'remove': {'serverRef': server_id}})
611 611
        self.http_post(path, body, expected_status=202)
612 612

  
613
@command_name('stats')
614
class ServerStats(Command):
615
    description = 'get server stats'
616
    syntax = '<server id>'
617

  
618
    def execute(self, server_id):
619
        path = '/api/%s/servers/%d/stats' % (self.api, int(server_id))
620
        reply = self.http_get(path)
621
        stats = reply['stats']
622
        stats.pop('serverRef')
623
        print_dict(stats)
624

  
613 625

  
614 626
def print_usage():
615 627
    print 'Usage: %s <command>' % basename(argv[0])

Also available in: Unified diff