blob: 4230ad394794e3ae424769b4d40bbf6c03f3a0db [file] [log] [blame]
Vasyl Saienko4eda4f22018-04-26 19:30:39 +03001from keystonev3.common import send
2
3try:
4 from urllib.parse import urlencode
5except ImportError:
6 from urllib import urlencode
7
8
9@send('get')
10def endpoint_get_details(endpoint_id, **kwargs):
11 url = '/endpoints/{}?{}'.format(endpoint_id, urlencode(kwargs))
12 return url, None
13
14
15@send('patch')
16def endpoint_update(endpoint_id, **kwargs):
17 url = '/endpoints/{}'.format(endpoint_id)
18 json = {
19 'endpoint': kwargs,
20 }
21 return url, json
22
23
24@send('delete')
25def endpoint_delete(endpoint_id, **kwargs):
26 url = '/endpoints/{}'.format(endpoint_id)
27 return url, None
28
29
30@send('get')
31def endpoint_list(**kwargs):
32 url = '/endpoints?{}'.format(urlencode(kwargs))
33 return url, None
34
35
36@send('post')
37def endpoint_create(**kwargs):
38 url = '/endpoints'
39 json = {
40 'endpoint': kwargs,
41 }
42 return url, json