Revision d5841e90 kamaki/clients/cyclades/rest_api.py

b/kamaki/clients/cyclades/rest_api.py
47 47
        """GET base_url/servers/<server_id>/diagnostics"""
48 48
        path = path4url('servers', server_id, 'diagnostics')
49 49
        return self.get(path, success=200, **kwargs)
50

  
51
    def networks_action_post(
52
            self, network_id='', json_data=None, success=202, **kwargs):
53
        """POST base_url/networks/<network_id>/action
54

  
55
        :returns: request response
56
        """
57
        if json_data:
58
            json_data = json.dumps(json_data)
59
            self.set_header('Content-Type', 'application/json')
60
            self.set_header('Content-Length', len(json_data))
61
        path = path4url('networks', network_id, 'action')
62
        return self.post(path, data=json_data, success=success, **kwargs)
63

  
64
    def floating_ip_action_post(
65
            self, fip_id, json_data=None, success=202, **kwargs):
66
        """POST base_url/os-floating-ips/<fip_id>/action
67

  
68
        :returns: request response
69
        """
70
        if json_data:
71
            json_data = json.dumps(json_data)
72
            self.set_header('Content-Type', 'application/json')
73
            self.set_header('Content-Length', len(json_data))
74
        path = path4url('os-floating-ips', fip_id, 'action')
75
        return self.post(path, data=json_data, success=success, **kwargs)

Also available in: Unified diff