← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1367564] Re: metadata definition property show should handle type specific prefix

 

** Also affects: python-glanceclient
   Importance: Undecided
       Status: New

** Changed in: python-glanceclient
     Assignee: (unassigned) => Pawel Koniszewski (pawel-koniszewski)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1367564

Title:
  metadata definition property show should handle type specific prefix

Status in OpenStack Image Registry and Delivery Service (Glance):
  In Progress
Status in Python client library for Glance:
  New

Bug description:
  metadata definition property show should handle type specific prefix

  The metadata definitions API supports listing namespaces by resource
  type.  For example, you can list only namespaces applicable to images
  by specifying OS::Glance::Image

  The API also support showing namespace properties for a specific
  resource type.  The API will automatically prepend any prefix specific
  to that resource type.  For example, in the
  OS::Compute::VirtCPUTopology namespace, the properties will come back
  with "hw_" prepended.

  However, if you then ask the API to show the property with the prefix,
  it will return a "not found" error.   To actually see the details of
  the property, you have to know the base property (without the prefix).
  It would be nice if the API would attempt to auto-resolve any
  automatically prefixed properties when showing a property.

  This is evident from the command line.  If you look at the below
  interactions, you will see the namespaces listed, then limited to a
  particular resource type, then the properties shown for the namespace,
  and then a failure to show the property using the automatically
  prepended prefix.

  * Apologize for formatting.

  $ glance --os-image-api-version 2 md-namespace-list
  +------------------------------------+
  | namespace                          |
  +------------------------------------+
  | OS::Compute::VMware                |
  | OS::Compute::XenAPI                |
  | OS::Compute::Quota                 |
  | OS::Compute::Libvirt               |
  | OS::Compute::Hypervisor            |
  | OS::Compute::Watchdog              |
  | OS::Compute::HostCapabilities      |
  | OS::Compute::Trust                 |
  | OS::Compute::VirtCPUTopology       |
  | OS::Glance:CommonImageProperties   |
  | OS::Compute::RandomNumberGenerator |
  +------------------------------------+

  $ glance --os-image-api-version 2 md-namespace-list --resource-type OS::Glance::Image
  +------------------------------+
  | namespace                    |
  +------------------------------+
  | OS::Compute::VMware          |
  | OS::Compute::XenAPI          |
  | OS::Compute::Libvirt         |
  | OS::Compute::Hypervisor      |
  | OS::Compute::Watchdog        |
  | OS::Compute::VirtCPUTopology |
  +------------------------------+

  $ glance --os-image-api-version 2 md-namespace-show OS::Compute::VirtCPUTopology --resource-type OS::Glance::Image
  +----------------------------+----------------------------------------------------------------------------------+
  | Property                   | Value                                                                            |
  +----------------------------+----------------------------------------------------------------------------------+
  | created_at                 | 2014-09-10T02:55:40Z                                                             |
  | description                | This provides the preferred socket/core/thread counts for the virtual CPU        |
  |                            | instance exposed to guests. This enables the ability to avoid hitting            |
  |                            | limitations on vCPU topologies that OS vendors place on their products. See      |
  |                            | also: http://git.openstack.org/cgit/openstack/nova-specs/tree/specs/juno/virt-   |
  |                            | driver-vcpu-topology.rst                                                         |
  | display_name               | Virtual CPU Topology                                                             |
  | namespace                  | OS::Compute::VirtCPUTopology                                                     |
  | owner                      | admin                                                                            |
  | properties                 | ["hw_cpu_cores", "hw_cpu_sockets", "hw_cpu_maxsockets", "hw_cpu_threads",        |
  |                            | "hw_cpu_maxcores", "hw_cpu_maxthreads"]                                          |
  | protected                  | True                                                                             |
  | resource_type_associations | ["OS::Glance::Image", "OS::Cinder::Volume", "OS::Nova::Flavor"]                  |
  | schema                     | /v2/schemas/metadefs/namespace                                                   |
  | visibility                 | public                                                                           |
  +----------------------------+----------------------------------------------------------------------------------+

  ttripp@ubuntu:/opt/stack/glance$ glance --os-image-api-version 2 md-property-show OS::Compute::VirtCPUTopology hw_cpu_cores
  Request returned failure status 404.
  <html>
   <head>
    <title>404 Not Found</title>
   </head>
   <body>
    <h1>404 Not Found</h1>
    Could not find property hw_cpu_cores<br /><br />

   </body>
  </html> (HTTP 404)

  ttripp@ubuntu:/opt/stack/glance$ glance --os-image-api-version 2 md-property-show OS::Compute::VirtCPUTopology cpu_cores
  +-------------+---------------------------------------------------+
  | Property    | Value                                             |
  +-------------+---------------------------------------------------+
  | description | Preferred number of cores to expose to the guest. |
  | name        | cpu_cores                                         |
  | title       | vCPU Cores                                        |
  | type        | integer                                           |
  +-------------+---------------------------------------------------+

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1367564/+subscriptions


References