summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/compute/v2
Commit message (Collapse)AuthorAgeFilesLines
...
* | compute: Add 'server volume list' commandStephen Finucane2021-01-082-0/+227
| | | | | | | | | | | | | | This replaces the old 'nova volume-attachments' command. Change-Id: Icb98766f98bd1f2469bdb6df62b4624711f98422 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | tests: Remove unused fake methodStephen Finucane2021-01-081-19/+0
|/ | | | | | | | | The FakeServerMigration.get_server_migrations method was added in change I15b4a5aca8d0dee59dd293e7b1c7272cdfbeea20 but has never been used. Remove it. Change-Id: I6089c5200737b9319a8e96f2a2fc18b7cdd6b2c6 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* compute: Add missing options for 'server image create'Stephen Finucane2021-01-081-0/+6
| | | | | | | | Add a '--property' option to record arbitrary key/value metadata to 'meta_data.json' on the metadata server. Change-Id: I267f3290fce3692cbd1ff6a9af146c2736ee31fe Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* compute: Add missing options for 'keypair list'Stephen Finucane2021-01-081-0/+68
| | | | | | | | | Add pagination parameters, '--limit' and '--marker'. This isn't compatible with our client-side '--project' parameter so we error out for that. Change-Id: I403cf0fb7aabad4a3dfda5adae62d47ecf7faf5c Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* compute: Add missing options for 'server set'Stephen Finucane2021-01-081-0/+32
| | | | | | | | | | | | | | Add a new '--no-password' option to unset the password on an existing server. In addition, add a new '--password' option that replaces the interactive '--root-password' option. This makes sense given no other commands uses interactive password options. Checks that rely on specific API microversions now run before we execute any action, to avoid situations where an update is only partially applied. Change-Id: Ibf8717efdd418a2d95215b4d9ab2acf0d57c4a70 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "compute: Add missing options for 'server list'"Zuul2021-01-081-2/+138
|\
| * compute: Add missing options for 'server list'Stephen Finucane2021-01-071-2/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | This accepts a large number of options that we weren't exposing. Add the following options: '--availability-zone', '--key-name', '--config-drive' and '--no-config-drive', '--progress', '--vm-state', '--task-state' and '--power-state'. In addition, refine the 'openstack server list --status' parameter to restrict users to the actual choices supported by the server. Change-Id: Ieeb1f22df7092e66a411b6a36eafb3e16efc2fc2 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | trivial: Use plural for appended parametersStephen Finucane2021-01-063-26/+26
| | | | | | | | | | | | | | | | | | Multiple compute commands take a '--property' parameter or variant thereof. These should be stored in a 'properties' (plural) dest for sanity's sake. Correct this. Change-Id: If393836925fa736404527d9abd212b8ac9931027 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | compute: Add 'server show --topology' optionYongli He2021-01-061-0/+49
| | | | | | | | | | | | | | | | Add support for compute microversion 2.78 by adding a '--topology' option to 'openstack server show' command that retrieves server NUMA information. Change-Id: Ie22979df2ea9082ca64a4d43b571bd4025684825
* | compute: Add 'server group create --rule' optionStephen Finucane2021-01-061-2/+29
| | | | | | | | | | | | | | This closes the remaining gap with the 2.64 compute API microversion. Change-Id: Ia42b23d813b7af6ddb1a41f4e9bdc8a6160b908c Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | compute: Fix 'hypervisor show -f yaml' outputStephen Finucane2021-01-061-5/+40
| | | | | | | | | | | | | | | | | | | | | | | | The 'cpu_info' field returned by the 'os-hypervisors' API is an object and should be formatted as such. However, this is complicated by the fact that the object in this field is stringified until microversion 2.28 and is only returned as an actual object on later microversions. Handle the conversion from the string for older microversions and display things correctly for all releases. Change-Id: Ide31466cbb9e89c96d6bd542fe039ab5ed1fac1f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | compute: Fix 'server group * -f yaml' outputStephen Finucane2021-01-061-23/+25
| | | | | | | | | | | | | | | | | | Make use of 'FormattableColumn'-derived formatters, which provide better output than what we were using before, particularly for the YAML output format. Change-Id: Id6d25a0a348596d5a0430ff7afbf87b049a76bc8 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | compute: Fix 'usage * -f yaml' outputStephen Finucane2021-01-061-20/+22
|/ | | | | | | | | Make use of 'FormattableColumn'-derived formatters, which provide better output than what we were using before, particularly for the YAML output format. Change-Id: Ic770f27cb1f74222636f05350f97400808adffbf Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* compute: Fix 'server * -f yaml' outputStephen Finucane2021-01-061-69/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of 'FormattableColumn'-derived formatters, which provide better output than what we were using before, particularly for the YAML output format. For example, compare before for the 'server show' command: $ openstack --os-compute-api-version 2.79 server show test-server -f yaml ... addresses: private=fdff:77e3:9bb4:0:f816:3eff:fe6d:a944, 10.0.0.44 flavor: disk='1', ephemeral='0', extra_specs.hw_rng:allowed='True', original_name='m1.tiny', ram='512', swap='0', vcpus='1' ... To after: $ openstack --os-compute-api-version 2.79 server show test-server -f yaml ... addresses: private: - fdff:77e3:9bb4:0:f816:3eff:fe6d:a944 - 10.0.0.44 flavor: disk: 1 ephemeral: 0 extra_specs: hw_rng:allowed: 'True' original_name: m1.tiny ram: 512 swap: 0 vcpus: 1 ... Similarly, compare before for 'server list': $ openstack --os-compute-api-version 2.79 server list -f yaml - ... Networks: private=fdff:77e3:9bb4:0:f816:3eff:fe6d:a944, 10.0.0.44 Power State: Running Properties: '' ... To after: $ openstack --os-compute-api-version 2.79 server list -f yaml - ... Networks: private: - fdff:77e3:9bb4:0:f816:3eff:fe6d:a944 - 10.0.0.44 Power State: 1 Properties: {} ... We also fix the human-readable output for the 'tags' field. Before: $ openstack --os-compute-api-version 2.79 server list ... | tags | ['bar', 'foo'] | After: $ openstack --os-compute-api-version 2.79 server list ... | tags | bar, foo | Change-Id: I7a8349106e211c57c4577b75326b39b88bd9ac1e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "compute: Add missing options for 'server rebuild'"Zuul2021-01-061-68/+290
|\
| * compute: Add missing options for 'server rebuild'Stephen Finucane2020-12-091-68/+290
| | | | | | | | | | | | | | | | | | | | | | This accepts a large number of options that we weren't exposing. Add the following options: '--name', '--preserve-ephemeral', '--user-data', '--no-user-data', '--trusted-image-cert' and '--no-trusted-image-certs'. In addition, rename the '--key-unset' parameter to '--no-key-name', to mimic e.g. '--no-property' on other commands. Change-Id: I61c46e18bef1f086b62a015ebdc56be91071b826 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "Add 'flavor list --min-disk', '--min-ram' options"Zuul2021-01-061-0/+31
|\ \
| * | Add 'flavor list --min-disk', '--min-ram' optionsStephen Finucane2020-12-091-0/+31
| |/ | | | | | | | | | | | | | | Allow us to filter on minimum disk and RAM, and close another gap with novaclient. Change-Id: Ib3f0bdf419675e1c35c3406fbac8a4c18ac56a33 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "Add option to filter instances by AZ"Zuul2020-12-221-0/+1
|\ \
| * | Add option to filter instances by AZDmitriy Rabotyagov2020-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Since nova API microversion 2.83 it is possible for users to filter instances by AZ. However even before that this functionality was available for admin role. Change-Id: Ife4c8e81aad2ff1dde50d9f23913d9dd9397b00c
* | | Make use of comparable 'FormattableColumn' subclassesStephen Finucane2020-12-094-22/+22
| |/ |/| | | | | | | | | | | | | | | | | | | | | This requires fixes found in cliff 3.5.0 [1] and osc-lib 2.3.0 [2]. With these fixes in place, we can remove the icky, still broken 'assertItemEqual' and 'assertListItemEqual' helpers. [1] https://review.opendev.org/761421 [2] https://review.opendev.org/761394 Change-Id: Id6c26b37c3c7d5ec6761361abca57f9219b76838 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Switch compute aggregate functions to SDKArtem Goncharov2020-12-021-85/+172
| | | | | | | | | | | | | | Continue journey towards having OSC consuming SDK for nova part. Depends-On: https://review.opendev.org/#/c/762131/ Change-Id: Id16e6c47aa93f02f15f49e1f59f73fecaa3e3b80
* | Switch compute flavors from novaclient/direct to SDKArtem Goncharov2020-12-022-215/+307
|/ | | | | | | | | | | Let's switch flavors from novaclient or direct API requests onto using SDK. Microversion agreement comes out of the box. SDK normalizes property names, while OSC uses server side names. In order not to break OSC users continue using server-side names. Depends-On: https://review.opendev.org/#/c/762989/ Change-Id: I62b2ed8488ee4ac9c42051311bcfb455506ddd90
* Merge "Add a few selectable fields to the "openstack server list" output"Zuul2020-11-181-0/+19
|\
| * Add a few selectable fields to the "openstack server list" outputjay2020-11-051-0/+19
| | | | | | | | | | | | | | | | Added ``-c project_id | user_id | created_at`` to ``openstack server list`` command to get these columns as an output. Change-Id: I18991adf899c7b72c98bb89871bf0715d35943f0 Story: 2007925
* | Merge "Switch 'openstack keypair' ops to use SDK"Zuul2020-11-171-108/+77
|\ \
| * | Switch 'openstack keypair' ops to use SDKArtem Goncharov2020-11-091-108/+77
| | | | | | | | | | | | | | | | | | | | | | | | Let's continue our journey and start using SDK for the keypair operations Depends-On: https://review.opendev.org/#/c/761883/ Change-Id: Id411e70b8e1a79c0e88a0e22be7ff37e5c30fcda
* | | Merge "Resolve issues with 'server migration list'"Zuul2020-11-121-9/+3
|\ \ \
| * | | Resolve issues with 'server migration list'Stephen Finucane2020-11-091-9/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'os-migrations' API accepts 'instance_uuid' and 'migration_type' query string parameters, not 'server' and 'type'. For the former, as the name would suggest, the value should be a server UUID, not a name. In addition, this is a list command and therefore should subclass the 'Lister' base class. Change-Id: I736f5575156fc04d7ada7783a1865ab3b438396f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Merge "Add 'openstack server evacuate' command"Zuul2020-11-091-0/+161
|\ \ \ | |/ / |/| |
| * | Add 'openstack server evacuate' commandSean Mooney2020-11-021-0/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a new 'openstack server evacuate' command to provide parity with the 'nova evacuate' command. The term "evacuate" is notoriously poor, in that it implies the instance is moved rather than recreated, but it is retained since people are familiar with it now. Change-Id: I1e32ca51036c501862d8e89b3144a9695d98a06f
* | | Merge "Compute: Add user id support for keypair"Zuul2020-11-041-1/+162
|\ \ \
| * | | Compute: Add user id support for keypairHe Jie Xu2020-11-021-9/+162
| |/ / | | | | | | | | | | | | | | | | | | | | | This patch adds functionality of specific the user id when create, delete, show and list keypairs. Change-Id: Ib826f1f4f5a73d1875ba0f02e124b3222c4d05ed Co-Authored-By: tianhui <tianhui@awcloud.com>
* | | Merge "Add 'openstack server migration list --type' option"Zuul2020-11-031-0/+2
|\ \ \
| * | | Add 'openstack server migration list --type' optionStephen Finucane2020-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Another gap with novaclient closed. Change-Id: Id3ca95ceda6f438fa72496ab9ab15ac09bb64fa5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "Fix formatting of the flavor properties"Zuul2020-11-031-13/+13
|\ \ \ \
| * | | | Fix formatting of the flavor propertiesArtem Goncharov2020-11-021-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not stringify flavor properties to allow proper output formatting to json/yaml/etc Change-Id: I9f4c42acb85b726af87123134dd19de98fe95074
* | | | | Merge "Add support for 'keypairs list --project' parameter"Zuul2020-11-021-9/+86
|\ \ \ \ \
| * | | | | Add support for 'keypairs list --project' parameterStephen Finucane2020-10-141-9/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It would be lovely to do this server side but doing so requires a new microversion, a blueprint and a spec. This is less performant but should do the trick for the odd time users want to do this. Change-Id: I26e7d38966304dd67be5da8ed0bb24f87191b82f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | Merge "Switch console url show operations to SDK"Zuul2020-11-021-55/+31
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | |
| * | | | | Switch console url show operations to SDKArtem Goncharov2020-10-241-55/+31
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch from using novaclient to SDK for openstack console url show operation. Depends-On: https://review.opendev.org/756286 Change-Id: Ibe247825148788c549c2c1e991aae92338cdf557
* | | | | Merge "Add support for 'keypairs list --user' parameter"Zuul2020-11-021-2/+64
|\ \ \ \ \ | |/ / / / |/| / / / | |/ / /
| * | | Add support for 'keypairs list --user' parameterStephen Finucane2020-10-141-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has been supported by nova and novaclient since the veritable dark ages. Add it to OSC. Change-Id: Ifc95e7dd6c00807c80e87e10046ab154d0989014 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "Validate 'server group create --policy' option"Zuul2020-10-211-0/+43
|\ \ \ \
| * | | | Validate 'server group create --policy' optionStephen Finucane2020-10-131-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were documenting that some of these policies were only supported with specific microversions, however, we weren't actually enforcing that, leading to a poor user experience. Correct this. Change-Id: Ic3c555226a220efd9b0f27edffccf6c4c95c2747 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | Merge "Cleanup of 'server migration list' command"Zuul2020-10-211-83/+102
|\ \ \ \ \ | | |_|/ / | |/| | |
| * | | | Cleanup of 'server migration list' commandStephen Finucane2020-10-131-83/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address some post merge nits. Change-Id: Ie59521d81fab191194f6c1a114b007fa17f5299f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | Merge "Switch openstack console log show operation to use OpenStackSDK"Zuul2020-10-211-0/+79
|\ \ \ \ \
| * | | | | Switch openstack console log show operation to use OpenStackSDKArtem Goncharov2020-10-061-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A short switch onto SDK for fetching console logs of the server Change-Id: I3f750ea4f13a4e72272aa67ea4506bd7182b13f9
* | | | | | Merge "Compute: Add tag support for server add fixed ip"Zuul2020-10-151-0/+66
|\ \ \ \ \ \