blob: b5d78a23621552216b5bf8f9f9ae0099139517d6 [file] [log] [blame]
Mykyta Karpinfa53b302018-06-13 14:52:16 +03001try:
2 from urllib.parse import urlencode
3except ImportError:
4 from urllib import urlencode
5import hashlib
6
7from gnocchiv1.common import send, get_raw_client
8
9@send('get')
10def archive_policy_list(**kwargs):
11 url = '/archive_policy?{}'.format(urlencode(kwargs))
12 return url, {}
13
14
15@send('post')
16def archive_policy_create(**kwargs):
17 url = '/archive_policy'
18 return url, {'json': kwargs}
19
20@send('get')
21def archive_policy_read(policy_name, **kwargs):
22 url = '/archive_policy/{}'.format(policy_name)
23 return url, {}
24
25
26@send('patch')
27def archive_policy_update(policy_name, **kwargs):
28 url = '/archive_policy/{}'.format(policy_name)
29 return url, {'json': kwargs}
30
31
32@send('delete')
33def archive_policy_delete(policy_name, **kwargs):
34 url = '/archive_policy/{}'.format(policy_name)
35 return url, {}
36
37@send('get')
38def archive_policy_rule_list(**kwargs):
39 url = '/archive_policy_rule?{}'.format(urlencode(kwargs))
40 return url, {}
41
42@send('post')
43def archive_policy_rule_create(**kwargs):
44 url = '/archive_policy_rule'
45 return url, {'json': kwargs}
46
47@send('get')
48def archive_policy_rule_read(rule_name, **kwargs):
49 url = '/archive_policy_rule/{}'.format(rule_name)
50 return url, {}
51
52@send('delete')
53def archive_policy_rule_delete(rule_name, **kwargs):
54 url = '/archive_policy_rule/{}'.format(rule_name)
55 return url, {}