blob: 11fe49943d9d642497d006511ab4b62b56e0728d [file] [log] [blame]
Oleksiy Petrenko2652ac12018-04-16 17:40:13 +03001try:
2 from urllib.parse import urlencode
3except ImportError:
4 from urllib import urlencode
5from glancev2.common import send
6
7
8@send('post')
9def task_create(task_type, task_input, **kwargs):
10 url = '/v2/tasks'
11 json = {
12 'type': task_type,
13 'input': task_input
14 }
15 return url, {'json': json}
16
17
18@send('get')
19def task_list(**kwargs):
20 url = '/v2/tasks?{}'.format(urlencode(kwargs))
21 return url, {}
22
23
24@send('get')
25def task_show(task_id, **kwargs):
26 url = '/v2/tasks/{}'.format(task_id)
27 return url, {}