# Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from oslo_policy import policy

from nova.policies import base


POLICY_ROOT = 'os_compute_api:os-assisted-volume-snapshots:%s'


assisted_volume_snapshots_policies = [
    policy.RuleDefault(
        name=POLICY_ROOT % 'create',
        check_str=base.RULE_ADMIN_API),
    policy.RuleDefault(
        name=POLICY_ROOT % 'delete',
        check_str=base.RULE_ADMIN_API),
    policy.RuleDefault(
        name=POLICY_ROOT % 'discoverable',
        check_str=base.RULE_ANY),
]


def list_rules():
    return assisted_volume_snapshots_policies

@@ -801,36 +801,42 @@
 ies = %5B%0A    
-policy.RuleD
+base.create_rule_d
 efault(%0A    
@@ -831,37 +831,32 @@
 efault(%0A        
-name=
 POLICY_ROOT %25 'c
@@ -867,34 +867,24 @@
 e',%0A        
-check_str=
 base.RULE_AD
@@ -890,35 +890,226 @@
 DMIN_API
-)
 ,%0A    
-policy.RuleD
+    %22Create an assisted volume snapshot%22,%0A        %5B%0A            %7B%0A                'path': '/os-assisted-volume-snapshots',%0A                'method': 'POST'%0A            %7D%0A        %5D),%0A    base.create_rule_d
 efault(%0A
@@ -1108,37 +1108,32 @@
 efault(%0A        
-name=
 POLICY_ROOT %25 'd
@@ -1144,34 +1144,24 @@
 e',%0A        
-check_str=
 base.RULE_AD
@@ -1167,16 +1167,217 @@
 DMIN_API
+,%0A        %22Delete an assisted volume snapshot%22,%0A        %5B%0A            %7B%0A                'path': '/os-assisted-volume-snapshots/%7Bsnapshot_id%7D',%0A                'method': 'DELETE'%0A            %7D%0A        %5D
 ),%0A    p

Add description to policies in assisted_volume_snapshots.py