Get all flavors by the interface 'detail',it is inefficient . because it return datas have no extra_specs information ,why not get them by the interface 'show', as we all konw: In the file of nova/api/openstack/compute/views/flavors.py
def show(self, request, flavor):
flavor_dict = { "flavor": { "id": flavor["flavorid"], "name": flavor["name"], "ram": flavor["memory_mb"], "disk": flavor["root_gb"], "vcpus": flavor.get("vcpus") or "", "links": self._get_links(request, flavor["flavorid"], self._collection_name),
},
}
if flavor.get('extra_specs'): flavor_dict['flavor']['extra_specs'] = flavor['extra_specs'] # get extra_specs information and return it here.
return flavor_dict
Get all flavors by the interface 'detail',it is inefficient . because it return datas have no extra_specs information ,why not get them by the interface 'show', as we all konw: In the file of nova/api/ openstack/ compute/ views/flavors. py
"flavor" : {
"id": flavor["flavorid"],
"name" : flavor["name"],
"ram" : flavor[ "memory_ mb"],
"disk" : flavor["root_gb"],
"vcpus" : flavor.get("vcpus") or "",
"links" : self._get_ links(request,
flavor[ "flavorid" ],
self. _collection_ name), get('extra_ specs') :
flavor_ dict['flavor' ]['extra_ specs'] = flavor[ 'extra_ specs'] # get extra_specs information and return it here.
def show(self, request, flavor):
flavor_dict = {
},
}
if flavor.
return flavor_dict
At the same time,should modfiy in the novaclient.