Revision ef2e6c9f kamaki/clients/compute/rest_api.py

b/kamaki/clients/compute/rest_api.py
250 250
        path = path4url('servers', server_id, 'metadata', key)
251 251
        return self.delete(path, success=success, **kwargs)
252 252

  
253
    def servers_actions_post(
254
            self, server_id, json_data=None, success=202, **kwargs):
255
        """POST base_url/servers/<server_id>/action
256

  
257
        :returns: request response
258
        """
259
        if json_data:
260
            json_data = json.dumps(json_data)
261
            self.set_header('Content-Type', 'application/json')
262
            self.set_header('Content-Length', len(json_data))
263
        path = path4url('servers', server_id, 'action')
264
        return self.post(path, data=json_data, success=success, **kwargs)
265

  
253 266
    """
254 267
    def servers_actions_post
255 268
    def servers_ips_get
256
    """
257 269

  
258
    """
259 270
    def servers_get(self, server_id='', command='', success=200, **kwargs):
260 271
        ""GET base_url/servers[/server_id][/command] request
261 272

  
......
270 281
        :returns: request response
271 282
        ""
272 283
        path = path4url('servers', server_id, command)
273
    ""
274

  
275
    def servers_delete(self, server_id='', command='', success=204, **kwargs):
276
        ""DEL ETE base_url/servers[/server_id][/command] request
277

  
278
        :param server_id: integer (as int or str)
279

  
280
        :param command: 'ips', 'stats', or ''
281

  
282
        :param success: success code or list or tupple of accepted success
283
            codes. if server response code is not in this list, a ClientError
284
            raises
285

  
286
        :returns: request response
287
        ""
288
        path = path4url('servers', server_id, command)
289
        return self.delete(path, success=success, **kwargs)
290 284

  
291 285
    def servers_post(
292 286
            self,
......
317 311

  
318 312
        path = path4url('servers', server_id, command)
319 313
        return self.post(path, data=data, success=success, **kwargs)
320

  
321
    def servers_put(
322
            self,
323
            server_id='',
324
            command='',
325
            json_data=None,
326
            success=204,
327
            **kwargs):
328
        ""PUT base_url/servers[/server_id]/[command] request
329

  
330
        :param server_id: integer (as int or str)
331

  
332
        :param command: 'ips', 'stats', or ''
333

  
334
        :param json_data: a json-formated dict that will be send as data
335

  
336
        :param success: success code or list or tupple of accepted success
337
            codes. if server response code is not in this list, a ClientError
338
            raises
339

  
340
        :returns: request response
341
        ""
342
        data = json_data
343
        if json_data is not None:
344
            data = json.dumps(json_data)
345
            self.set_header('Content-Type', 'application/json')
346
            self.set_header('Content-Length', len(data))
347

  
348
        path = path4url('servers', server_id, command)
349
        return self.put(path, data=data, success=success, **kwargs)
350 314
    """
351 315

  
352 316
    def flavors_get(self, flavor_id='', command='', success=200, **kwargs):

Also available in: Unified diff