summaryrefslogtreecommitdiff
path: root/openstackclient/compute/v2
Commit message (Collapse)AuthorAgeFilesLines
* Handle multiple ports in AddFloatingIPqueens-em3.14.3melanie witt2018-11-081-7/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AddFloatingIP refers to an old nova proxy API to neutron that was deprecated in nova. The neutron API for floating IP associate requires a port to be specified. Currently, the code is selecting the first port if the server has multiple ports. But, an attempt to associate the first port with a floating IP can fail if the first port is not on a network that is attached to an external gateway. In order to make the command work better for users who have a server with multiple ports, we can: 1. Select the port corresponding to the fixed_ip_address, if one was specified 2. Try to associate the floating IP with each port until one of the attempts succeeds, else re-raise the last exception. (404 ExternalGatewayForFloatingIPNotFound from neutron) This also fixes incorrect FakeFloatingIP attributes that were being set in the TestServerAddFloatingIPNetwork unit tests, which were causing the tests to use None as parsed args for ip-address and --fixed-ip-address and thus bypassing code in the 'if parsed_args.fixed_ip_address:' block. Task: 27800 Story: 2004263 Change-Id: I11fbcebf6b00f12a030b000c84dcf1d6b5e86250 (cherry picked from commit 013c9a4f3a44cb0b81fc7affe9b933e701cb5dba) (cherry picked from commit e09c358e7b35ac938595aad90c5c42dfe402a42a)
* Default --nic to 'auto' if creating a server with >= 2.37Matt Riedemann2018-10-251-3/+8
| | | | | | | | | | | | | | | | Compute API version >= 2.37 requires a 'networks' value in the server create request. The novaclient CLI defaults this to 'auto' if not specified, but the novaclient ServerManager.create python API binding code does not, as it wants clients to be explicit. For the purposes of the OSC CLI, we should follow suit and if the user is requesting OS_COMPUTE_API_VERSION>=2.37 without specific nics, we should just default to 'auto'. Change-Id: Ib760c55e31209223338a4086ff1f4fee88dc6959 Closes-Bug: #1750395 (cherry picked from commit 1008544882fbdae16b045abca05cf3e2e8a14787) (cherry picked from commit 4944d4eaa9aaeffdee358680550ac7d7f0c6e8d8)
* Don't sent disk_over_commit if nova api > 2.24Artom Lifshitz2018-10-251-5/+8
| | | | | | | | | | | In API microversion 2.25 Nova removed the disk_over_commit parameter to the live migration server action. This patch makes sure that we don't include it in our request if we're running with 2.25 or higher. Story: #2002963 Task: #22966 Change-Id: I1bbdd33be96d82422a05982508e370237c3560f3 (cherry picked from commit d6121782d3aa6a95b883220b27a154e641b61f7f)
* Prevent "server migrate --wait" from hangingJulie Pichon2018-06-051-0/+1
| | | | | | | | | | | | | | Migrate uses the same mechanism in the backend than Resize and so the steps and step names are similar. Currently when using the --wait option with 'migrate', we wait forever because the status won't get to active until the user performs an action. This makes it return on verify_resize status just like 'resize' does, so that the user can perform the next manual step. Change-Id: Ie1aeac52506bc8801f88fd6a6eb4f6094cf20050 Story: 2001994 Task: 19620 (cherry picked from commit de9a6fc0700d821f9fca6bf347407eccd87f0064)
* Re-implement novaclient bits removed in 10.03.14.2Dean Troyer2018-04-202-28/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a) /os-floating-ips was removed in Compute API 2.36 and from novaclient's Python API in 10.0 Add to api.computev2: floating_ip_add() floating_ip_remove() Convert add floating IP command to nova-net/neutron split: "server add floating ip" "server remove floating ip" b) /os-hosts was removed in Compute API 2.43 and from novaclient's Python API in 10.0. Add to api.computev2: host_list() host_set() host_show() Convert host commands to use intenal api: "host list" "host set" "host show" c) The introduction of the Network-style commands into the server group broke cliff's autoprogram directive as it executes the get_parser() methods without fully initializing the Command object. NOTE: This is really three reviews squashed to get through the gate in one pass. Closes-Bug: #1745795 Change-Id: I5116086f9a9e4b2b31a744bf8f4558c79f0bfe59 (cherry picked from commit 53e7aab7ed4d6c981ca067c1db8bce290a5f0055)
* Corrected spelling mistakeDavid Rabel2018-01-191-1/+1
| | | | | | in quotas -> in quotes Change-Id: I3adb1ccd8f3a9c495f0b9cf688aee5c4c1e63507
* flavor: clarify --swap descriptionChen Hanxiao2017-12-281-1/+1
| | | | | | | | | | --swap will add a additional storage device, which not affect the original swap partition/device. This patch will clarify this misleading description. Change-Id: Ic079c069985d39cc969b97876901007a81883f57 Signed-off-by: Chen Hanxiao <chenhx@certusnet.com.cn>
* Merge "Send 'changes-since' instead of 'changes_since' query parameter"3.13.0Zuul2017-12-131-6/+7
|\
| * Send 'changes-since' instead of 'changes_since' query parameterDaniel Speichert2017-12-111-6/+7
| | | | | | | | | | | | | | | | | | | | Per API reference, only 'changes-since' is accepted and the variant with underscore is ignored, making the CLI functionality broken. [dtroyer] added release note and fixed unit tests. Change-Id: I0c596531a8af03da17d5ce39d75b12e941403aa5 Closes-Bug: 1732216
* | Remove hard-coded policy choices for creating a server groupMatt Riedemann2017-11-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | The hard-coded choices for the server group policy make it impossible to create a server group with the soft-affinity or soft-anti-affinity policy rules which were added in compute API microversion 2.15. This removes the hard-coded choices so that the policy is restricted on the server side rather than the client side. Change-Id: Ib3dc39422ac1015872d56ae2fdeddf0f29613494 Closes-Bug: #1732938
* | Add RemoveNetwork command to serverHongbin Lu2017-11-141-0/+35
|/ | | | | | | This command will detach a server from a network. All server's neutron ports that belongs to the specified networks will be removed. Change-Id: I83a064ed62ab00c6f1016900b9cf30f1c15b8382
* Merge "Added AddNetwork command to server"Zuul2017-10-301-0/+33
|\
| * Added AddNetwork command to serverHongbin Lu2017-10-261-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if users want to add another NIC to a running instance, they need to (i) create a neutron port and (ii) add the port to the server via teh AddPort command. It would be more convenient to have a single command to achieve the equivalent. Novaclient already support adding network to an instance via the interface-attach command. This patch introduces a similar capability in OSC. Change-Id: Ia3e39c57ae7ecb96aae1b66adc52c289daccb6ec
* | Add missing parameters on openstack server rescueJose Castro Leon2017-10-271-5/+24
|/ | | | | Change-Id: I27afca9e826378dbcb7feb7528e0c65c528b04b0 Closes-Bug: #1703278
* Use flake8-import-order pluginAkihiro Motoki2017-08-171-1/+1
| | | | | | | | | | | | | | | | In reviews we usually check import grouping but it is boring. By using flake8-import-order plugin, we can avoid this. It enforces loose checking so it sounds good to use it. This flake8 plugin is already used in tempest. Note that flake8-import-order version is pinned to avoid unexpected breakage of pep8 job. Setup for unit tests of hacking rules is tweaked to disable flake8-import-order checks. This extension assumes an actual file exists and causes hacking rule unit tests. Change-Id: I12b596820727aeeb379bee16c2bc993dee9eb637
* Merge "Start using 'cliff.sphinxext'"Jenkins2017-07-211-9/+23
|\
| * Start using 'cliff.sphinxext'Stephen Finucane2017-07-211-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 'cliff', the command line library used by 'osc_lib' (and, thus, 'python-openstackclient') recently gained a Sphinx extension to automatically document cliff commands. This allows us to use the documentation we already have in code instead of duplicating it in the documentation. Introduce the use of this, starting with the 'server' commands. This requires extending the descriptions for two commands to ensure no information is lost. Change-Id: If701af8d5a3f78f4b173ceb476dd0c163be4b6ca
* | Merge "Now OSC server create check keys in --nic"Jenkins2017-07-201-6/+10
|\ \ | |/ |/|
| * Now OSC server create check keys in --nicM V P Nitesh2017-06-231-6/+10
| | | | | | | | | | | | | | | | Now OSC command to create server will check all the keys in --nic and throws an exception if the key is invalid key. Change-Id: I5482da0ae63d6d4298aa614e4d09bb0547da9ec3 Closes-Bug: #1681411
* | Fix column names for server list --no-name-lookupDean Troyer2017-07-171-14/+21
| | | | | | | | | | | | | | | | When --long is not present change the 'Image Name' column to 'Image' and add the 'Flavor' column. These columns will contain Names unless --no-name-lookup is specified when they will contain IDs. Change-Id: I92cfb22136aee32616894e60e9227b4da185da99
* | Add server list -n and --no-name-lookup argumentsBoris Pavlovic2017-07-101-16/+29
|/ | | | | | | | | | | | | | Remove translation of Image ID and Flavor ID to Image and Flavor names In large environments amount of images can be very large (thousands) Which requires ~hundreds of requests to Glance to get all images (by default client request only 20 images) As a result listing even few servers is going to take minutes This patch allows to avoid these queries by not doing translation, which allows one to get information about servers in seconds. Change-Id: I4ae00e6324a41c4c79bf5b620179dae99aea5431
* Merge "Create server with security group ID and name"Jenkins2017-05-221-2/+18
|\
| * Create server with security group ID and nameRui Chen2017-05-221-2/+18
| | | | | | | | | | | | | | | | | | | | | | Both resource ID and name are supported to identify an object in openstackclient to make user easy to input, for security group, nova only support security group name in API when launch a new server, this patch convert ID to name, then pass name to nova API, and check the security group exist before creating server. Change-Id: I1ed4a967fb9de3f91c8945a1ef63f6c7b6b2dfb2 Closes-Bug: #1687814
* | Make block-device-mapping more stable and clearRui Chen2017-05-171-30/+48
|/ | | | | | | | | | | | | | | | | | | | | | The patch fix the following issues: 1. ValueError is raised if input don't contain "=". Sometimes the whole "server create" command is very complex, it's difficult to find out root reason directly. 2. Don't support to add block device from snapshot, like: --block-device-mapping vdb=0c8ae9d8-cadc-4a23-8337-4254614d277e:snapshot:1, it's supported by novaclient, but not in osc. 3. If input "vdb=", not add any mapping information, the server will be launched successfully, not raise error message to let use add volume/snapshot id, just ignore "--block-device-mapping" option. 4. The help message of "block-device-mapping" option is so simple, need to add some details about how to add <type>, <delete_on_terminate> contains. Change-Id: Ib7f7a654c3dc2a8272545f168b4c4ced230ce39e Depends-On: Ib37913891bbf7a31b570404c4668c490d5ac859b Closes-Bug: #1667266
* Fix server create with nova-netDean Troyer2017-04-261-3/+2
| | | | | | A Neutron-ism slipped by in server create. Change-Id: Id590d7f93df2a41d7bd7617459a2af159a6f8071
* Merge "Add --network and --port to server create"Jenkins2017-04-251-3/+37
|\
| * Add --network and --port to server createDavid Rabel2017-04-071-3/+37
| | | | | | | | | | | | | | | | | | --nic option is quite unhandy. It is better to have two seperate options --network and --port to add a network to a new server. Change-Id: I523abdc83ca2dd4c5dd3871f8f109c2bf57c2e02 Closes-Bug: #1612898
* | Low-level Compute v2 API: networkDean Troyer2017-04-171-4/+6
| | | | | | | | | | | | | | | | | | | | 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
* | Low-level Compute v2 API: security groupDean Troyer2017-04-111-11/+5
| | | | | | | | | | | | | | | | | | | | api.compute.APIv2 starts with security group 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: Id007535f0598226a8202716232313e37fe6247f9
* | Enable to specify which fixed-ip to add to a vm.Cedric Brandily2017-04-041-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enables to specify which fixed-ip will be added to a vm using: openstack server add fixed ip <vm> <network> --fixed-ip-address <ip> This change uses interface_attach instead of add_fixed_ip[1] which is less flexible and uses a deprecated API. [1] https://review.openstack.org/384261 Closes-Bug: #1678140 Change-Id: I7fe4621439ef0d8dca080551ffaeb614c5a91174
* | Merge "Help/docs cleanups: marker, limit, ip-address metavars"Jenkins2017-04-042-25/+24
|\ \
| * | Help/docs cleanups: marker, limit, ip-address metavarsDean Troyer2017-04-042-25/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup help strings and docs for clarity and to keep things consistent: * --limit metavar should be <num-resource> to indicate what is being counted * --marker metavar should be <resource> or <resource-id> to indicate the type of value being specified * <*-ip-address> metavars should be just <ip-address> as there is no difference in format between fixed and floating IPs * Move all occurances of '(name or ID)' to end of help text Change-Id: I2c31746ed6ded3845244e03e57d809f8bc0e6b9d
* | | Merge "Enable to add/remove port to/from a server"Jenkins2017-04-031-0/+66
|\ \ \
| * | | Enable to add/remove port to/from a serverCedric Brandily2017-04-031-0/+66
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enables to add/remove a specific port to/from a server using the new commands: openstack server add port <vm> <port> openstack server remove port <vm> <port> Closes-Bug: #1678137 Change-Id: I6ee57df089235ccc1fb9d38316bd484956b1134d
* | | Merge "Fix block-device-mapping when volume_size is empty"Jenkins2017-04-031-1/+1
|\ \ \ | |/ / |/| |
| * | Fix block-device-mapping when volume_size is emptyJens Rosenboom2017-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Nova API responds with an validation error when a bdm is submitted containing an empty volume_size. So instead omit that attribute when it is empty. Change-Id: Iba905fca8c440a03e828c20922f3b813bba3fa3a Closes-Bug: 1677236
* | | Remove log translationsyfzhao2017-03-211-3/+2
|/ / | | | | | | | | | | | | | | | | Log messages are no longer being translated. This removes all use of the _LE, _LI, and _LW translation markers to simplify logging and to avoid confusion with new contributions. Change-Id: I504de69b2e64250740ebcab432042a16f966fdbe Closes-Bug: #1674584
* | Merge "Enable to specify which vm fixed-ip to publish"Jenkins2017-03-211-1/+8
|\ \
| * | Enable to specify which vm fixed-ip to publishCedric Brandily2017-03-201-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enables to specify which vm fixed-ip will be associated to a floating ip using: openstack server add floating ip <vm> <fip> --fixed-ip-address <ip> Closes-Bug: #1624524 Change-Id: I2ddb68c5873bfed7293b0e661d1adbe111681136
* | | Merge "Adds missing flavor information in the server list long command"Jenkins2017-03-201-2/+25
|\ \ \
| * | | Adds missing flavor information in the server list long commandJose Castro Leon2017-03-131-2/+25
| | |/ | |/| | | | | | | | | | | | | Closes-Bug: #1672396 Change-Id: Ie2a664fd1c3db1b8269ea079df181f87afc702a7
* | | Merge "Add a validation about options for server migrate command"Jenkins2017-03-161-0/+4
|\ \ \ | |/ / |/| |
| * | Add a validation about options for server migrate commandRikimaru Honjo2017-03-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behavior of server migrate command are different depending on whether user specify --live option or not. server migrate command will call live migration API if user specify --live option. Ohterwise server migrate command will call migration(cold migration) API. Now then, "--block-migraiton" option and "--disk-overcommit" option only affect live-migration. But, openstackclient doesn't warn user if user specify these options without "--live". But, user can't recognize that specifying options are ignored. This patch adds a validation that checks whether or not user specify these options without "--live". Change-Id: Ifa278abb23ecdba4b13f3742998359ac74eb7ad4 Closes-bug: #1662755
* | | Merge "Add "--private-key" option for "keypair create""Jenkins2017-03-081-3/+28
|\ \ \
| * | | Add "--private-key" option for "keypair create"Rui Chen2017-03-061-3/+28
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Aim to specify the private key file to save when keypair is created. That is a convenient way to save private key in OSC interactive mode, avoid to copy CLI output, then paste it into file. Change-Id: I119d2f2a3323d17ecbe3de4e27f35e1ceef6e0a5 Closes-Bug: #1549410
* | | Add server event list and show commandsRui Chen2017-03-071-0/+117
|/ / | | | | | | | | | | | | | | | | | | | | | | OSC server event is similar to nova's instance action commands. Server event is the event record that had been done on a server, include: event type(create, delete, reboot and so on), event result(success, error), start time, finish time and so on. These are important information for server maintains. Change-Id: I8111091f46a0d2755728d8f9d43cc0dfe8842d13 Closes-Bug: #1642030
* | Merge "Use public and unified method get_console_url()"Jenkins2017-02-201-12/+1
|\ \ | |/ |/|
| * Use public and unified method get_console_url()huangtianhua2017-02-141-12/+1
| | | | | | | | | | | | | | | | | | | | Novaclient has provided a public and unified method get_console_url() to get console urls of server. This change switches to use it. Change-Id: Ie6b9d8cfc57a6943b5d64a4064e4bdd372cd8cd3 Depends-on: I36c6209b17ef453e1c2e47841daf41f81af471dc Closes-Bug: #1654913
* | Fix "server create" command failed when --nic auto or noneRui Chen2017-02-151-8/+28
|/ | | | | | | | | | | "auto" and "none" options was added into --nic argument of server create command in patch https://review.openstack.org/#/c/412698/ , but that don't work and raise internal error when execute command. The patch fix that issue and add unit and functional tests. Change-Id: Ia718c3bac0a5172a0cdbe9f0d97972a9346c1172 Co-Authored-By: Kevin_Zheng <zhengzhenyu@huawei.com> Closes-Bug: #1663520
* Merge "Handle log message interpolation by the logger in compute/"Jenkins2017-02-144-10/+7
|\