python-neutronclient 11.7.0__py3-none-any.whl → 12.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. neutronclient/osc/v2/fwaas/constants.py +3 -0
  2. {python_neutronclient-11.7.0.dist-info → python_neutronclient-12.0.0.dist-info}/METADATA +1 -1
  3. {python_neutronclient-11.7.0.dist-info → python_neutronclient-12.0.0.dist-info}/RECORD +9 -30
  4. {python_neutronclient-11.7.0.dist-info → python_neutronclient-12.0.0.dist-info}/WHEEL +1 -1
  5. {python_neutronclient-11.7.0.dist-info → python_neutronclient-12.0.0.dist-info}/entry_points.txt +0 -42
  6. {python_neutronclient-11.7.0.dist-info → python_neutronclient-12.0.0.dist-info}/licenses/AUTHORS +1 -0
  7. python_neutronclient-12.0.0.dist-info/pbr.json +1 -0
  8. neutronclient/osc/v2/fwaas/firewallgroup.py +0 -385
  9. neutronclient/osc/v2/fwaas/firewallpolicy.py +0 -425
  10. neutronclient/osc/v2/fwaas/firewallrule.py +0 -467
  11. neutronclient/osc/v2/networking_bgpvpn/__init__.py +0 -0
  12. neutronclient/osc/v2/networking_bgpvpn/bgpvpn.py +0 -406
  13. neutronclient/osc/v2/networking_bgpvpn/constants.py +0 -30
  14. neutronclient/osc/v2/networking_bgpvpn/network_association.py +0 -63
  15. neutronclient/osc/v2/networking_bgpvpn/port_association.py +0 -314
  16. neutronclient/osc/v2/networking_bgpvpn/resource_association.py +0 -283
  17. neutronclient/osc/v2/networking_bgpvpn/router_association.py +0 -113
  18. neutronclient/tests/unit/osc/v2/fwaas/__init__.py +0 -0
  19. neutronclient/tests/unit/osc/v2/fwaas/common.py +0 -304
  20. neutronclient/tests/unit/osc/v2/fwaas/fakes.py +0 -151
  21. neutronclient/tests/unit/osc/v2/fwaas/test_firewallgroup.py +0 -730
  22. neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py +0 -673
  23. neutronclient/tests/unit/osc/v2/fwaas/test_firewallrule.py +0 -904
  24. neutronclient/tests/unit/osc/v2/networking_bgpvpn/__init__.py +0 -0
  25. neutronclient/tests/unit/osc/v2/networking_bgpvpn/fakes.py +0 -270
  26. neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_bgpvpn.py +0 -524
  27. neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_resource_association.py +0 -320
  28. neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_router_association.py +0 -292
  29. python_neutronclient-11.7.0.dist-info/pbr.json +0 -1
  30. {python_neutronclient-11.7.0.dist-info → python_neutronclient-12.0.0.dist-info}/licenses/LICENSE +0 -0
  31. {python_neutronclient-11.7.0.dist-info → python_neutronclient-12.0.0.dist-info}/top_level.txt +0 -0
@@ -14,6 +14,9 @@
14
14
  # under the License.
15
15
  #
16
16
 
17
+ # TODO(slaweq): remove it once "logging" OSC plugin will be moved to the
18
+ # python-openstackclient repo
19
+
17
20
  FWG = 'firewall_group'
18
21
  FWGS = 'firewall_groups'
19
22
  FWP = 'firewall_policy'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-neutronclient
3
- Version: 11.7.0
3
+ Version: 12.0.0
4
4
  Summary: CLI and Client Library for OpenStack Networking
5
5
  Home-page: https://docs.openstack.org/python-neutronclient/latest/
6
6
  Author: OpenStack Networking Project
@@ -84,20 +84,10 @@ neutronclient/osc/v2/dynamic_routing/bgp_peer.py,sha256=DzasNmIfUjd-FZE-vH18hwFX
84
84
  neutronclient/osc/v2/dynamic_routing/bgp_speaker.py,sha256=Mw-xVRzf-DsIHh1E6Vtl25WrzRA-vAQjqCZ8kjR7EX0,11376
85
85
  neutronclient/osc/v2/dynamic_routing/constants.py,sha256=KFLE_7d9CTHZxuUIQy_9lGWNf7EGaqTnX6J-i7_CwaI,716
86
86
  neutronclient/osc/v2/fwaas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
