Merge "Add snapshot_metadata operations to policy.json"
This commit is contained in:
commit
8182058fd6
@ -27,6 +27,9 @@
|
||||
"volume:get_snapshot": "",
|
||||
"volume:get_all_snapshots": "",
|
||||
"volume:update_snapshot": "",
|
||||
"volume:get_snapshot_metadata": "",
|
||||
"volume:delete_snapshot_metadata": "",
|
||||
"volume:update_snapshot_metadata": "",
|
||||
"volume:extend": "",
|
||||
"volume:migrate_volume": "rule:admin_api",
|
||||
"volume:migrate_volume_completion": "rule:admin_api",
|
||||
|
@ -1057,6 +1057,7 @@ class API(base.Base):
|
||||
resource=volume)
|
||||
return db_meta
|
||||
|
||||
@wrap_check_policy
|
||||
def get_snapshot_metadata(self, context, snapshot):
|
||||
"""Get all metadata associated with a snapshot."""
|
||||
snapshot_obj = self.get_snapshot(context, snapshot.id)
|
||||
@ -1064,6 +1065,7 @@ class API(base.Base):
|
||||
resource=snapshot)
|
||||
return snapshot_obj.metadata
|
||||
|
||||
@wrap_check_policy
|
||||
def delete_snapshot_metadata(self, context, snapshot, key):
|
||||
"""Delete the given metadata item from a snapshot."""
|
||||
snapshot_obj = self.get_snapshot(context, snapshot.id)
|
||||
@ -1071,6 +1073,7 @@ class API(base.Base):
|
||||
LOG.info(_LI("Delete snapshot metadata completed successfully."),
|
||||
resource=snapshot)
|
||||
|
||||
@wrap_check_policy
|
||||
def update_snapshot_metadata(self, context,
|
||||
snapshot, metadata,
|
||||
delete=False):
|
||||
|
@ -19,6 +19,9 @@
|
||||
"volume:create_snapshot": "rule:admin_or_owner",
|
||||
"volume:delete_snapshot": "rule:admin_or_owner",
|
||||
"volume:update_snapshot": "rule:admin_or_owner",
|
||||
"volume:get_snapshot_metadata": "rule:admin_or_owner",
|
||||
"volume:delete_snapshot_metadata": "rule:admin_or_owner",
|
||||
"volume:update_snapshot_metadata": "rule:admin_or_owner",
|
||||
"volume:extend": "rule:admin_or_owner",
|
||||
"volume:update_readonly_flag": "rule:admin_or_owner",
|
||||
"volume:retype": "rule:admin_or_owner",
|
||||
|
Loading…
Reference in New Issue
Block a user