Debian Codegraph @

neutron_lib/exceptions/qos.py

raw
1 # Copyright 2011 VMware, Inc
2 # All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
14 # under the License.
15
16 from neutron_lib._i18n import _
17 from neutron_lib import exceptions as e
18
19
20 class QosPolicyNotFound(e.NotFound):
21 message = _("QoS policy %(policy_id)s could not be found.")
22
23
24 class QosRuleNotFound(e.NotFound):
25 message = _("QoS rule %(rule_id)s for policy %(policy_id)s "
26 "could not be found.")
27
28
29 class QoSPolicyDefaultAlreadyExists(e.Conflict):
30 message = _("A default QoS policy exists for project %(project_id)s.")
31
32
33 class PortQosBindingNotFound(e.NotFound):
34 message = _("QoS binding for port %(port_id)s and policy %(policy_id)s "
35 "could not be found.")
36
37
38 class PortQosBindingError(e.NeutronException):
39 message = _("QoS binding for port %(port_id)s and policy %(policy_id)s "
40 "could not be created: %(db_error)s.")
41
42
43 class NetworkQosBindingNotFound(e.NotFound):
44 message = _("QoS binding for network %(net_id)s and policy %(policy_id)s "
45 "could not be found.")
46
47
48 class FloatingIPQosBindingNotFound(e.NotFound):
49 message = _("QoS binding for floating IP %(fip_id)s and policy "
50 "%(policy_id)s could not be found.")
51
52
53 class QosPolicyInUse(e.InUse):
54 message = _("QoS Policy %(policy_id)s is used by "
55 "%(object_type)s %(object_id)s.")
56
57
58 class FloatingIPQosBindingError(e.NeutronException):
59 message = _("QoS binding for floating IP %(fip_id)s and policy "
60 "%(policy_id)s could not be created: %(db_error)s.")
61
62
63 class NetworkQosBindingError(e.NeutronException):
64 message = _("QoS binding for network %(net_id)s and policy %(policy_id)s "
65 "could not be created: %(db_error)s.")
66
67
68 class QosRuleNotSupported(e.Conflict):
69 message = _("Rule %(rule_type)s is not supported by port %(port_id)s")
70
71
72 class QosRuleNotSupportedByNetwork(e.Conflict):
73 message = _("Rule %(rule_type)s is not supported "
74 "by network %(network_id)s")
75
76
77 class QoSRuleParameterConflict(e.Conflict):
78 message = _("Unable to add the rule with value %(rule_value)s to the "
79 "policy %(policy_id)s as the existing rule of type "
80 "%(existing_rule)s has value %(existing_value)s.")
81
82
83 class QoSRulesConflict(e.Conflict):
84 message = _("Rule %(new_rule_type)s conflicts with "
85 "rule %(rule_id)s which already exists in "
86 "QoS Policy %(policy_id)s.")
87
88
89 class PolicyRemoveAuthorizationError(e.NotAuthorized):
90 message = _("Failed to remove provided policy %(policy_id)s "
91 "because you are not authorized.")
92
93
94 class TcLibQdiscTypeError(e.NeutronException):
95 message = _("TC Qdisc type %(qdisc_type)s is not supported; supported "
96 "types: %(supported_qdisc_types)s.")
97
98
99 class TcLibQdiscNeededArguments(e.NeutronException):
100 message = _("TC Qdisc type %(qdisc_type)s needs following arguments: "
101 "%(needed_arguments)s.")
102
103
104 class RouterQosBindingNotFound(e.NotFound):
105 message = _("QoS binding for router %(router_id)s gateway and policy "
106 "%(policy_id)s could not be found.")
107
108
109 class RouterQosBindingError(e.NeutronException):
110 message = _("QoS binding for router %(router_id)s gateway and policy "
111 "%(policy_id)s could not be created: %(db_error)s.")
112
113
114 class QosPlacementAllocationConflict(e.Conflict):
115 message = _("Allocation for consumer %(consumer)s is not possible on "
116 "resource provider %(rp)s, the requested amount of bandwidth "
117 "would exceed the capacity available.")
118
119
120 class QosPlacementAllocationUpdateConflict(e.Conflict):
121 message = _("Updating placement allocation with %(alloc_diff)s for "
122 "consumer %(consumer)s failed. The requested resources would "
123 "exceed the capacity available.")