Debian Codegraph @

neutron_lib/api/definitions/qos_pps_minimum_rule.py

raw
1 # Copyright (c) 2021 Ericsson Software Technology
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
14
15 from neutron_lib.api import converters
16 from neutron_lib.api.definitions import qos as qos_apidef
17 from neutron_lib import constants
18 from neutron_lib.db import constants as db_const
19 from neutron_lib.services.qos import constants as qos_constants
20
21
22 ALIAS = 'qos-pps-minimum'
23 IS_SHIM_EXTENSION = False
24 IS_STANDARD_ATTR_EXTENSION = False
25 RESOURCE_NAME = 'minimum_packet_rate_rule'
26 COLLECTION_NAME = RESOURCE_NAME + 's'
27 NAME = 'QoS minimum packet rate rule'
28 API_PREFIX = '/' + qos_apidef.ALIAS
29 DESCRIPTION = ("Allow to configure QoS minimum packet rate rule.")
30 UPDATED_TIMESTAMP = '2021-07-14T10:00:00-00:00'
31 RESOURCE_ATTRIBUTE_MAP = {}
32 SUB_RESOURCE_ATTRIBUTE_MAP = {
33 COLLECTION_NAME: {
34 'parent': qos_apidef._PARENT,
35 'parameters': {
36 **qos_apidef._QOS_RULE_COMMON_FIELDS,
37 qos_constants.MIN_KPPS: {
38 'allow_post': True,
39 'allow_put': True,
40 'convert_to': converters.convert_to_int,
41 'is_visible': True,
42 'is_filter': True,
43 'is_sort_key': True,
44 'validate': {
45 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE]}
46 },
47 qos_constants.DIRECTION: {
48 'allow_post': True,
49 'allow_put': True,
50 'is_visible': True,
51 'default': constants.EGRESS_DIRECTION,
52 'is_filter': True,
53 'is_sort_key': True,
54 'validate': {
55 'type:values': constants.VALID_DIRECTIONS_AND_ANY,
56 }
57 }
58 }
59 }
60 }
61
62 ACTION_MAP = {}
63 REQUIRED_EXTENSIONS = [qos_apidef.ALIAS]
64 OPTIONAL_EXTENSIONS = []
65 ACTION_STATUS = {}