blob: 8f3c0245374b520048448d38332701914c1b1ef5 [file] [log] [blame]
Oleksiy Petrenko95664c02018-04-19 17:05:16 +03001from barbicanv1.common import send, get_by_name_or_uuid
2from barbicanv1.secrets import secret_list, RESOURCE_LIST_KEY
3
4
5@get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY)
6@send('get')
7def secret_acl_get(secret_uuid, **kwargs):
8 url = '/v1/secrets/{}/acl'.format(secret_uuid)
9 return url, {}
10
11
12@get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY)
13@send('put')
14def secret_acl_put(secret_uuid, **kwargs):
15 url = '/v1/secrets/{}/acl'.format(secret_uuid)
16 json = {
17 'read': kwargs,
18 }
19 return url, {'json': json}
20
21
22@get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY)
23@send('patch')
24def secret_acl_patch(secret_uuid, **kwargs):
25 url = 'v1/secrets/{}/acl'.format(secret_uuid)
26 json = {
27 'read': kwargs,
28 }
29 return url, {'json': json}
30
31
32@get_by_name_or_uuid(secret_list, RESOURCE_LIST_KEY)
33@send('delete')
34def secret_acl_delete(secret_uuid, **kwargs):
35 url = 'v1/secrets/{}/acl'.format(secret_uuid)
36 return url, {}