blob: d23992239051c7ec7d19c6b7c7834edfc2b68a11 [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 +03003try:
4 from urllib.parse import urlencode
5except ImportError:
6 from urllib import urlencode
7
8
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +03009@get_by_name_or_uuid_multiple([('user', 'user_id')])
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030010@send('get')
11def user_get_details(user_id, **kwargs):
12 url = '/users/{}?{}'.format(user_id, urlencode(kwargs))
13 return url, None
14
15
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030016@get_by_name_or_uuid_multiple([('user', 'user_id')])
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030017@send('patch')
18def user_update(user_id, **kwargs):
19 url = '/users/{}'.format(user_id)
20 json = {
21 'user': kwargs,
22 }
23 return url, json
24
25
Oleksiy Petrenkoe03e2c72018-08-10 13:24:32 +030026@get_by_name_or_uuid_multiple([('user', 'user_id')])
Vasyl Saienko4eda4f22018-04-26 19:30:39 +030027@send('delete')
28def user_delete(user_id, **kwargs):
29 url = '/users/{}'.format(user_id)
30 return url, None
31
32
33@send('post')
34def user_create(**kwargs):
35 url = '/users'
36 json = {
37 'user': kwargs,
38 }
39 return url, json