Revision 1c366ac9 kamaki/clients/compute/__init__.py

b/kamaki/clients/compute/__init__.py
130 130

  
131 131
        :param networks: (list of dicts) Networks to connect to, list this:
132 132
            "networks": [
133
                {"network": <network_uuid>},
134
                {"network": <network_uuid>, "fixed_ip": address},
135
                {"port": <port_id>}, ...]
133
            {"network": <network_uuid>},
134
            {"network": <network_uuid>, "fixed_ip": address},
135
            {"port": <port_id>}, ...]
136 136
            ATTENTION: Empty list is different to None. None means ' do not
137 137
            mention it', empty list means 'automatically get an ip'
138 138

  
......
258 258

  
259 259
    def get_server_metadata(self, server_id, key='', response_headers=dict(
260 260
            previous=None, next=None)):
261
        """
262
        :param server_id: integer (str or int)
263

  
264
        :param key: (str) the metadatum key (all metadata if not given)
265

  
266
        :returns: a key:val dict of requests metadata
267
        """
268 261
        r = self.servers_metadata_get(server_id, key)
269 262
        for k, v in response_headers.items():
270 263
            response_headers[k] = r.headers.get(k, v)
271 264
        return r.json['meta' if key else 'metadata']
272 265

  
273 266
    def create_server_metadata(self, server_id, key, val):
274
        """
275
        :param server_id: integer (str or int)
276

  
277
        :param key: (str)
278

  
279
        :param val: (str)
280

  
281
        :returns: dict of updated key:val metadata
282
        """
283 267
        req = {'meta': {key: val}}
284 268
        r = self.servers_metadata_put(
285 269
            server_id, key, json_data=req, success=201)
......
288 272
    def update_server_metadata(
289 273
            self, server_id,
290 274
            response_headers=dict(previous=None, next=None), **metadata):
291
        """
292
        :param server_id: integer (str or int)
293

  
294
        :param metadata: dict of key:val metadata
295

  
296
        :returns: dict of updated key:val metadata
297
        """
298 275
        req = {'metadata': metadata}
299 276
        r = self.servers_metadata_post(server_id, json_data=req, success=201)
300 277
        for k, v in response_headers.items():
......
302 279
        return r.json['metadata']
303 280

  
304 281
    def delete_server_metadata(self, server_id, key):
305
        """
306
        :param server_id: integer (str or int)
307

  
308
        :param key: (str) the meta key
309

  
310
        :returns: (dict) response headers
311
        """
312 282
        r = self.servers_metadata_delete(server_id, key)
313 283
        return r.headers
314 284

  
315 285
    def list_flavors(self, detail=False, response_headers=dict(
316 286
            previous=None, next=None)):
317
        """
318
        :param detail: (bool) detailed flavor info if set, short if not
319

  
320
        :returns: (list) flavor info
321
        """
322 287
        r = self.flavors_get(detail=bool(detail))
323 288
        for k, v in response_headers.items():
324 289
            response_headers[k] = r.headers.get(k, v)
325 290
        return r.json['flavors']
326 291

  
327 292
    def get_flavor_details(self, flavor_id):
328
        """
329
        :param flavor_id: integer (str or int)
330

  
331
        :returns: dict
332
        """
333 293
        r = self.flavors_get(flavor_id)
334 294
        return r.json['flavor']
335 295

  
336 296
    def list_images(self, detail=False, response_headers=dict(
337 297
            next=None, previous=None)):
338
        """
339
        :param detail: (bool) detailed info if set, short if not
340

  
341
        :returns: dict id,name + full info if detail
342
        """
343 298
        r = self.images_get(detail=bool(detail))
344 299
        for k, v in response_headers.items():
345 300
            response_headers[k] = r.headers.get(k, v)
......
347 302

  
348 303
    def get_image_details(self, image_id, **kwargs):
349 304
        """
350
        :param image_id: integer (str or int)
351

  
352 305
        :returns: dict
353 306

  
354 307
        :raises ClientError: 404 if image not available

Also available in: Unified diff