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:
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.
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: api-version 2 md-namespace-show OS::Compute: :VirtCPUTopolog y --resource-type OS::Glance::Image
glance --os-image-
You want to do this: api-version 2 md-property-show OS::Compute: :VirtCPUTopolog y hw_cpu_cores
glance --os-image-
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: :VirtCPUTopolog y --resource-type OS::Glance::Image api-version 2 md-property-show OS::Compute: :VirtCPUTopolog y --resource-type OS::Glance::Image hw_cpu_cores
glance --os-image-
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!