summaryrefslogtreecommitdiff
path: root/openstackclient/network/v2/network.py
Commit message (Collapse)AuthorAgeFilesLines
* Blacken openstackclient.networkStephen Finucane2023-05-101-127/+194
| | | | | | | | | | Black used with the '-l 79 -S' flags. A future change will ignore this commit in git-blame history by adding a 'git-blame-ignore-revs' file. Change-Id: I8048746dbc2ef0cb582f68934734db4c1153d779 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Improve help text for network create --external"Zuul2022-09-301-4/+8
|\
| * Improve help text for network create --externalBence Romsics2022-09-261-4/+8
| | | | | | | | | | Change-Id: Ie802fbb8a35e53dcb79b5581f64caa2db1609480 Closes-Bug: #1990285
* | Fix missing closing brackets in metavarTakashi Kajinami2022-08-261-2/+2
|/ | | | | | ... to display the complete format in --help output. Change-Id: I4d0f044072b206f6205b4b4f4992fd08f01729d6
* Don't show tenant_id in network objectsDr. Jens Harbott2022-06-271-0/+1
| | | | | | | | | | | | Patch [0] dropped mapping the tenant_id attribute to project_id. However, the Neutron API still returns the tenant_id attribute in addition to the project_id and so we still need to discard it from the output. [0] I5f62f2a76592eaaaed6703624e959df41a6ecc8f Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Change-Id: Iba1e003bf587802f28928cb44d160b3b3fb1f840
* Get rid of tenant_id in the network commandsArtem Goncharov2022-01-171-7/+1
| | | | | | Finally drop tenant_id completely from the networking service. Change-Id: I5f62f2a76592eaaaed6703624e959df41a6ecc8f
* Hide location columns for network objectsDr. Jens Harbott2021-12-161-1/+6
| | | | | | | | | | | | | Network objects returned from the SDK include a location column which has a reference to the cloud to which the object belongs. We don't want to include them in CLI output where they are useless. The solution implemented in [0] was dropped as a sideeffect in [1]. [0] https://review.opendev.org/c/openstack/python-openstackclient/+/679445 [1] https://review.opendev.org/c/openstack/python-openstackclient/+/815032 Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Change-Id: I9a408d9721c9c57d752afaab520cd6ee379a5184
* Remove 'get_osc_show_columns_for_sdk_resource' duplicatesStephen Finucane2021-10-211-3/+2
| | | | | | | | | | | | There were a number of 'get_osc_show_columns_for_sdk_resource' defined in-tree. However, osc-lib has provided this method for some time (since 2.2.0, June 2020 [1] - our minimum version is currently 2.3.0) so there's no need to provide our own copies. Remove them. [1] https://github.com/openstack/osc-lib/commit/29a0c5a5 Change-Id: I25695f4f9a379dd691b7eaa1e3247164668ae77e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Allow to send extra attributes in Neutron related commandsSlawek Kaplonski2021-05-261-6/+11
| | | | | | | | | | To deprecate and drop support for neutronclient CLI and use only OSC we need feature parity between OSC and neutronclient. Last missing piece here is possibility to send in POST/PUT requests unknown parameters to the Neutron server. This patch adds such possibility to the OSC. Change-Id: Iba09297c2be9fb9fa0be1b3dc65755277b79230e
* Revert "Format location columns in network commands"Jens Harbott (frickler)2020-06-171-1/+0
| | | | | | This reverts commit 6ee7b8d138e07bfc37c5cd887f7afa49cdabb02f. Change-Id: I5f59959ba8a01aba49e29f4cb007397467344e58
* Revert "Disallow setting default on internal network"Vasyl Saienko2020-04-081-6/+1
| | | | | | | | | | | | | The original patch assumes that both --external and --is-default are set in the same request and broke case when --is-default is set as an network update. The validation logic have to be moved on API side to avoid extra API calls from openstackclient. This reverts commit 962efd949feb461283a9bb4a668fbd310f80ba40. Related-Bug: #1745658 Change-Id: Idf08abb0e08a6880f89c3e9df9dd2ac82f36c432
* Disallow setting default on internal networkHongbin Lu2020-03-091-1/+6
| | | | | | | | | The ``--default`` option should be only used for external network. Default internal network is not currently supported so we disallow it for now. Change-Id: Ia9d39b40e1e041d7bda0f6a27d058e382b572e1a Closes-Bug: #1745658
* Switch to using osc_lib.utils.tagsMichael Johnson2020-01-141-1/+1
| | | | | | | | | | | | This patch updates the network modules to use the new osc_lib.utils.tags module and removes the in tree _tag.py version. A previous patch[1] moves the _tag.py code to osc-lib to allow other projects to leverage the code. [1] https://review.opendev.org/662859 Change-Id: Id0c34029e327de50c5fd2732bae5fbf45bbd16ee
* neutron: autogenerate docsEric Fried2019-11-011-43/+66
| | | | | | | | | | | | | | | | | | | $namespace = openstack.network.v2 The subcommand documents for $namespace were hardcoded and thus prone to drift over time. This commit removes the hardcoded content and uses the autoprogram-cliff directive to generate them automatically from the subcommand configuration classes. This one turned out to be quite involved, because we support both neutron and nova-network. When running in a real cloud, the command classes detect whether the neutron service is present, assume nova-network if that service is not found, and only add parser options relevant to the detected service. But the docs need to present both sets of options. This was easy enough when they were hardcoded, but required a bit of additional infrastructure for generated docs. Change-Id: I426261eb1d86bcc68656aabd61f10b7f082da402
* Format location columns in network commandsDean Troyer2019-08-301-0/+1
| | | | | | | | | | | | These return a Munch from the SDK, which can be handled exactly like a dict so do that. Note that the location column has a nested project dict in the return value, this is addressed separately in osc_lib.format_columns in https://review.opendev.org/#/c/679474/. Change-Id: I99a6d192749a4ac76777f72be8118261c0521cb0 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* Use cliff formattable columns in network commandsAkihiro Motoki2019-05-091-13/+17
| | | | | | | | | | | Use cliff formattable columns not to convert complex fields into a string when a machine readable format like JSON or YAML is requested. Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: I9878f327e39f56852cc0fb6e4eee9105b7141da9
* Remove str() when setting network objects namesBernard Cafarelli2019-02-131-2/+2
| | | | | | | | | | | | | Most network commands use str() on name argument, which fails on python 2 with Unicode characters. This comes from parsed arguments so does not actually need this call. Sample command failing with current code: openstack network create test_unicodeā„¢ Change-Id: Ie10b67864c912ee5c33e90b10c3d9705ee8307e7 Story: 2004356 Task: 27955
* Add dns-domain support to Network objectPierre Hanselmann2018-04-231-2/+16
| | | | | | | | | | | Add "dns-domain" parameter to Network class. Also check backend extensions and send an error message in case of an argument (like dns-domain) is sent and the extension is missing (dns-integration in this case). Change-Id: I7303658c27d9b9f2d8381ccea0b29e96909cab54 Closes-Bug: 1633214 Partial-Bug: 1547736
* neutron: add --mtu for create/set networkEmilien Macchi2018-03-151-0/+14
| | | | | | | Support Neutron network mtu configuration with a new argument, --mtu that allows CLI users to set MTU for Neutron networks. Change-Id: I93d23581c7e8c84eaf9bb3b293360036f60f456b
* Network tag supportAkihiro Motoki2017-07-231-2/+41
| | | | | | | | | | | | | Neutron tag mechanism now supports network, subnet, port, subnetpool and router. Tag support for more resources is planned. This commit introduces a common mixin class to implement tag operation and individual resource consumes it. To support tag remove, network unset command is added. Implements blueprint neutron-client-tag Change-Id: Iad59d052f46896d27d73c22d6d4bb3df889f2352
* Merge "Show neutron tags in OSC network show"Jenkins2017-06-301-0/+2
|\
| * Show neutron tags in OSC network showM V P Nitesh2017-06-221-0/+2
| | | | | | | | | | | | | | | | | | Now tag information of the network is displayed when the user tries to see the network details using the command openstack network show <net-id> Change-Id: I587d2bca37b8dbef4400db3d8ace3c81d87e2db3 Closes-Bug: #1695783
* | Don't show hint about vlan transparent in network setHong Hui Xiao2017-06-121-15/+15
|/ | | | | | | Update this attribute is not allowed in neutron. Change-Id: I38010b26e116246c13dbb6cc6a777d2f22f6dc30 Closes-Bug: #1691776
* Fix Nova-net netowrk commandsDean Troyer2017-04-271-22/+23
| | | | | | | | | | | | In cleaning up functional tests for nova-net, I discovered some problems in network create: * --subnet option is required in network create command * Switch API to use /os-networks rather than /os-tenant-networks as this is what we were actually using via novaclient * Fix functional tests for nova-net * Normalize some private function names in network/v2/network.py Change-Id: I426b864406756d58d140575a3a45ee9aee67ce84
* Low-level Compute v2 API: networkDean Troyer2017-04-171-17/+13
| | | | | | | | | | api.compute.APIv2 network functions. novaclient 8.0 is now released without support for the previously deprecated nova-net functions, so include a new low-level REST implementation of the removed APIs. Change-Id: If230f128e91cda44461fe93c976cac2aecec2252
* Introduce Neutron DHCP agent commands to OSCShashank Kumar Shankar2017-03-201-11/+33
| | | | | | | | | | | | | | | | | | | | | This patch introduces neutron dhcp-agent related commands to OpenStack client. The equivalent neutron commands implemented in OSC: neutron: dhcp-agent-list-hosting-net OSC: network agent list --network neutron: dhcp-agent-network-add OSC: network agent add network neutron: dhcp-agent-network-remove OSC: network agent remove network neutron: net-list-on-dhcp-agent OSC: network list --agent Change-Id: I77a933f4b3ce875c63cef5b6a32aee78fd844b03
* Fix can not set is_default in networkjiahui.qiang2017-02-231-4/+4
| | | | | | | | | | The value of is_default always be None, can not be set by "network set" command. Allow "--default" and "--no-default" options to be recognized when ``--external`` is not present. Closes-bug:#1665231 Change-Id: I7a05fc7734a15994f72ca4e47997b4952f1f72f8
* Fix network create --projectDean Troyer2017-01-271-0/+2
| | | | | | | SDK 0.9.13 needs to see project_id in the attributes, not tenant_id. Closes-bug: 1659878 Change-Id: Iff7abe8bd00cbe087c07579596c40af8b0a73302
* Remove the fixed set of choices for network_typeYAMAMOTO Takashi2017-01-181-3/+1
| | | | | | | So that it can specify out-of-tree ML2 type drivers. Closes-Bug: #1657311 Change-Id: I2445fb165b86cf5937d8aa09ba0fd5564eb1f8f4
* SDK refactor: Prepare network commandsSindhu Devale2016-12-151-10/+47
| | | | | | | Prepare the OSC "network" commands for the SDK refactor. Change-Id: I50680f6675905f2147fee94cce8c1ed9c81dac0a Partially-Implements: blueprint network-command-sdk-support
* Add QoS support to Network object.Rodolfo Alonso Hernandez2016-11-281-0/+23
| | | | | | | Added "qos_policy" parameter to Network class. Change-Id: Idc00f2792eef5b1f0910084d95cf9a8e83fe818c Closes-Bug: 1627069
* translate all command help strings3.4.0Steve Martinelli2016-11-171-5/+5
| | | | | | | | | | | | | | Leverage the new cliff command class attribute (_description) to get the help of a command, this allows us to mark strings for translation. We could not do this before since the help was grabbed from the docstring. This also depends on a new release of cliff and a bump to the minimum level in osc's requirements. Closes-Bug: 1636209 Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
* Support --provider-* options in the network list commandYan Xing'an2016-10-271-1/+31
| | | | | | | | | Add --provider-network-type, --provider-physical-network, --provider-segment options into network list command. Change-Id: I02546170211fb3e7e55d5dc7e7cdc6d387fd26e5 Closes-Bug: #1635580 Partially-Implements: blueprint network-commands-options
* Avoid duplicated project_id when show networkjudy-yu2016-10-241-0/+1
| | | | | | | | | Project_id appear twice when show network. This patch check and not append if it already has one. Change-Id: I4400239f454522101b639a0412050dd60eb6a612 Closes-Bug: #1636123 Partially-Implements: blueprint duplicated-project-id
* Merge "Add filtering options to os network list command"Jenkins2016-09-221-6/+77
|\
| * Add filtering options to os network list commandHa Van Tu2016-09-221-6/+77
| | | | | | | | | | | | | | | | | | | | This patch adds the following filtering options: '--name', '--internal', '--share' and '--no-share', '--enable' and '--disable', '--project' and '--project-domain', '--status'. Change-Id: I7e9dd372ee572c6ee8cdba7fac3182f9dc0a137b Partially-Implements: blueprint network-commands-options Closes-Bug: #1578819
* | Add --description to Create/Set NetworkAnkur Gupta2016-09-191-0/+14
|/ | | | | | | | Added simple option for network description to create and set network. Change-Id: I90ce4db4e365a56ecddb00d59f4c5aa2ebbd49a3 Partially-Implements: blueprint network-command-options
* Add port security option to network commandsRichard Theis2016-06-291-0/+30
| | | | | | | | | Add the "--enable-port-security" and "--disable-port-security" options to the "network create" and "network set" commands. This supports setting the default port security for ports created on a network. Change-Id: I1deb505bd77cef2e4bc3c2dbbb0c450665136f47 Implements: blueprint neutron-client
* Fix typo in openstackclient/network/v2Cao Xuan Hoang2016-06-231-1/+1
| | | | | | | | This patch adds the missing "." to some docstring/text. Trivial fix Change-Id: Iffb470dcce7200ddc9e439c465adc652a8322708
* Merge "Add geneve provider network type"Jenkins2016-06-151-4/+4
|\
| * Add geneve provider network typeRichard Theis2016-06-101-4/+4
| | | | | | | | | | | | | | | | Add the "geneve" choice to the "os network create" command's "--provider-network-type" option. Change-Id: I7573232ec3594ec4acbfae43a8456b8c3fcd1a83 Implements: blueprint neutron-client
* | osc-lib: commandDean Troyer2016-06-131-1/+1
| | | | | | | | | | | | | | Leave command.py and test_command.py as a sanity check during the deprecation period. Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
* | osc-lib: utilsDean Troyer2016-06-131-1/+2
|/ | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* Make set/unset commands in network return normally when nothing specifiedTang Chen2016-06-081-5/+0
| | | | | | | | | | | | | | set/unset commands should ends up normally instead of raising an exception when nothing is specified to modify. The main reason is: When nothing is specified, the command sets/unsets nothing, which is a normal behavior, and ends up normally. No API call fails. No error happens. This patch also adds a releasenote for both network, and volume commands that fix patch has been merged. Change-Id: I78c348066078decd350417a431f3b8bea8fcf9ef Partial-bug: #1588588
* Merge "Enhance exception handling for "network delete" command"Jenkins2016-05-171-10/+10
|\
| * Enhance exception handling for "network delete" commandTang Chen2016-04-141-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch rework "network delete" command following the rules in doc/source/command-errors.rst. In "network delete" command, there are multiple REST API calls, and we should make as many of them as possible. And log error for each one, give a better error message. Also return a non-zero exit code. Change-Id: I39ae087dd7bd08d049d513abfa6c5cab2bd13b2b Partial-Bug: #1556719
* | Merge "Fix i18n support for help and error msg in network"Jenkins2016-05-161-5/+5
|\ \
| * | Fix i18n support for help and error msg in networkTang Chen2016-05-161-5/+5
| | | | | | | | | Change-Id: Iab0dc489226601ac4ff123bb758f84ff16989395
* | | Merge "Add VLAN Transparent option to ``osc network``"Jenkins2016-05-161-4/+20
|\ \ \
| * | | Add VLAN Transparent option to ``osc network``reedip2016-05-161-4/+20
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | osc network set and network create now support --transparent-vlan|--no-transparent-vlan options to add/remove vlan transparency from the network. Change-Id: I845eb8f541cd32a4c4b28f929a63b205e7e31756 Closes-Bug: 1545537