blob: d413d7a37eea296be2794fbea055c450b872b081 [file] [log] [blame]
Sean Dague70112362012-04-03 13:48:49 -04001#!/usr/bin/env python
2
3# vim: tabstop=4 shiftwidth=4 softtabstop=4
4
5# Copyright 2011 Quanta Research Cambridge, Inc.
6#
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18
19from novaclient.v1_1 import client
20import tempest.config
21
22# get the environment variables for credentials
23identity = tempest.config.TempestConfig().identity
24compute = tempest.config.TempestConfig().compute
25print compute.username, compute.password,\
26 compute.tenant_name, identity.auth_url
27
28nt = client.Client(compute.username, compute.password,
29 compute.tenant_name, identity.auth_url)
30
31flavor_list = nt.flavors.list()
32server_list = nt.servers.list()
33images_list = nt.images.list()
34keypairs_list = nt.keypairs.list()
35floating_ips_list = nt.floating_ips.list()
36
37print "total servers: %3d, total flavors: %3d, total images: %3d" % \
38 (len(server_list),
39 len(flavor_list),
40 len(images_list))
41
42print "total keypairs: %3d, total floating ips: %3d" % \
43 (len(keypairs_list),
44 len(floating_ips_list))
45
46print "flavors:\t", flavor_list
47print "servers:\t", server_list
48print "images: \t", images_list
49print "keypairs:\t", keypairs_list
50print "floating ips:\t", floating_ips_list