python-neutronclient 13.0.0__py3-none-any.whl → 14.1.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.
- {python_neutronclient-13.0.0.dist-info → python_neutronclient-14.1.0.dist-info}/METADATA +1 -1
- {python_neutronclient-13.0.0.dist-info → python_neutronclient-14.1.0.dist-info}/RECORD +8 -27
- {python_neutronclient-13.0.0.dist-info → python_neutronclient-14.1.0.dist-info}/WHEEL +1 -1
- {python_neutronclient-13.0.0.dist-info → python_neutronclient-14.1.0.dist-info}/entry_points.txt +0 -26
- python_neutronclient-14.1.0.dist-info/pbr.json +1 -0
- neutronclient/osc/v2/subnet_onboard/__init__.py +0 -0
- neutronclient/osc/v2/subnet_onboard/subnet_onboard.py +0 -59
- neutronclient/osc/v2/vpnaas/__init__.py +0 -0
- neutronclient/osc/v2/vpnaas/endpoint_group.py +0 -222
- neutronclient/osc/v2/vpnaas/ikepolicy.py +0 -318
- neutronclient/osc/v2/vpnaas/ipsec_site_connection.py +0 -385
- neutronclient/osc/v2/vpnaas/ipsecpolicy.py +0 -318
- neutronclient/osc/v2/vpnaas/utils.py +0 -112
- neutronclient/osc/v2/vpnaas/vpnservice.py +0 -252
- neutronclient/tests/unit/osc/v2/subnet_onboard/__init__.py +0 -0
- neutronclient/tests/unit/osc/v2/subnet_onboard/test_network_onboard_subnets.py +0 -54
- neutronclient/tests/unit/osc/v2/vpnaas/__init__.py +0 -0
- neutronclient/tests/unit/osc/v2/vpnaas/common.py +0 -183
- neutronclient/tests/unit/osc/v2/vpnaas/fakes.py +0 -191
- neutronclient/tests/unit/osc/v2/vpnaas/test_endpoint_group.py +0 -254
- neutronclient/tests/unit/osc/v2/vpnaas/test_ikepolicy.py +0 -319
- neutronclient/tests/unit/osc/v2/vpnaas/test_ipsec_site_connection.py +0 -372
- neutronclient/tests/unit/osc/v2/vpnaas/test_ipsecpolicy.py +0 -299
- neutronclient/tests/unit/osc/v2/vpnaas/test_vpnservice.py +0 -305
- python_neutronclient-13.0.0.dist-info/pbr.json +0 -1
- {python_neutronclient-13.0.0.dist-info → python_neutronclient-14.1.0.dist-info}/licenses/AUTHORS +0 -0
- {python_neutronclient-13.0.0.dist-info → python_neutronclient-14.1.0.dist-info}/licenses/LICENSE +0 -0
- {python_neutronclient-13.0.0.dist-info → python_neutronclient-14.1.0.dist-info}/top_level.txt +0 -0
|
@@ -89,15 +89,6 @@ neutronclient/osc/v2/sfc/sfc_port_chain.py,sha256=7WZVtI6kd1DEQ2Gjzrpa-Qtxffagl7
|
|
|
89
89
|
neutronclient/osc/v2/sfc/sfc_port_pair.py,sha256=-LvrrVs_0UKWvNM2LwP7S0i3CAf_ofdoCYWmIMuKRqU,9167
|
|
90
90
|
neutronclient/osc/v2/sfc/sfc_port_pair_group.py,sha256=3ZVLxJ8B2PkZV0dhwvPCFzEdBRnD019tCcUuhEQ3sz4,12449
|
|
91
91
|
neutronclient/osc/v2/sfc/sfc_service_graph.py,sha256=Zn9_JsUYneKrrS486rlFIITWILCh7PAHpZCCN0ZRKiE,10187
|
|
92
|
-
neutronclient/osc/v2/subnet_onboard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
93
|
-
neutronclient/osc/v2/subnet_onboard/subnet_onboard.py,sha256=GK8LKPmkaN2lVt_QJnqq86ZL8d3xbC9CDCdiIu3mNhU,2091
|
|
94
|
-
neutronclient/osc/v2/vpnaas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
95
|
-
neutronclient/osc/v2/vpnaas/endpoint_group.py,sha256=8U5Nz-4iSocr29DwAVGm_SIhsDsjl8urEwxg-2x_U84,8133
|
|
96
|
-
neutronclient/osc/v2/vpnaas/ikepolicy.py,sha256=8sAMJptfghCT6D7qRbRFbP210fWhr0PRCHFTyPZXpoQ,10539
|
|
97
|
-
neutronclient/osc/v2/vpnaas/ipsec_site_connection.py,sha256=57DitWnWQdH0gINJV4W2a-_8i87lMjzN7XP7PTNCz18,15302
|
|
98
|
-
neutronclient/osc/v2/vpnaas/ipsecpolicy.py,sha256=yBwcUQPqS_fzg9OoseLGBq_vtsTYfD2PQ2A47_6PK0M,10760
|
|
99
|
-
neutronclient/osc/v2/vpnaas/utils.py,sha256=bCviT5_DpUgewZE0EfYzJvWV1ate_QZDYDiEr4c71t0,4312
|
|
100
|
-
neutronclient/osc/v2/vpnaas/vpnservice.py,sha256=4pyieUWMJ26hhTiHIoQH5jN4XKo1pRJIgJ7kOs2p-98,9048
|
|
101
92
|
neutronclient/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
93
|
neutronclient/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
103
94
|
neutronclient/tests/unit/test_casual_args.py,sha256=ckW0_DfdDD0mjUxPAAGjZyzzChp94vg-l2kRvK5YrGA,5814
|
|
@@ -120,23 +111,13 @@ neutronclient/tests/unit/osc/v2/sfc/test_port_chain.py,sha256=dqIG9lBiyCLO_KAOAg
|
|
|
120
111
|
neutronclient/tests/unit/osc/v2/sfc/test_port_pair.py,sha256=ufdZ4T_cAB0YvNsUiBo68M4elaebTheULtg41UfCBT4,11041
|
|
121
112
|
neutronclient/tests/unit/osc/v2/sfc/test_port_pair_group.py,sha256=v_cfgHCpttbXpDEQk1kIXukag-vYb3rUB21oCNTJ9RQ,16132
|
|
122
113
|
neutronclient/tests/unit/osc/v2/sfc/test_service_graph.py,sha256=lfwO5vGtqDEI_xcrs8EVGF_-Et7SdLAJReFPu8nNQCY,12037
|
|
123
|
-
neutronclient/tests/unit/osc/v2/subnet_onboard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
124
|
-
neutronclient/tests/unit/osc/v2/subnet_onboard/test_network_onboard_subnets.py,sha256=YRTVpvZiJ-EfzLQS2UX16IgoIX7vTNm_irglRqEe2YI,1907
|
|
125
|
-
neutronclient/tests/unit/osc/v2/vpnaas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
126
|
-
neutronclient/tests/unit/osc/v2/vpnaas/common.py,sha256=hYbpOr6MM8nZ__HHfrji5OITJO8PcHwMPQOoCnuZQNs,6734
|
|
127
|
-
neutronclient/tests/unit/osc/v2/vpnaas/fakes.py,sha256=oI9C_HE1yfA55w4CWKg6UiAg513WsNigiyeR69m8tAI,7121
|
|
128
|
-
neutronclient/tests/unit/osc/v2/vpnaas/test_endpoint_group.py,sha256=AekVbOf77XsHbyWNQowkC9YDWIg3qsZTQtKtCEKzAuo,8731
|
|
129
|
-
neutronclient/tests/unit/osc/v2/vpnaas/test_ikepolicy.py,sha256=ITofRBb1BloAauESTAQSxaL8ma7ThJakmqf4bRmIIDc,11182
|
|
130
|
-
neutronclient/tests/unit/osc/v2/vpnaas/test_ipsec_site_connection.py,sha256=xfwIWJvc8vWns2xthOaoXxQxCujPDgG5BC1OZYon3wY,13368
|
|
131
|
-
neutronclient/tests/unit/osc/v2/vpnaas/test_ipsecpolicy.py,sha256=XwOQvyj54yHd2xNkPOS0ERRKLLr3zie6H6M4jaOYvMw,10566
|
|
132
|
-
neutronclient/tests/unit/osc/v2/vpnaas/test_vpnservice.py,sha256=dXPhpvfrEA_uvvZ_nhtCWXzXFX7x3uxGu3p8XohH8Ko,9994
|
|
133
114
|
neutronclient/v2_0/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
134
115
|
neutronclient/v2_0/client.py,sha256=uYxHWtHXq2mWhM707UBu8De-q6ohlVp0-xklsH_s8rE,116835
|
|
135
|
-
python_neutronclient-
|
|
136
|
-
python_neutronclient-
|
|
137
|
-
python_neutronclient-
|
|
138
|
-
python_neutronclient-
|
|
139
|
-
python_neutronclient-
|
|
140
|
-
python_neutronclient-
|
|
141
|
-
python_neutronclient-
|
|
142
|
-
python_neutronclient-
|
|
116
|
+
python_neutronclient-14.1.0.dist-info/licenses/AUTHORS,sha256=hUa35KbI6UW9BTxvh4kgQrm3uxle5ket9_kfETkZ5zU,13611
|
|
117
|
+
python_neutronclient-14.1.0.dist-info/licenses/LICENSE,sha256=XfKg2H1sVi8OoRxoisUlMqoo10TKvHmU_wU39ks7MyA,10143
|
|
118
|
+
python_neutronclient-14.1.0.dist-info/METADATA,sha256=JSwLc55FlgO-oJUQTsyNS2-F6K-xdsuJc-wVpXsdA_w,3496
|
|
119
|
+
python_neutronclient-14.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
120
|
+
python_neutronclient-14.1.0.dist-info/entry_points.txt,sha256=W4V8JElz5AOKJ1HPU7CPrU473oLE1itcHYjU4O2LYog,2930
|
|
121
|
+
python_neutronclient-14.1.0.dist-info/pbr.json,sha256=aCORNI1cDxYkesEQUfp7P4lwRmrCzb85K-LHL1-WfOk,46
|
|
122
|
+
python_neutronclient-14.1.0.dist-info/top_level.txt,sha256=SxHuzHShRY_O8UAQAiwIMIjwHRm7Tr05U-cvrn1fLgU,14
|
|
123
|
+
python_neutronclient-14.1.0.dist-info/RECORD,,
|
{python_neutronclient-13.0.0.dist-info → python_neutronclient-14.1.0.dist-info}/entry_points.txt
RENAMED
|
@@ -8,7 +8,6 @@ network_log_list = neutronclient.osc.v2.logging.network_log:ListNetworkLog
|
|
|
8
8
|
network_log_set = neutronclient.osc.v2.logging.network_log:SetNetworkLog
|
|
9
9
|
network_log_show = neutronclient.osc.v2.logging.network_log:ShowNetworkLog
|
|
10
10
|
network_loggable_resources_list = neutronclient.osc.v2.logging.network_log:ListLoggableResource
|
|
11
|
-
network_onboard_subnets = neutronclient.osc.v2.subnet_onboard.subnet_onboard:NetworkOnboardSubnets
|
|
12
11
|
sfc_flow_classifier_create = neutronclient.osc.v2.sfc.sfc_flow_classifier:CreateSfcFlowClassifier
|
|
13
12
|
sfc_flow_classifier_delete = neutronclient.osc.v2.sfc.sfc_flow_classifier:DeleteSfcFlowClassifier
|
|
14
13
|
sfc_flow_classifier_list = neutronclient.osc.v2.sfc.sfc_flow_classifier:ListSfcFlowClassifier
|
|
@@ -36,28 +35,3 @@ sfc_service_graph_delete = neutronclient.osc.v2.sfc.sfc_service_graph:DeleteSfcS
|
|
|
36
35
|
sfc_service_graph_list = neutronclient.osc.v2.sfc.sfc_service_graph:ListSfcServiceGraph
|
|
37
36
|
sfc_service_graph_set = neutronclient.osc.v2.sfc.sfc_service_graph:SetSfcServiceGraph
|
|
38
37
|
sfc_service_graph_show = neutronclient.osc.v2.sfc.sfc_service_graph:ShowSfcServiceGraph
|
|
39
|
-
vpn_endpoint_group_create = neutronclient.osc.v2.vpnaas.endpoint_group:CreateEndpointGroup
|
|
40
|
-
vpn_endpoint_group_delete = neutronclient.osc.v2.vpnaas.endpoint_group:DeleteEndpointGroup
|
|
41
|
-
vpn_endpoint_group_list = neutronclient.osc.v2.vpnaas.endpoint_group:ListEndpointGroup
|
|
42
|
-
vpn_endpoint_group_set = neutronclient.osc.v2.vpnaas.endpoint_group:SetEndpointGroup
|
|
43
|
-
vpn_endpoint_group_show = neutronclient.osc.v2.vpnaas.endpoint_group:ShowEndpointGroup
|
|
44
|
-
vpn_ike_policy_create = neutronclient.osc.v2.vpnaas.ikepolicy:CreateIKEPolicy
|
|
45
|
-
vpn_ike_policy_delete = neutronclient.osc.v2.vpnaas.ikepolicy:DeleteIKEPolicy
|
|
46
|
-
vpn_ike_policy_list = neutronclient.osc.v2.vpnaas.ikepolicy:ListIKEPolicy
|
|
47
|
-
vpn_ike_policy_set = neutronclient.osc.v2.vpnaas.ikepolicy:SetIKEPolicy
|
|
48
|
-
vpn_ike_policy_show = neutronclient.osc.v2.vpnaas.ikepolicy:ShowIKEPolicy
|
|
49
|
-
vpn_ipsec_policy_create = neutronclient.osc.v2.vpnaas.ipsecpolicy:CreateIPsecPolicy
|
|
50
|
-
vpn_ipsec_policy_delete = neutronclient.osc.v2.vpnaas.ipsecpolicy:DeleteIPsecPolicy
|
|
51
|
-
vpn_ipsec_policy_list = neutronclient.osc.v2.vpnaas.ipsecpolicy:ListIPsecPolicy
|
|
52
|
-
vpn_ipsec_policy_set = neutronclient.osc.v2.vpnaas.ipsecpolicy:SetIPsecPolicy
|
|
53
|
-
vpn_ipsec_policy_show = neutronclient.osc.v2.vpnaas.ipsecpolicy:ShowIPsecPolicy
|
|
54
|
-
vpn_ipsec_site_connection_create = neutronclient.osc.v2.vpnaas.ipsec_site_connection:CreateIPsecSiteConnection
|
|
55
|
-
vpn_ipsec_site_connection_delete = neutronclient.osc.v2.vpnaas.ipsec_site_connection:DeleteIPsecSiteConnection
|
|
56
|
-
vpn_ipsec_site_connection_list = neutronclient.osc.v2.vpnaas.ipsec_site_connection:ListIPsecSiteConnection
|
|
57
|
-
vpn_ipsec_site_connection_set = neutronclient.osc.v2.vpnaas.ipsec_site_connection:SetIPsecSiteConnection
|
|
58
|
-
vpn_ipsec_site_connection_show = neutronclient.osc.v2.vpnaas.ipsec_site_connection:ShowIPsecSiteConnection
|
|
59
|
-
vpn_service_create = neutronclient.osc.v2.vpnaas.vpnservice:CreateVPNService
|
|
60
|
-
vpn_service_delete = neutronclient.osc.v2.vpnaas.vpnservice:DeleteVPNService
|
|
61
|
-
vpn_service_list = neutronclient.osc.v2.vpnaas.vpnservice:ListVPNService
|
|
62
|
-
vpn_service_set = neutronclient.osc.v2.vpnaas.vpnservice:SetVPNSercice
|
|
63
|
-
vpn_service_show = neutronclient.osc.v2.vpnaas.vpnservice:ShowVPNService
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "34ca4e3", "is_release": true}
|
|
File without changes
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2019 SUSE Linux Products GmbH
|
|
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
|
-
|
|
17
|
-
"""Subnet onboard action implementation"""
|
|
18
|
-
import logging
|
|
19
|
-
|
|
20
|
-
from osc_lib.command import command
|
|
21
|
-
from osc_lib import exceptions
|
|
22
|
-
|
|
23
|
-
from neutronclient._i18n import _
|
|
24
|
-
|
|
25
|
-
LOG = logging.getLogger(__name__)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class NetworkOnboardSubnets(command.Command):
|
|
29
|
-
"""Onboard network subnets into a subnet pool"""
|
|
30
|
-
|
|
31
|
-
def get_parser(self, prog_name):
|
|
32
|
-
parser = super(NetworkOnboardSubnets, self).get_parser(prog_name)
|
|
33
|
-
parser.add_argument(
|
|
34
|
-
'network',
|
|
35
|
-
metavar="<network>",
|
|
36
|
-
help=_("Onboard all subnets associated with this network")
|
|
37
|
-
)
|
|
38
|
-
parser.add_argument(
|
|
39
|
-
'subnetpool',
|
|
40
|
-
metavar="<subnetpool>",
|
|
41
|
-
help=_("Target subnet pool for onboarding subnets")
|
|
42
|
-
)
|
|
43
|
-
return parser
|
|
44
|
-
|
|
45
|
-
def take_action(self, parsed_args):
|
|
46
|
-
client = self.app.client_manager.neutronclient
|
|
47
|
-
subnetpool_id = _get_id(client, parsed_args.subnetpool, 'subnetpool')
|
|
48
|
-
network_id = _get_id(client, parsed_args.network, 'network')
|
|
49
|
-
body = {'network_id': network_id}
|
|
50
|
-
try:
|
|
51
|
-
client.onboard_network_subnets(subnetpool_id, body)
|
|
52
|
-
except Exception as e:
|
|
53
|
-
msg = (_("Failed to onboard subnets for network '%(n)s': %(e)s")
|
|
54
|
-
% {'n': parsed_args.network, 'e': e})
|
|
55
|
-
raise exceptions.CommandError(msg)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def _get_id(client, id_or_name, resource):
|
|
59
|
-
return client.find_resource(resource, str(id_or_name))['id']
|
|
File without changes
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
# Copyright 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
|
-
|
|
17
|
-
from osc_lib.command import command
|
|
18
|
-
from osc_lib import exceptions
|
|
19
|
-
from osc_lib import utils
|
|
20
|
-
from osc_lib.utils import columns as column_util
|
|
21
|
-
from oslo_log import log as logging
|
|
22
|
-
|
|
23
|
-
from neutronclient._i18n import _
|
|
24
|
-
from neutronclient.osc import utils as osc_utils
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
LOG = logging.getLogger(__name__)
|
|
28
|
-
|
|
29
|
-
_attr_map = (
|
|
30
|
-
('id', 'ID', column_util.LIST_BOTH),
|
|
31
|
-
('name', 'Name', column_util.LIST_BOTH),
|
|
32
|
-
('type', 'Type', column_util.LIST_BOTH),
|
|
33
|
-
('endpoints', 'Endpoints', column_util.LIST_BOTH),
|
|
34
|
-
('description', 'Description', column_util.LIST_LONG_ONLY),
|
|
35
|
-
('project_id', 'Project', column_util.LIST_LONG_ONLY),
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
_attr_map_dict = {
|
|
39
|
-
'id': 'ID',
|
|
40
|
-
'name': 'Name',
|
|
41
|
-
'type': 'Type',
|
|
42
|
-
'endpoints': 'Endpoints',
|
|
43
|
-
'description': 'Description',
|
|
44
|
-
'tenant_id': 'Project',
|
|
45
|
-
'project_id': 'Project',
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def _get_common_parser(parser):
|
|
50
|
-
parser.add_argument(
|
|
51
|
-
'--description',
|
|
52
|
-
metavar='<description>',
|
|
53
|
-
help=_('Description for the endpoint group'))
|
|
54
|
-
return parser
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def _get_common_attrs(client_manager, parsed_args, is_create=True):
|
|
58
|
-
attrs = {}
|
|
59
|
-
if is_create:
|
|
60
|
-
if parsed_args.project is not None:
|
|
61
|
-
attrs['tenant_id'] = osc_utils.find_project(
|
|
62
|
-
client_manager.identity,
|
|
63
|
-
parsed_args.project,
|
|
64
|
-
parsed_args.project_domain,
|
|
65
|
-
).id
|
|
66
|
-
if parsed_args.description:
|
|
67
|
-
attrs['description'] = parsed_args.description
|
|
68
|
-
return attrs
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class CreateEndpointGroup(command.ShowOne):
|
|
72
|
-
_description = _("Create an endpoint group")
|
|
73
|
-
|
|
74
|
-
def get_parser(self, prog_name):
|
|
75
|
-
parser = super(CreateEndpointGroup, self).get_parser(prog_name)
|
|
76
|
-
_get_common_parser(parser)
|
|
77
|
-
parser.add_argument(
|
|
78
|
-
'name',
|
|
79
|
-
metavar='<name>',
|
|
80
|
-
help=_('Name for the endpoint group'))
|
|
81
|
-
parser.add_argument(
|
|
82
|
-
'--type',
|
|
83
|
-
required=True,
|
|
84
|
-
help=_('Type of endpoints in group (e.g. subnet, cidr)'))
|
|
85
|
-
parser.add_argument(
|
|
86
|
-
'--value',
|
|
87
|
-
action='append',
|
|
88
|
-
dest='endpoints',
|
|
89
|
-
required=True,
|
|
90
|
-
help=_('Endpoint(s) for the group. Must all be of the same type. '
|
|
91
|
-
'(--value) option can be repeated'))
|
|
92
|
-
osc_utils.add_project_owner_option_to_parser(parser)
|
|
93
|
-
return parser
|
|
94
|
-
|
|
95
|
-
def take_action(self, parsed_args):
|
|
96
|
-
client = self.app.client_manager.network
|
|
97
|
-
attrs = _get_common_attrs(self.app.client_manager, parsed_args)
|
|
98
|
-
if parsed_args.name:
|
|
99
|
-
attrs['name'] = str(parsed_args.name)
|
|
100
|
-
attrs['type'] = parsed_args.type
|
|
101
|
-
if parsed_args.type == 'subnet':
|
|
102
|
-
_subnet_ids = [client.find_subnet(
|
|
103
|
-
endpoint,
|
|
104
|
-
ignore_missing=False)['id']
|
|
105
|
-
for endpoint in parsed_args.endpoints]
|
|
106
|
-
attrs['endpoints'] = _subnet_ids
|
|
107
|
-
else:
|
|
108
|
-
attrs['endpoints'] = parsed_args.endpoints
|
|
109
|
-
obj = client.create_vpn_endpoint_group(**attrs)
|
|
110
|
-
display_columns, columns = utils.get_osc_show_columns_for_sdk_resource(
|
|
111
|
-
obj, _attr_map_dict, ['location', 'tenant_id'])
|
|
112
|
-
data = utils.get_dict_properties(obj, columns)
|
|
113
|
-
return display_columns, data
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
class DeleteEndpointGroup(command.Command):
|
|
117
|
-
_description = _("Delete endpoint group(s)")
|
|
118
|
-
|
|
119
|
-
def get_parser(self, prog_name):
|
|
120
|
-
parser = super(DeleteEndpointGroup, self).get_parser(prog_name)
|
|
121
|
-
parser.add_argument(
|
|
122
|
-
'endpoint_group',
|
|
123
|
-
metavar='<endpoint-group>',
|
|
124
|
-
nargs='+',
|
|
125
|
-
help=_('Endpoint group(s) to delete (name or ID)'))
|
|
126
|
-
return parser
|
|
127
|
-
|
|
128
|
-
def take_action(self, parsed_args):
|
|
129
|
-
client = self.app.client_manager.network
|
|
130
|
-
result = 0
|
|
131
|
-
for endpoint in parsed_args.endpoint_group:
|
|
132
|
-
try:
|
|
133
|
-
endpoint_id = client.find_vpn_endpoint_group(
|
|
134
|
-
endpoint, ignore_missing=False)['id']
|
|
135
|
-
client.delete_vpn_endpoint_group(endpoint_id)
|
|
136
|
-
except Exception as e:
|
|
137
|
-
result += 1
|
|
138
|
-
LOG.error(_("Failed to delete endpoint group with "
|
|
139
|
-
"name or ID '%(endpoint_group)s': %(e)s"),
|
|
140
|
-
{'endpoint_group': endpoint, 'e': e})
|
|
141
|
-
|
|
142
|
-
if result > 0:
|
|
143
|
-
total = len(parsed_args.endpoint_group)
|
|
144
|
-
msg = (_("%(result)s of %(total)s endpoint group failed "
|
|
145
|
-
"to delete.") % {'result': result, 'total': total})
|
|
146
|
-
raise exceptions.CommandError(msg)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
class ListEndpointGroup(command.Lister):
|
|
150
|
-
_description = _("List endpoint groups that belong to a given project")
|
|
151
|
-
|
|
152
|
-
def get_parser(self, prog_name):
|
|
153
|
-
parser = super(ListEndpointGroup, self).get_parser(prog_name)
|
|
154
|
-
parser.add_argument(
|
|
155
|
-
'--long',
|
|
156
|
-
action='store_true',
|
|
157
|
-
default=False,
|
|
158
|
-
help=_("List additional fields in output")
|
|
159
|
-
)
|
|
160
|
-
return parser
|
|
161
|
-
|
|
162
|
-
def take_action(self, parsed_args):
|
|
163
|
-
client = self.app.client_manager.network
|
|
164
|
-
obj = client.vpn_endpoint_groups()
|
|
165
|
-
headers, columns = column_util.get_column_definitions(
|
|
166
|
-
_attr_map, long_listing=parsed_args.long)
|
|
167
|
-
return (headers, (utils.get_dict_properties(s, columns) for s in obj))
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
class SetEndpointGroup(command.Command):
|
|
171
|
-
_description = _("Set endpoint group properties")
|
|
172
|
-
|
|
173
|
-
def get_parser(self, prog_name):
|
|
174
|
-
parser = super(SetEndpointGroup, self).get_parser(prog_name)
|
|
175
|
-
_get_common_parser(parser)
|
|
176
|
-
parser.add_argument(
|
|
177
|
-
'--name',
|
|
178
|
-
metavar='<name>',
|
|
179
|
-
help=_('Set a name for the endpoint group'))
|
|
180
|
-
parser.add_argument(
|
|
181
|
-
'endpoint_group',
|
|
182
|
-
metavar='<endpoint-group>',
|
|
183
|
-
help=_('Endpoint group to set (name or ID)'))
|
|
184
|
-
return parser
|
|
185
|
-
|
|
186
|
-
def take_action(self, parsed_args):
|
|
187
|
-
client = self.app.client_manager.network
|
|
188
|
-
attrs = _get_common_attrs(self.app.client_manager,
|
|
189
|
-
parsed_args, is_create=False)
|
|
190
|
-
if parsed_args.name:
|
|
191
|
-
attrs['name'] = str(parsed_args.name)
|
|
192
|
-
endpoint_id = client.find_vpn_endpoint_group(
|
|
193
|
-
parsed_args.endpoint_group, ignore_missing=False)['id']
|
|
194
|
-
try:
|
|
195
|
-
client.update_vpn_endpoint_group(endpoint_id, **attrs)
|
|
196
|
-
except Exception as e:
|
|
197
|
-
msg = (_("Failed to set endpoint group "
|
|
198
|
-
"%(endpoint_group)s: %(e)s")
|
|
199
|
-
% {'endpoint_group': parsed_args.endpoint_group, 'e': e})
|
|
200
|
-
raise exceptions.CommandError(msg)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
class ShowEndpointGroup(command.ShowOne):
|
|
204
|
-
_description = _("Display endpoint group details")
|
|
205
|
-
|
|
206
|
-
def get_parser(self, prog_name):
|
|
207
|
-
parser = super(ShowEndpointGroup, self).get_parser(prog_name)
|
|
208
|
-
parser.add_argument(
|
|
209
|
-
'endpoint_group',
|
|
210
|
-
metavar='<endpoint-group>',
|
|
211
|
-
help=_('Endpoint group to display (name or ID)'))
|
|
212
|
-
return parser
|
|
213
|
-
|
|
214
|
-
def take_action(self, parsed_args):
|
|
215
|
-
client = self.app.client_manager.network
|
|
216
|
-
endpoint_id = client.find_vpn_endpoint_group(
|
|
217
|
-
parsed_args.endpoint_group, ignore_missing=False)['id']
|
|
218
|
-
obj = client.get_vpn_endpoint_group(endpoint_id)
|
|
219
|
-
display_columns, columns = utils.get_osc_show_columns_for_sdk_resource(
|
|
220
|
-
obj, _attr_map_dict, ['location', 'tenant_id'])
|
|
221
|
-
data = utils.get_dict_properties(obj, columns)
|
|
222
|
-
return (display_columns, data)
|