blob: d594f05092c77ede4650acd4d0c1e3d7c49f8030 [file] [log] [blame]
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +03001from keystonev3.common import send
2from keystonev3.arg_converter import get_by_name_or_uuid_multiple
3
4
5@send('post')
6def domain_create(name, **kwargs):
7 url = '/domains'
8 json = {
9 'domain': kwargs,
10 }
11 json['domain']['name'] = name
12 return url, json
13
14
15@get_by_name_or_uuid_multiple([('domain', 'domain_id')])
16@send('get')
17def domain_get_details(domain_id, **kwargs):
18 url = '/domains/{}'.format(domain_id)
19 return url, None
20
21
22@get_by_name_or_uuid_multiple([('domain', 'domain_id')])
23@send('patch')
24def domain_update(domain_id, **kwargs):
25 url = '/domains/{}'.format(domain_id)
26 json = {
27 'domain': kwargs,
28 }
29 return url, json
30
31
32@get_by_name_or_uuid_multiple([('domain', 'domain_id')])
33@send('delete')
34def domain_delete(domain_id, **kwargs):
35 url = '/domains/{}'.format(domain_id)
36 return url, None