Revision 7b6e977c kamaki/clients/image/__init__.py
b/kamaki/clients/image/__init__.py | ||
---|---|---|
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 | 34 |
from kamaki.clients import Client, ClientError |
35 |
from kamaki.clients.utils import path4url |
|
35 |
from kamaki.clients.utils import path4url, filter_in
|
|
36 | 36 |
|
37 | 37 |
|
38 | 38 |
class ImageClient(Client): |
... | ... | |
109 | 109 |
disc_format, container_format, size, checksum, is_public, owner |
110 | 110 |
|
111 | 111 |
:param properties: (dict) image properties (X-Image-Meta-Property) |
112 |
|
|
113 |
:returns: (dict) details of the created image |
|
112 | 114 |
""" |
113 | 115 |
path = path4url('images') + '/' |
114 | 116 |
self.set_header('X-Image-Meta-Name', name) |
... | ... | |
124 | 126 |
for key, val in properties.items(): |
125 | 127 |
async_headers['x-image-meta-property-%s' % key] = val |
126 | 128 |
|
127 |
self.post(path, success=200, async_headers=async_headers) |
|
129 |
r = self.post(path, success=200, async_headers=async_headers) |
|
130 |
return filter_in(r.headers, 'X-Image-') |
|
128 | 131 |
|
129 | 132 |
def list_members(self, image_id): |
130 | 133 |
""" |
Also available in: Unified diff