- neutronclient/osc/v2/fwaas/constants.py,sha256=BQAsJy3uJf29QOajizWu1ZTaCLGvyNlPqCJw6ouQz5U,857
88
- neutronclient/osc/v2/fwaas/firewallgroup.py,sha256=M9l3ZxB8hq9BT8CfuFdwI8tjz7vfncqEhYoZIqorZfA,14801
89
- neutronclient/osc/v2/fwaas/firewallpolicy.py,sha256=ii0QPnfioZxvniO6LfcNQCXcUY-ujh7CtFz76jsmx7k,16063
90
- neutronclient/osc/v2/fwaas/firewallrule.py,sha256=tugL_5wUHBoA0RH8FNQw5NlJQuWihj4q-2xoYaG8HHU,18334
87
+ neutronclient/osc/v2/fwaas/constants.py,sha256=dI-FnDq-0c-jaZ3YcGe9o19QYa0XpBpELIlJi_tLuvw,961
91
88
  neutronclient/osc/v2/lbaas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
92
89
  neutronclient/osc/v2/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
93
90
  neutronclient/osc/v2/logging/network_log.py,sha256=T8Kze_yCDfIFtVX_OoDtVJ_kw4AYfSgF7kk1ToKrzHM,11550
94
- neutronclient/osc/v2/networking_bgpvpn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
95
- neutronclient/osc/v2/networking_bgpvpn/bgpvpn.py,sha256=wbAh4c7aUuR-8mdLo-JLv5NmRNBPLaZvgGSAMlSOzUM,15641
96
- neutronclient/osc/v2/networking_bgpvpn/constants.py,sha256=ySsJSFeBUhnxnBiyy0WmcwNtGqGkNNUiZsMPxArp6S4,1046
97
- neutronclient/osc/v2/networking_bgpvpn/network_association.py,sha256=TN8WbcZu7mJRuyRFKpYc1-221v7okr2ata90-9EtjTE,2230
98
- neutronclient/osc/v2/networking_bgpvpn/port_association.py,sha256=iAyqriCy3sZ12IRrm1Jt2wahFf-MDHzo39tQ2oIGljU,12105
99
- neutronclient/osc/v2/networking_bgpvpn/resource_association.py,sha256=O98Io-YilE9EiSiQhz28fScYk6emzJ6ndWHwJnLNhXU,11329
100
- neutronclient/osc/v2/networking_bgpvpn/router_association.py,sha256=CEzyZXHf5I0ZBLJOL6wOJJim_ZS6IV8QesVKzfTpz9E,4321
101
91
  neutronclient/osc/v2/sfc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
92
  neutronclient/osc/v2/sfc/sfc_flow_classifier.py,sha256=IH0zXHRBifresv2ApEeFFWi0GYPiY5cmsKK_yDjcOoc,13897
103
93
  neutronclient/osc/v2/sfc/sfc_port_chain.py,sha256=7WZVtI6kd1DEQ2Gjzrpa-Qtxffagl7oD2Oo0YdbIyhM,15166
@@ -129,21 +119,10 @@ neutronclient/tests/unit/osc/v2/dynamic_routing/fakes.py,sha256=q1tXGsQCp7o9PtJY
129
119
  neutronclient/tests/unit/osc/v2/dynamic_routing/test_bgp_dragent.py,sha256=wpjF6JA6D9Dog1wWLldlLH9VkNVNZOG4MFQALQgA0K4,3295
130
120
  neutronclient/tests/unit/osc/v2/dynamic_routing/test_bgp_peer.py,sha256=AWFFr-5TGtFjLGjSY4lU7Oji6AbcKYh_w1wd-5AvYPg,4829
131
121
  neutronclient/tests/unit/osc/v2/dynamic_routing/test_bgp_speaker.py,sha256=GbvYqZATN5dLT1OQrlaAzSgLgT8DX3zIkm7ucrxKKeI,5214
132
- neutronclient/tests/unit/osc/v2/fwaas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
133
- neutronclient/tests/unit/osc/v2/fwaas/common.py,sha256=KLmbYhSltirKuXwO_MP-l1VhoMyxpcA365eHd0XnqNc,10449
134
- neutronclient/tests/unit/osc/v2/fwaas/fakes.py,sha256=s3Vo4XD4LUYUJeJGjOAJOfXdnLPzMafdYiMGPrhqLJg,5669
135
- neutronclient/tests/unit/osc/v2/fwaas/test_firewallgroup.py,sha256=SoUN52Z-jUGMhlFYvGfwNmY5AYJQXfZn_64vcsTR2Ko,25840
136
- neutronclient/tests/unit/osc/v2/fwaas/test_firewallpolicy.py,sha256=ElglQ1fakovOKKZC_2zPqmzI5k6bxU4rAtmpRYw3FbA,22107
137
- neutronclient/tests/unit/osc/v2/fwaas/test_firewallrule.py,sha256=b5p0V_nQoAvzH9YF50RHuLLIuoUoV_q1ccNolbVNFlM,30747
138
122
  neutronclient/tests/unit/osc/v2/lbaas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
