Revision 2e6e03da
b/kamaki/cli/commands/cyclades.py | ||
---|---|---|
919 | 919 |
@errors.generic.all |
920 | 920 |
@errors.cyclades.connection |
921 | 921 |
def _run(self, ip=None): |
922 |
self._print( |
|
923 |
self.client.alloc_floating_ip(self['pool'], ip), print_dict) |
|
922 |
self._print([self.client.alloc_floating_ip(self['pool'], ip)]) |
|
924 | 923 |
|
925 | 924 |
def main(self, requested_address=None): |
926 | 925 |
super(self.__class__, self)._run() |
... | ... | |
958 | 957 |
|
959 | 958 |
|
960 | 959 |
@command(server_cmds) |
961 |
class server_ip_detach(_init_cyclades): |
|
960 |
class server_ip_detach(_init_cyclades, _optional_output_cmd):
|
|
962 | 961 |
"""Detach floating IP from server |
963 | 962 |
""" |
964 | 963 |
|
b/kamaki/clients/compute/rest_api.py | ||
---|---|---|
393 | 393 |
path = path4url('os-floating-ips', ip or '') |
394 | 394 |
return self.get(path, success=success, **kwargs) |
395 | 395 |
|
396 |
def floating_ips_post(self, json_data, ip='', success=201, **kwargs):
|
|
396 |
def floating_ips_post(self, json_data, ip='', success=200, **kwargs):
|
|
397 | 397 |
path = path4url('os-floating-ips', ip or '') |
398 | 398 |
if json_data is not None: |
399 | 399 |
json_data = json.dumps(json_data) |
b/kamaki/clients/cyclades/__init__.py | ||
---|---|---|
403 | 403 |
json_data = dict() |
404 | 404 |
if pool: |
405 | 405 |
json_data['pool'] = pool |
406 |
if address:
|
|
407 |
json_data['address'] = address
|
|
406 |
if address: |
|
407 |
json_data['address'] = address |
|
408 | 408 |
r = self.floating_ips_post(json_data) |
409 | 409 |
return r.json['floating_ip'] |
410 | 410 |
|
Also available in: Unified diff