Comment 1 for bug 1367564

Revision history for this message
Pawel Koniszewski (pawel-koniszewski) wrote :

Travis,

I have analyzed things a bit here and I want to propose another solution which is clearer to me.

What you suggested is that after doing this:
glance --os-image-api-version 2 md-namespace-show OS::Compute::VirtCPUTopology --resource-type OS::Glance::Image

You want to do this:
glance --os-image-api-version 2 md-property-show OS::Compute::VirtCPUTopology hw_cpu_cores

The problem I see there is that such calls are inconsistent. In the first command you ask for namespace with specific resource type, but in another request you just want property without specifying resource type. I would say that 404 in this case is correct result.

Instead of resolving errors on the API side (possible name conflicts. a lot of DB calls to determine which property should be returned) my proposition is to add optional argument '--resource-type' to md_property_show command and extend API to handle such argument in URL. Previous calls changed to new way:

glance --os-image-api-version 2 md-namespace-show OS::Compute::VirtCPUTopology --resource-type OS::Glance::Image
glance --os-image-api-version 2 md-property-show OS::Compute::VirtCPUTopology --resource-type OS::Glance::Image hw_cpu_cores

This keeps consistency across every call, you can keep asking for properties associated to specific resource type the same way that you can do it with namespaces.

I will appreciate every comment, thanks!