blob: 8c8233da0a0706c9c75b297da0e49fc3658f5967 [file] [log] [blame]
Oleksiy Petrenko777d7822018-11-06 13:32:44 +02001from designatev2.common import send
2from designatev2.arg_converter import get_by_name_or_uuid_multiple
3
4
5@send('post')
6def zone_create(name, email, **kwargs):
7 url = '/zones'
8 json = {
9 'name': name,
10 'email': email,
11 }
12 json.update(kwargs)
13 return url, json
14
15
16@get_by_name_or_uuid_multiple([('zone', 'zone_id')])
17@send('get')
18def zone_get_details(zone_id, **kwargs):
19 url = '/zones/{}'.format(zone_id)
20 return url, None
21
22
23@get_by_name_or_uuid_multiple([('zone', 'zone_id')])
24@send('get')
25def zone_get_name_servers(zone_id, **kwargs):
26 url = '/zones/{}/nameservers'.format(zone_id)
27 return url, None
28
29
30@get_by_name_or_uuid_multiple([('zone', 'zone_id')])
31@send('patch')
32def zone_update(zone_id, **kwargs):
33 url = '/zones/{}'.format(zone_id)
34 return url, kwargs
35
36
37@get_by_name_or_uuid_multiple([('zone', 'zone_id')])
38@send('delete')
39def zone_delete(zone_id, **kwargs):
40 url = '/zones/{}'.format(zone_id)
41 return url, None