139
123
  neutronclient/tests/unit/osc/v2/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
140
124
  neutronclient/tests/unit/osc/v2/logging/fakes.py,sha256=tNETN4UoB7JVkPF9F34Vs4Nq_BTCrEI8uvBaUElTO4o,2490
141
125
  neutronclient/tests/unit/osc/v2/logging/test_network_log.py,sha256=NBsY8z-z4XgiNLYwAoEBEOgq1Xt1YMy1mCClJ9q5FHM,26685
142
- neutronclient/tests/unit/osc/v2/networking_bgpvpn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
143
- neutronclient/tests/unit/osc/v2/networking_bgpvpn/fakes.py,sha256=Q-CwFwy3boemlbrDkJlT3zGHvyCxHtpbVWRngY93fL0,7995
144
- neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_bgpvpn.py,sha256=SnbK-Ox1K37plGqFQARSwvx6Dt3ow--wZxIyrY6_wvo,19794
145
- neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_resource_association.py,sha256=tSX3MYWzoSl44NLlaq037Z2WaqONdWYgfMd8dQJ3Kdw,12103
146
- neutronclient/tests/unit/osc/v2/networking_bgpvpn/test_router_association.py,sha256=oK7l0UmTmowM3APl6z1pT3wlZUz6gqjyvO13_9A0Ppo,11261
147
126
  neutronclient/tests/unit/osc/v2/sfc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
148
127
  neutronclient/tests/unit/osc/v2/sfc/fakes.py,sha256=PYTGFG5u7DPA4iwO5qORbbFgDS3dt0BVBaz1exdO_rY,10116
149
128
  neutronclient/tests/unit/osc/v2/sfc/test_flow_classifier.py,sha256=k5vkSbY3MpA9fq-5sQ3Dod9KmsSwsBnkfSWJGbKGjiU,14485
@@ -163,11 +142,11 @@ neutronclient/tests/unit/osc/v2/vpnaas/test_ipsecpolicy.py,sha256=XwOQvyj54yHd2x
163
142
  neutronclient/tests/unit/osc/v2/vpnaas/test_vpnservice.py,sha256=dXPhpvfrEA_uvvZ_nhtCWXzXFX7x3uxGu3p8XohH8Ko,9994
164
143
  neutronclient/v2_0/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
165
144
  neutronclient/v2_0/client.py,sha256=uYxHWtHXq2mWhM707UBu8De-q6ohlVp0-xklsH_s8rE,116835
