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