~citrix-openstack/nova/xenapi

« back to all changes in this revision

Viewing changes to nova/api/ec2/admin.py

merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from nova import log as logging
30
30
from nova import utils
31
31
from nova.auth import manager
32
 
from nova.compute import instance_types
33
32
 
34
33
 
35
34
FLAGS = flags.FLAGS
80
79
    return rv
81
80
 
82
81
 
83
 
def instance_dict(name, inst):
84
 
    return {'name': name,
 
82
def instance_dict(inst):
 
83
    return {'name': inst['name'],
85
84
            'memory_mb': inst['memory_mb'],
86
85
            'vcpus': inst['vcpus'],
87
86
            'disk_gb': inst['local_gb'],
115
114
    def __str__(self):
116
115
        return 'AdminController'
117
116
 
118
 
    def describe_instance_types(self, _context, **_kwargs):
119
 
        return {'instanceTypeSet': [instance_dict(n, v) for n, v in
120
 
                                    instance_types.INSTANCE_TYPES.iteritems()]}
 
117
    def describe_instance_types(self, context, **_kwargs):
 
118
        """Returns all active instance types data (vcpus, memory, etc.)"""
 
119
        return {'instanceTypeSet': [db.instance_type_get_all(context)]}
121
120
 
122
121
    def describe_user(self, _context, name, **_kwargs):
123
122
        """Returns user data, including access and secret keys."""