166
- python_neutronclient-11.7.0.dist-info/licenses/AUTHORS,sha256=YIpd-sceR9dEYuB4qPZ97_oSscl1DzNFp4LPSScDhTo,13575
167
- python_neutronclient-11.7.0.dist-info/licenses/LICENSE,sha256=XfKg2H1sVi8OoRxoisUlMqoo10TKvHmU_wU39ks7MyA,10143
168
- python_neutronclient-11.7.0.dist-info/METADATA,sha256=L-bnH-PDMum7sw9XIslpcDd_5jJJ5xoAmeuiTSX-Y2c,3496
169
- python_neutronclient-11.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
170
- python_neutronclient-11.7.0.dist-info/entry_points.txt,sha256=T2BoNmwh9dH9-MTgUq7qFv7pnkz3ItZzaozRyn3kuVY,10728
171
- python_neutronclient-11.7.0.dist-info/pbr.json,sha256=yX-HYau6P2uKVtkfB5gmIiIMyrukSppVdHk3oX1K09w,46
172
- python_neutronclient-11.7.0.dist-info/top_level.txt,sha256=SxHuzHShRY_O8UAQAiwIMIjwHRm7Tr05U-cvrn1fLgU,14
173
- python_neutronclient-11.7.0.dist-info/RECORD,,
145
+ python_neutronclient-12.0.0.dist-info/licenses/AUTHORS,sha256=hUa35KbI6UW9BTxvh4kgQrm3uxle5ket9_kfETkZ5zU,13611
146
+ python_neutronclient-12.0.0.dist-info/licenses/LICENSE,sha256=XfKg2H1sVi8OoRxoisUlMqoo10TKvHmU_wU39ks7MyA,10143
147
+ python_neutronclient-12.0.0.dist-info/METADATA,sha256=dIClGrjNX5ZCcan1baW7sCNsvdW2NiLzEE0mFMub8eM,3496
148
+ python_neutronclient-12.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
149
+ python_neutronclient-12.0.0.dist-info/entry_points.txt,sha256=f1N0Ez4Zajmw7yQ1KGyY7_Wjk0HqQgbokUxsAsH-ZAI,6745
150
+ python_neutronclient-12.0.0.dist-info/pbr.json,sha256=ThbeTag8WoZXJ65GoTSiXCEbfUJ_qo1mrLrmewp5rW0,46
151
+ python_neutronclient-12.0.0.dist-info/top_level.txt,sha256=SxHuzHShRY_O8UAQAiwIMIjwHRm7Tr05U-cvrn1fLgU,14
152
+ python_neutronclient-12.0.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (82.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -20,48 +20,6 @@ bgp_speaker_remove_network = neutronclient.osc.v2.dynamic_routing.bgp_speaker:Re
20
20
  bgp_speaker_remove_peer = neutronclient.osc.v2.dynamic_routing.bgp_speaker:RemovePeerFromSpeaker
21
21
  bgp_speaker_set = neutronclient.osc.v2.dynamic_routing.bgp_speaker:SetBgpSpeaker
22
22
  bgp_speaker_show = neutronclient.osc.v2.dynamic_routing.bgp_speaker:ShowBgpSpeaker
23
- bgpvpn_create = neutronclient.osc.v2.networking_bgpvpn.bgpvpn:CreateBgpvpn
24
- bgpvpn_delete = neutronclient.osc.v2.networking_bgpvpn.bgpvpn:DeleteBgpvpn
25
- bgpvpn_list = neutronclient.osc.v2.networking_bgpvpn.bgpvpn:ListBgpvpn
26
- bgpvpn_network_association_create = neutronclient.osc.v2.networking_bgpvpn.network_association:CreateBgpvpnNetAssoc
27
- bgpvpn_network_association_delete = neutronclient.osc.v2.networking_bgpvpn.network_association:DeleteBgpvpnNetAssoc
28
- bgpvpn_network_association_list = neutronclient.osc.v2.networking_bgpvpn.network_association:ListBgpvpnNetAssoc
29
- bgpvpn_network_association_show = neutronclient.osc.v2.networking_bgpvpn.network_association:ShowBgpvpnNetAssoc
30
- bgpvpn_port_association_create = neutronclient.osc.v2.networking_bgpvpn.port_association:CreateBgpvpnPortAssoc
31
- bgpvpn_port_association_delete = neutronclient.osc.v2.networking_bgpvpn.port_association:DeleteBgpvpnPortAssoc
32
- bgpvpn_port_association_list = neutronclient.osc.v2.networking_bgpvpn.port_association:ListBgpvpnPortAssoc
33
- bgpvpn_port_association_set = neutronclient.osc.v2.networking_bgpvpn.port_association:SetBgpvpnPortAssoc
34
- bgpvpn_port_association_show = neutronclient.osc.v2.networking_bgpvpn.port_association:ShowBgpvpnPortAssoc
35
- bgpvpn_port_association_unset = neutronclient.osc.v2.networking_bgpvpn.port_association:UnsetBgpvpnPortAssoc
36
- bgpvpn_router_association_create = neutronclient.osc.v2.networking_bgpvpn.router_association:CreateBgpvpnRouterAssoc
37
- bgpvpn_router_association_delete = neutronclient.osc.v2.networking_bgpvpn.router_association:DeleteBgpvpnRouterAssoc
38
- bgpvpn_router_association_list = neutronclient.osc.v2.networking_bgpvpn.router_association:ListBgpvpnRouterAssoc
39
- bgpvpn_router_association_set = neutronclient.osc.v2.networking_bgpvpn.router_association:SetBgpvpnRouterAssoc
40
- bgpvpn_router_association_show = neutronclient.osc.v2.networking_bgpvpn.router_association:ShowBgpvpnRouterAssoc
41
- bgpvpn_router_association_unset = neutronclient.osc.v2.networking_bgpvpn.router_association:UnsetBgpvpnRouterAssoc
42
- bgpvpn_set = neutronclient.osc.v2.networking_bgpvpn.bgpvpn:SetBgpvpn
43
- bgpvpn_show = neutronclient.osc.v2.networking_bgpvpn.bgpvpn:ShowBgpvpn
44
- bgpvpn_unset = neutronclient.osc.v2.networking_bgpvpn.bgpvpn:UnsetBgpvpn
45
- firewall_group_create = neutronclient.osc.v2.fwaas.firewallgroup:CreateFirewallGroup
46
- firewall_group_delete = neutronclient.osc.v2.fwaas.firewallgroup:DeleteFirewallGroup
47
- firewall_group_list = neutronclient.osc.v2.fwaas.firewallgroup:ListFirewallGroup
48
- firewall_group_policy_add_rule = neutronclient.osc.v2.fwaas.firewallpolicy:FirewallPolicyInsertRule
49
- firewall_group_policy_create = neutronclient.osc.v2.fwaas.firewallpolicy:CreateFirewallPolicy
50
- firewall_group_policy_delete = neutronclient.osc.v2.fwaas.firewallpolicy:DeleteFirewallPolicy
51
- firewall_group_policy_list = neutronclient.osc.v2.fwaas.firewallpolicy:ListFirewallPolicy
52
- firewall_group_policy_remove_rule = neutronclient.osc.v2.fwaas.firewallpolicy:FirewallPolicyRemoveRule
53
- firewall_group_policy_set = neutronclient.osc.v2.fwaas.firewallpolicy:SetFirewallPolicy
54
- firewall_group_policy_show = neutronclient.osc.v2.fwaas.firewallpolicy:ShowFirewallPolicy
55
- firewall_group_policy_unset = neutronclient.osc.v2.fwaas.firewallpolicy:UnsetFirewallPolicy
56
- firewall_group_rule_create = neutronclient.osc.v2.fwaas.firewallrule:CreateFirewallRule
57
- firewall_group_rule_delete = neutronclient.osc.v2.fwaas.firewallrule:DeleteFirewallRule
58
- firewall_group_rule_list = neutronclient.osc.v2.fwaas.firewallrule:ListFirewallRule
59
- firewall_group_rule_set = neutronclient.osc.v2.fwaas.firewallrule:SetFirewallRule
60
- firewall_group_rule_show = neutronclient.osc.v2.fwaas.firewallrule:ShowFirewallRule
61
- firewall_group_rule_unset = neutronclient.osc.v2.fwaas.firewallrule:UnsetFirewallRule
62
- firewall_group_set = neutronclient.osc.v2.fwaas.firewallgroup:SetFirewallGroup
63
- firewall_group_show = neutronclient.osc.v2.fwaas.firewallgroup:ShowFirewallGroup
64
- firewall_group_unset = neutronclient.osc.v2.fwaas.firewallgroup:UnsetFirewallGroup
65
23
  network_log_create = neutronclient.osc.v2.logging.network_log:CreateNetworkLog
66
24
  network_log_delete = neutronclient.osc.v2.logging.network_log:DeleteNetworkLog
67
25
  network_log_list = neutronclient.osc.v2.logging.network_log:ListNetworkLog
@@ -308,6 +308,7 @@ jichenjc <jichenjc@cn.ibm.com>
308
308
  kangyufei <kangyf@inspur.com>
309
309
  karthik s <ksundara@redhat.com>
310
310
  kavithahr <kavitha.r@nectechnologies.in>
311
+ lajoskatona <lajos.katona@est.tech>
311
312
  likui <likui@yovole.com>
312
313
  lilintan <lintan.li@easystack.cn>
313
314
  linwwu <wlwwu@cn.ibm.com>
@@ -0,0 +1 @@
1
+ {"git_version": "9d338dc", "is_release": true}
@@ -1,385 +0,0 @@
1
- # Copyright 2016-2017 FUJITSU LIMITED
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
- import logging
17
-
18
- from osc_lib.command import command
19
- from osc_lib import exceptions
20
- from osc_lib import utils
21
- from osc_lib.utils import columns as column_util
22
-
23
- from neutronclient._i18n import _
24
- from neutronclient.osc import utils as osc_utils
25
- from neutronclient.osc.v2.fwaas import constants as const
26
- from neutronclient.osc.v2 import utils as v2_utils
27
-
28
-
29
- LOG = logging.getLogger(__name__)
30
-
31
- _formatters = {
32
- 'admin_state_up': v2_utils.AdminStateColumn,
33
- }
34
-
35
- _attr_map_dict = {
36
- 'id': 'ID',
37
- 'name': 'Name',
38
- 'ingress_firewall_policy_id': 'Ingress Policy ID',
39
- 'egress_firewall_policy_id': 'Egress Policy ID',
40
- 'description': 'Description',
41
- 'status': 'Status',
42
- 'ports': 'Ports',
43
- 'admin_state_up': 'State',
44
- 'shared': 'Shared',
45
- 'tenant_id': 'Project',
46
- 'project_id': 'Project',
47
- }
48
-
49
- _attr_map = (
50
- ('id', 'ID', column_util.LIST_BOTH),
51
- ('name', 'Name', column_util.LIST_BOTH),
52
- ('ingress_firewall_policy_id', 'Ingress Policy ID', column_util.LIST_BOTH),
53
- ('egress_firewall_policy_id', 'Egress Policy ID', column_util.LIST_BOTH),
54
- ('description', 'Description', column_util.LIST_LONG_ONLY),
55
- ('status', 'Status', column_util.LIST_LONG_ONLY),
56
- ('ports', 'Ports', column_util.LIST_LONG_ONLY),
57
- ('admin_state_up', 'State', column_util.LIST_LONG_ONLY),
58
- ('shared', 'Shared', column_util.LIST_LONG_ONLY),
59
- ('tenant_id', 'Project', column_util.LIST_LONG_ONLY),
60
- )
61
-
62
-
63
- def _get_common_parser(parser):
64
- parser.add_argument(
65
- '--name',
66
- help=_('Name for the firewall group'))
67
- parser.add_argument(
68
- '--description',
69
- metavar='<description>',
70
- help=_('Description of the firewall group'))
71
- ingress_group = parser.add_mutually_exclusive_group()
72
- ingress_group.add_argument(
73
- '--ingress-firewall-policy',
74
- metavar='<ingress-firewall-policy>',
75
- dest='ingress_firewall_policy',
76
- help=_('Ingress firewall policy (name or ID)'))
77
- ingress_group.add_argument(
78
- '--no-ingress-firewall-policy',
79
- dest='no_ingress_firewall_policy',
80
- action='store_true',
81
- help=_('Detach ingress firewall policy from the firewall group'))
82
- egress_group = parser.add_mutually_exclusive_group()
83
- egress_group.add_argument(
84
- '--egress-firewall-policy',
85
- metavar='<egress-firewall-policy>',
86
- dest='egress_firewall_policy',
87
- help=_('Egress firewall policy (name or ID)'))
88
- egress_group.add_argument(
89
- '--no-egress-firewall-policy',
90
- dest='no_egress_firewall_policy',
91
- action='store_true',
92
- help=_('Detach egress firewall policy from the firewall group'))
93
- shared_group = parser.add_mutually_exclusive_group()
94
-
95
- shared_group.add_argument(
96
- '--share',
97
- action='store_true',
98
- help=_('Share the firewall group to be used in all projects '
99
- '(by default, it is restricted to be used by the '
100
- 'current project).'))
101
- shared_group.add_argument(
102
- '--no-share',
103
- action='store_true',
104
- help=_('Restrict use of the firewall group to the '
105
- 'current project'))
106
- admin_group = parser.add_mutually_exclusive_group()
107
- admin_group.add_argument(
108
- '--enable',
109
- action='store_true',
110
- help=_('Enable firewall group'))
111
- admin_group.add_argument(
112
- '--disable',
113
- action='store_true',
114
- help=_('Disable firewall group'))
115
- return parser
116
-
117
-
118
- def _get_common_attrs(client_manager, parsed_args, is_create=True):
119
- attrs = {}
120
- client = client_manager.network
121
-
122
- if is_create:
123
- if 'project' in parsed_args and parsed_args.project is not None:
124
- attrs['tenant_id'] = osc_utils.find_project(
125
- client_manager.identity,
126
- parsed_args.project,
127
- parsed_args.project_domain,
128
- ).id
129
- if (parsed_args.ingress_firewall_policy and
130
- parsed_args.no_ingress_firewall_policy):
131
- attrs['ingress_firewall_policy_id'] = client.find_firewall_policy(
132
- parsed_args.ingress_firewall_policy)['id']
133
- elif parsed_args.ingress_firewall_policy:
134
- attrs['ingress_firewall_policy_id'] = client.find_firewall_policy(
135
- parsed_args.ingress_firewall_policy)['id']
136
- elif parsed_args.no_ingress_firewall_policy:
137
- attrs['ingress_firewall_policy_id'] = None
138
- if (parsed_args.egress_firewall_policy and
139
- parsed_args.no_egress_firewall_policy):
140
- attrs['egress_firewall_policy_id'] = client.find_firewall_policy(
141
- parsed_args.egress_firewall_policy)['id']
142
- elif parsed_args.egress_firewall_policy:
143
- attrs['egress_firewall_policy_id'] = client.find_firewall_policy(
144
- parsed_args.egress_firewall_policy)['id']
145
- elif parsed_args.no_egress_firewall_policy:
146
- attrs['egress_firewall_policy_id'] = None
147
- if parsed_args.share:
148
- attrs['shared'] = True
149
- if parsed_args.no_share:
150
- attrs['shared'] = False
151
- if parsed_args.enable:
152
- attrs['admin_state_up'] = True
153
- if parsed_args.disable:
154
- attrs['admin_state_up'] = False
155
- if parsed_args.name:
156
- attrs['name'] = str(parsed_args.name)
157
- if parsed_args.description:
158
- attrs['description'] = str(parsed_args.description)
159
- if parsed_args.port and parsed_args.no_port:
160
- attrs['ports'] = sorted([client.find_port(
161
- p)['id'] for p in set(parsed_args.port)])
162
- elif parsed_args.port:
163
- ports = []
164
- for p in set(parsed_args.port):
165
- ports.append(client.find_port(p)['id'])
166
- if not is_create:
167
- ports += client.find_firewall_group(
168
- parsed_args.firewall_group)['ports']
169
- attrs['ports'] = sorted(set(ports))
170
- elif parsed_args.no_port:
171
- attrs['ports'] = []
172
- return attrs
173
-
174
-
175
- class CreateFirewallGroup(command.ShowOne):
176
- _description = _("Create a new firewall group")
177
-
178
- def get_parser(self, prog_name):
179
- parser = super(CreateFirewallGroup, self).get_parser(prog_name)
180
- _get_common_parser(parser)
181
- osc_utils.add_project_owner_option_to_parser(parser)
182
- port_group = parser.add_mutually_exclusive_group()
183
- port_group.add_argument(
184
- '--port',
185
- metavar='<port>',
186
- action='append',
187
- help=_('Port(s) (name or ID) to apply firewall group. This '
188
- 'option can be repeated'))
189
- port_group.add_argument(
190
- '--no-port',
191
- dest='no_port',
192
- action='store_true',
193
- help=_('Detach all port from the firewall group'))
194
- return parser
195
-
196
- def take_action(self, parsed_args):
197
- client = self.app.client_manager.network
198
- attrs = _get_common_attrs(self.app.client_manager, parsed_args)
199
- obj = client.create_firewall_group(**attrs)
200
- display_columns, columns = utils.get_osc_show_columns_for_sdk_resource(
201
- obj, _attr_map_dict, ['location', 'tenant_id'])
202
- data = utils.get_dict_properties(obj, columns, formatters=_formatters)
203
- return (display_columns, data)
204
-
205
-
206
- class DeleteFirewallGroup(command.Command):
207
- _description = _("Delete firewall group(s)")
208
-
209
- def get_parser(self, prog_name):
210
- parser = super(DeleteFirewallGroup, self).get_parser(prog_name)
211
- parser.add_argument(
212
- const.FWG,
213
- metavar='<firewall-group>',
214
- nargs='+',
215
- help=_('Firewall group(s) to delete (name or ID)'))
216
- return parser
217
-
218
- def take_action(self, parsed_args):
219
- client = self.app.client_manager.network
220
- result = 0
221
- for fwg in parsed_args.firewall_group:
222
- try:
223
- fwg_id = client.find_firewall_group(fwg)['id']
224
- client.delete_firewall_group(fwg_id)
225
- except Exception as e:
226
- result += 1
227
- LOG.error(_("Failed to delete firewall group with "
228
- "name or ID '%(firewall_group)s': %(e)s"),
229
- {const.FWG: fwg, 'e': e})
230
-
231
- if result > 0:
232
- total = len(parsed_args.firewall_group)
233
- msg = (_("%(result)s of %(total)s firewall group(s) "
234
- "failed to delete.") % {'result': result, 'total': total})
235
- raise exceptions.CommandError(msg)
236
-
237
-
238
- class ListFirewallGroup(command.Lister):
239
- _description = _("List firewall groups")
240
-
241
- def get_parser(self, prog_name):
242
- parser = super(ListFirewallGroup, self).get_parser(prog_name)
243
- parser.add_argument(
244
- '--long',
245
- action='store_true',
246
- help=_("List additional fields in output")
247
- )
248
- return parser
249
-
250
- def take_action(self, parsed_args):
251
- client = self.app.client_manager.network
252
- obj = client.firewall_groups()
253
- headers, columns = column_util.get_column_definitions(
254
- _attr_map, long_listing=parsed_args.long)
255
- return (headers, (utils.get_dict_properties(
256
- s, columns, formatters=_formatters) for s in obj))
257
-
258
-
259
- class SetFirewallGroup(command.Command):
260
- _description = _("Set firewall group properties")
261
-
262
- def get_parser(self, prog_name):
263
- parser = super(SetFirewallGroup, self).get_parser(prog_name)
264
- _get_common_parser(parser)
265
- parser.add_argument(
266
- const.FWG,
267
- metavar='<firewall-group>',
268
- help=_('Firewall group to update (name or ID)'))
269
- parser.add_argument(
270
- '--port',
271
- metavar='<port>',
272
- action='append',
273
- help=_('Port(s) (name or ID) to apply firewall group. This '
274
- 'option can be repeated'))
275
- parser.add_argument(
276
- '--no-port',
277
- dest='no_port',
278
- action='store_true',
279
- help=_('Detach all port from the firewall group'))
280
- return parser
281
-
282
- def take_action(self, parsed_args):
283
- client = self.app.client_manager.network
284
- fwg_id = client.find_firewall_group(parsed_args.firewall_group)['id']
285
- attrs = _get_common_attrs(self.app.client_manager, parsed_args,
286
- is_create=False)
287
- try:
288
- client.update_firewall_group(fwg_id, **attrs)
289
- except Exception as e:
290
- msg = (_("Failed to set firewall group '%(group)s': %(e)s")
291
- % {'group': parsed_args.firewall_group, 'e': e})
292
- raise exceptions.CommandError(msg)
293
-
294
-
295
- class ShowFirewallGroup(command.ShowOne):
296
- _description = _("Display firewall group details")
297
-
298
- def get_parser(self, prog_name):
299
- parser = super(ShowFirewallGroup, self).get_parser(prog_name)
300
- parser.add_argument(
301
- const.FWG,
302
- metavar='<firewall-group>',
303
- help=_('Firewall group to show (name or ID)'))
304
- return parser
305
-
306
- def take_action(self, parsed_args):
307
- client = self.app.client_manager.network
308
- fwg_id = client.find_firewall_group(parsed_args.firewall_group)['id']
309
- obj = client.get_firewall_group(fwg_id)
310
- display_columns, columns = utils.get_osc_show_columns_for_sdk_resource(
311
- obj, _attr_map_dict, ['location', 'tenant_id'])
312
- data = utils.get_dict_properties(obj, columns, formatters=_formatters)
313
- return (display_columns, data)
314
-
315
-
316
- class UnsetFirewallGroup(command.Command):
317
- _description = _("Unset firewall group properties")
318
-
319
- def get_parser(self, prog_name):
320
- parser = super(UnsetFirewallGroup, self).get_parser(prog_name)
321
- parser.add_argument(
322
- const.FWG,
323
- metavar='<firewall-group>',
324
- help=_('Firewall group to unset (name or ID)'))
325
- port_group = parser.add_mutually_exclusive_group()
326
- port_group.add_argument(
327
- '--port',
328
- metavar='<port>',
329
- action='append',
330
- help=_('Port(s) (name or ID) to apply firewall group. This '
331
- 'option can be repeated'))
332
- port_group.add_argument(
333
- '--all-port',
334
- action='store_true',
335
- help=_('Remove all ports for this firewall group'))
336
- parser.add_argument(
337
- '--ingress-firewall-policy',
338
- action='store_true',
339
- help=_('Ingress firewall policy (name or ID) to delete'))
340
- parser.add_argument(
341
- '--egress-firewall-policy',
342
- action='store_true',
343
- dest='egress_firewall_policy',
344
- help=_('Egress firewall policy (name or ID) to delete'))
345
- shared_group = parser.add_mutually_exclusive_group()
346
- shared_group.add_argument(
347
- '--share',
348
- action='store_true',
349
- help=_('Restrict use of the firewall group to the '
350
- 'current project'))
351
- parser.add_argument(
352
- '--enable',
353
- action='store_true',
354
- help=_('Disable firewall group'))
355
- return parser
356
-
357
- def _get_attrs(self, client, parsed_args):
358
- attrs = {}
359
- if parsed_args.ingress_firewall_policy:
360
- attrs['ingress_firewall_policy_id'] = None
361
- if parsed_args.egress_firewall_policy:
362
- attrs['egress_firewall_policy_id'] = None
363
- if parsed_args.share:
364
- attrs['shared'] = False
365
- if parsed_args.enable:
366
- attrs['admin_state_up'] = False
367
- if parsed_args.port:
368
- old = client.find_firewall_group(
369
- parsed_args.firewall_group)['ports']
370
- new = [client.find_port(r)['id'] for r in parsed_args.port]
371
- attrs['ports'] = sorted(list(set(old) - set(new)))
372
- if parsed_args.all_port:
373
- attrs['ports'] = []
374
- return attrs
375
-
376
- def take_action(self, parsed_args):
377
- client = self.app.client_manager.network
378
- fwg_id = client.find_firewall_group(parsed_args.firewall_group)['id']
379
- attrs = self._get_attrs(client, parsed_args)
380
- try:
381
- client.update_firewall_group(fwg_id, **attrs)
382
- except Exception as e:
383
- msg = (_("Failed to unset firewall group '%(group)s': %(e)s")
384
- % {'group': parsed_args.firewall_group, 'e': e})
385
- raise exceptions.CommandError(msg)