blob: 546e3a069430983b43201bfb26e01f15208d9cbb [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
Vasyl Saienko4eda4f22018-04-26 19:30:39 +03003
4try:
5 from urllib.parse import urlencode
6except ImportError:
7 from urllib import urlencode
8
9
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030010@get_by_name_or_uuid_multiple([('service', 'service_id')])
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030011@send('get')
12def service_get_details(service_id, **kwargs):
13 url = '/services/{}?{}'.format(service_id, urlencode(kwargs))
14 return url, None
15
16
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030017@get_by_name_or_uuid_multiple([('service', 'service_id')])
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030018@send('patch')
19def service_update(service_id, **kwargs):
20 url = '/services/{}'.format(service_id)
21 json = {
22 'service': kwargs,
23 }
24 return url, json
25
26
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030027@get_by_name_or_uuid_multiple([('service', 'service_id')])
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030028@send('delete')
29def service_delete(service_id, **kwargs):
30 url = '/services/{}'.format(service_id)
31 return url, None
32
33
34@send('post')
35def service_create(**kwargs):
36 url = '/services'
37 json = {
38 'service': kwargs,
39 }
40 return url, json