| from designatev2.common import send |
| from designatev2.arg_converter import get_by_name_or_uuid_multiple |
| |
| |
| @send('post') |
| def zone_create(name, email, **kwargs): |
| url = '/zones' |
| json = { |
| 'name': name, |
| 'email': email, |
| } |
| json.update(kwargs) |
| return url, json |
| |
| |
| @get_by_name_or_uuid_multiple([('zone', 'zone_id')]) |
| @send('get') |
| def zone_get_details(zone_id, **kwargs): |
| url = '/zones/{}'.format(zone_id) |
| return url, None |
| |
| |
| @get_by_name_or_uuid_multiple([('zone', 'zone_id')]) |
| @send('get') |
| def zone_get_name_servers(zone_id, **kwargs): |
| url = '/zones/{}/nameservers'.format(zone_id) |
| return url, None |
| |
| |
| @get_by_name_or_uuid_multiple([('zone', 'zone_id')]) |
| @send('patch') |
| def zone_update(zone_id, **kwargs): |
| url = '/zones/{}'.format(zone_id) |
| return url, kwargs |
| |
| |
| @get_by_name_or_uuid_multiple([('zone', 'zone_id')]) |
| @send('delete') |
| def zone_delete(zone_id, **kwargs): |
| url = '/zones/{}'.format(zone_id) |
| return url, None |