summaryrefslogtreecommitdiff
path: root/openstackclient
Commit message (Collapse)AuthorAgeFilesLines
* trivial: Use plural for appended parametersStephen Finucane2021-01-066-76/+78
| | | | | | | | | 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-062-9/+86
| | | | | | | | 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-062-23/+78
| | | | | | | 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-062-8/+61
| | | | | | | | | | | | 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-063-40/+47
| | | | | | | | | 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-062-44/+101
| | | | | | | | | 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-063-115/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "trivial: Cleanup docs for 'server list'"Zuul2021-01-061-57/+85
|\
| * trivial: Cleanup docs for 'server list'Stephen Finucane2020-12-091-57/+85
| | | | | | | | | | Change-Id: I2f2033a8d49ee42eb21696a9cd28e63ad9712fad Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "compute: Add missing options for 'server rebuild'"Zuul2021-01-062-74/+433
|\ \ | |/
| * compute: Add missing options for 'server rebuild'Stephen Finucane2020-12-092-74/+433
| | | | | | | | | | | | | | | | | | | | | | 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-062-7/+67
|\ \
| * | Add 'flavor list --min-disk', '--min-ram' optionsStephen Finucane2020-12-092-7/+67
| |/ | | | | | | | | | | | | | | 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 "image: Unset properties rather than setting to None"Zuul2021-01-063-17/+16
|\ \
| * | image: Unset properties rather than setting to NoneStephen Finucane2020-12-223-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we attempt to unset an image property by setting it to None. This doesn't work for known properties and is rightly rejected by the Glance API with the following error: BadRequestException: 400: Client Error for url: http://172.20.4.87/image/v2/images/368c5751-2b0b-4a38-a255-fd146fe52d31, Bad Request The solution is to actually unset the field by deleting it. Change-Id: Ie156bedbe0f9244f82c81401679706f484caf9aa Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: #2008463 Task: #41493
* | | Add support '--progress' option for 'image create'youngho choi2021-01-043-0/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | openstack-client doesn’t support the upload progress bar. This patch shows progressbar when create image if you added '--progress' option like a python-glanceclient. like this. [=============================>] 100% +------------------+---------------------------+ | Field | Value | +------------------+---------------------------+ | container_format | bare | | created_at | 2020-09-06T20:44:40Z | ... How to use Add the'--progress' option on the 'openstack image create' command. Code was written by referring to 'python-glanceclient' project on stable/ussuri branch Change-Id: Ic3035b49da10b6555066eee607a14a5b73797c00 task: 40003 story: 2007777
* | | Merge "Add project field in image list subcommand"Zuul2020-12-222-0/+30
|\ \ \
| * | | Add project field in image list subcommandokozachenko2020-12-152-0/+30
| |/ / | | | | | | | | | | | | | | | The motivation is to filter the image by owner Change-Id: I1f08da175a06e62a844f76b0ec18cb3332efef86
* | | Merge "Add name and enabled param in ListDomain parser"Zuul2020-12-222-1/+77
|\ \ \
| * | | Add name and enabled param in ListDomain parserVishakha Agarwal2020-07-212-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when doing openstack domain list --name xyz_id, and openstack domain list --enabled CLI raising error unrecognized arguments, whereas in api-ref document [1], user can pass name and enabled as optional query param. This addresses the above issue, by adding param --name and --enabled in parser of ListDomain. [1]https://docs.openstack.org/api-ref/identity/v3/?expanded=list-domains-detail#list-domains Change-Id: I3cdb511d3c7059ddfb802ca025188d8976c9302c
* | | | Merge "Add option to filter instances by AZ"Zuul2020-12-222-0/+9
|\ \ \ \ | |_|/ / |/| | |
| * | | Add option to filter instances by AZDmitriy Rabotyagov2020-12-012-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0931-302/+291
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge "trivial: Cleanup docs for 'server rebuild'"Zuul2020-12-051-29/+52
|\ \ \
| * | | trivial: Cleanup docs for 'server rebuild'Stephen Finucane2020-12-031-29/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use consistent help strings and error messages. Change-Id: I42647a6b7e67ce4b8dd5f826e20802ade691c266 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Switch compute aggregate functions to SDKArtem Goncharov2020-12-022-212/+308
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-023-337/+447
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "stop image downloads to memory"Zuul2020-12-023-3/+12
|\ \ \
| * | | stop image downloads to memorySimon Merrick2020-11-253-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + Fixes issue with large images hogging memory + stream image downloads + output to stdout if file not specified Change-Id: Ia01ff9b21a2dac5d0ccf2bd58a8640e88c5cbb36 Story: 2007672 Task: 39776
* | | | Merge "Add NODE and HOST parameters in "server create" help text"Zuul2020-12-011-1/+6
|\ \ \ \
| * | | | Add NODE and HOST parameters in "server create" help textyanpuqing2020-12-011-1/+6
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add optional parameters "NODE" and "HOST" in the help text of the server create comand for --availability-zone. Co-Authored-By: tianhui <tianhui@awcloud.com> Change-Id: I4faea8a3d3aecb21ec535e55c238c71745fc68cb Task: 24274 Story: 2003313
* | | | Merge "Remove None valued network quota entries"Zuul2020-12-012-4/+32
|\ \ \ \
| * | | | Remove None valued network quota entriesasarfaty2020-09-222-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the openstack SDK still has the neutron-lbaas entries in the network quota, but those are already deprecated [1], the 'opentack quota show' command shows those as None value. This fix removes those empty deprecated values from the output. [1] https://review.opendev.org/#/c/658494/ Change-Id: I8dbdba2a029ea8e6a268ddf29627e1466a7e3a8a
* | | | | Merge "Add id and enabled param in ListIdentityProvider parser"Zuul2020-12-012-1/+78
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Add id and enabled param in ListIdentityProvider parserVishakha Agarwal2020-07-242-1/+78
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when doing openstack identity provider list --name xyz_id, and openstack identity provider list --enabled CLI raising error unrecognized arguments, whereas in api-ref document [1], user can pass name and enabled as optional query param. This addresses the above issue, by adding param --id and --enabled in parser of ListIdentityProvider. [1] https://docs.openstack.org/api-ref/identity/v3-ext/?expanded=list-identity-providers-detail#list-identity-providers Change-Id: I59ce3a5f54700ba5a735f0b3b4b3b73b3a8658fa
* | | | Add "fields" parameter to ListPort queryRodolfo Alonso Hernandez2020-11-182-20/+56
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new query parameter will allow to send a query to the Neutron server filtering only by those parameters needed by the list command: ID, name, MAC address, fixed IPs and status. When using input parameter "long", security groups IDs, device owner and tags will be added to the fields filter. With 4500 ports, those are the execution times for the command "openstack port list" (average values in a development environment): Neutron API (seconds) CLI (seconds) Without filter: 3.05 10.15 With filter: 2.76 8.19 Depends-On: https://review.opendev.org/#/c/754113/ Change-Id: I1cccf0bc3533f8085e8dd61bf2fbe78c49b74b31 Closes-Bug: #1897100
* | | Merge "Add a few selectable fields to the "openstack server list" output"Zuul2020-11-182-0/+40
|\ \ \
| * | | Add a few selectable fields to the "openstack server list" outputjay2020-11-052-0/+40
| |/ / | | | | | | | | | | | | | | | | | | | | | 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 "trivial: Document removal of support for agents"Zuul2020-11-181-4/+24
|\ \ \
| * | | trivial: Document removal of support for agentsStephen Finucane2020-11-171-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't remove these commands for a long time, given OSC's intention to support multiple releases of OpenStack, but we can at least indicate to users that this thing might not work anymore. Change-Id: I9093cc1197a0287984d83e2020fba100d0c958b3 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "Switch 'openstack keypair' ops to use SDK"Zuul2020-11-172-146/+125
|\ \ \ \
| * | | | Switch 'openstack keypair' ops to use SDKArtem Goncharov2020-11-092-146/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "Allow to resize in-use volumes"Zuul2020-11-172-6/+15
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Allow to resize in-use volumesDmitriy Rabotyagov2020-11-112-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Pike (microversion 3.42) [1] Cinder API allows to resize in-use volumes. So no reason not to implement it in CLI. [1] https://opendev.org/openstack/cinder/src/branch/master/cinder/api/openstack/rest_api_version_history.rst#user-content-section-39 Change-Id: I22462a56d261e0a100aac3f27af7be47223edec0
* | | | | Merge "tests: Remove 'agent' functional tests"Zuul2020-11-162-197/+1
|\ \ \ \ \
| * | | | | tests: Remove 'agent' functional testsStephen Finucane2020-11-162-197/+1
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'os-agents' API was recently removed from nova [1]. Remove the functional tests, since they will always fail going forward but will continue to run on older stable branches. Also Squeeze https://review.opendev.org/#/c/762559/ inside, since those 2 are simultaneously blocking gate [1] https://review.opendev.org/#/c/749309/ Change-Id: I0bf7d4c0ba2a9d4637db0d209d8d52163d772f12 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | Merge "Resolve issues with 'server migration list'"Zuul2020-11-122-12/+11
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Resolve issues with 'server migration list'Stephen Finucane2020-11-092-12/+11
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "functional: Remove test for 'quota set --force'"Zuul2020-11-091-44/+0
|\ \ \ \
| * | | | functional: Remove test for 'quota set --force'Stephen Finucane2020-11-061-44/+0
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change I1d1ac1ac46f49f64794ffc8631e166935537966c introduced the 'quota set --force' parameter to force set nova quotas. As part of that fix, we introduced a functional test, 'QuotaTests.test_quota_set_force' that works by attempting to set the 'limit' of the quota for instances to the current usage ('is_use') minus one. This test is flawed. It doesn't create any instances so when it fires by itself, it will always set the 'limit' to 0. When it fires at the same time as other tests (remember, we run tests in parallel), notably tests that rely on booting instances, it can cause other tests to fail with the following error: Quota exceeded for instances: Requested 1, but already used 0 of 0 instances (HTTP 403) We could attempt to work around this by creating a new project and using that project to fiddle with quotas. That's a lot of work though, and the returns are questionable: the 'quota set' command is an admin-only command by default and the '--force' parameter should almost never be used. Simply remove this test. Change-Id: Ic07ff6f4a7c1c27852c892eb906bb144aae91788 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: #2008327 Task: #41225