"Fossies" - the Fresh Open Source Software Archive

Member "zaqar-9.0.0/zaqar/common/policies/subscription.py" (16 Oct 2019, 2837 Bytes) of package /linux/misc/openstack/zaqar-9.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "subscription.py" see the Fossies "Dox" file reference documentation.

    1 # Licensed under the Apache License, Version 2.0 (the "License"); you may
    2 # not use this file except in compliance with the License. You may obtain
    3 # a copy of the License at
    4 #
    5 #      http://www.apache.org/licenses/LICENSE-2.0
    6 #
    7 # Unless required by applicable law or agreed to in writing, software
    8 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    9 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   10 # License for the specific language governing permissions and limitations
   11 # under the License.
   12 
   13 from oslo_policy import policy
   14 
   15 from zaqar.common.policies import base
   16 
   17 SUBSCRIPTIONS = 'subscription:%s'
   18 
   19 
   20 rules = [
   21     policy.DocumentedRuleDefault(
   22         name=SUBSCRIPTIONS % 'get_all',
   23         check_str=base.UNPROTECTED,
   24         description='Lists a queue subscriptions.',
   25         operations=[
   26             {
   27                 'path': '/v2/queues/{queue_name}/subscriptions',
   28                 'method': 'GET'
   29             }
   30         ]
   31     ),
   32     policy.DocumentedRuleDefault(
   33         name=SUBSCRIPTIONS % 'create',
   34         check_str=base.UNPROTECTED,
   35         description='Creates a subscription.',
   36         operations=[
   37             {
   38                 'path': '/v2/queues/{queue_name}/subscriptions',
   39                 'method': 'POST'
   40             }
   41         ]
   42     ),
   43     policy.DocumentedRuleDefault(
   44         name=SUBSCRIPTIONS % 'get',
   45         check_str=base.UNPROTECTED,
   46         description='Shows details for a subscription.',
   47         operations=[
   48             {
   49                 'path': '/v2/queues/{queue_name}/subscriptions'
   50                         '/{subscription_id}',
   51                 'method': 'GET'
   52             }
   53         ]
   54     ),
   55     policy.DocumentedRuleDefault(
   56         name=SUBSCRIPTIONS % 'delete',
   57         check_str=base.UNPROTECTED,
   58         description='Deletes the specified subscription.',
   59         operations=[
   60             {
   61                 'path': '/v2/queues/{queue_name}/subscriptions'
   62                         '/{subscription_id}',
   63                 'method': 'DELETE'
   64             }
   65         ]
   66     ),
   67     policy.DocumentedRuleDefault(
   68         name=SUBSCRIPTIONS % 'update',
   69         check_str=base.UNPROTECTED,
   70         description='Updates a subscription.',
   71         operations=[
   72             {
   73                 'path': '/v2/queues/{queue_name}/subscriptions'
   74                         '/{subscription_id}',
   75                 'method': 'PATCH'
   76             }
   77         ]
   78     ),
   79     policy.DocumentedRuleDefault(
   80         name=SUBSCRIPTIONS % 'confirm',
   81         check_str=base.UNPROTECTED,
   82         description='Confirms a subscription.',
   83         operations=[
   84             {
   85                 'path': '/v2/queues/{queue_name}/subscriptions'
   86                         '/{subscription_id}/confirm',
   87                 'method': 'PUT'
   88             }
   89         ]
   90     )
   91 ]
   92 
   93 
   94 def list_rules():
   95     return rules