Bug #1399
The kamaki client lib fails to set server metadata
Status: | Closed | Start date: | 10/02/2011 | |
---|---|---|---|---|
Priority: | High | Due date: | 10/03/2011 | |
Assignee: | Giorgos Verigakis | % Done: | 0% |
|
Category: | kamaki | Spent time: | - | |
Target version: | v0.7 |
Description
The kamaki client lib fails to set server metadata.
Please implement and document the expected behavior.
In [20]: c.update_server_metadata(248, 'OS', 'kalhmera') Out[20]: {} In [21]: c.get_server_metadata(248) Out[21]: {}
Related issues
History
#1 Updated by Giorgos Verigakis almost 12 years ago
- Assignee changed from Giorgos Gousios to Giorgos Verigakis
#2 Updated by Giorgos Verigakis almost 12 years ago
This works as expected, update_server_metadata
will only update existing metadata. You need to use create_server_metadata
to create new ones.
See also Update Metadata in the OpenStack spec: http://docs.openstack.org/api/openstack-compute/1.1/content/Update_Metadata-d1e5208.html
#3 Updated by Vangelis Koukis almost 12 years ago
This doesn't seem to match the description in the OpenStack spec, ti seems metadata creation is also a function of the POST /servers/id/metadata
call:
An overLimit (413) fault may be thrown if the operation causes the maximum number of metadata items
to be exceeded. The maximum number of key-value pairs that can be supplied per server is determined
by the compute provider and may be queried via the maxServerMeta absolute limit.
How can one exceed the maximum number of metadata items, if one cannot create new items with this call? And besides, what happens if I ask to update a non-existent key? [The call lists HTTP 404 among the allowed responses, could this be a shortcoming of our API implementation?]. What if some keys exists, some don't?
I think the consistent way to handle this situation is:
For every key in the request: if a metadata item with this key already exists, update it. If no metadata item with this key exists, create a new one, taking into account the limit on the number of metadata items.
#4 Updated by Vangelis Koukis almost 12 years ago
After offline discussion, it seems this may be an issue with the semantics of the API, which have been modified in recent versions of the OpenStack Compute API spec. #1403 has been opened, to align our implementation with the enhanced semantics, described in the latest version of the draft.
#5 Updated by Vangelis Koukis almost 12 years ago
- Status changed from Assigned to Closed
This ticket may close, update_server_metadata
creates any missing metadata keys, #1403 has been opened to align our implementation with the current OpenStack API draft.