Revision 6add54fd kamaki/clients/cyclades.py
b/kamaki/clients/cyclades.py | ||
---|---|---|
85 | 85 |
r = self.get(path, success=200) |
86 | 86 |
return r.json['stats'] |
87 | 87 |
|
88 |
|
|
89 | 88 |
def list_networks(self, detail=False): |
90 | 89 |
path = path4url('networks', 'detail') if detail else path4url('networks') |
91 | 90 |
print('ready to get network list with this req: '+path) |
... | ... | |
118 | 117 |
self.post(path, json=req, success=202) |
119 | 118 |
|
120 | 119 |
def disconnect_server(self, server_id, network_id): |
120 |
matched_nets = [net for net in self.list_server_addresses(server_id) if net['network_id'] == network_id] |
|
121 | 121 |
path = path4url('networks', network_id, 'action') |
122 |
req = {'remove': {'serverRef': server_id}} |
|
123 |
self.post(path, json=req, success=202) |
|
122 |
for nic in matched_nets: |
|
123 |
req = {'remove': {'attachment': unicode(nic['id'])}} |
|
124 |
self.post(path, json=req, success=202) |
Also available in: Unified diff