summaryrefslogtreecommitdiff
path: root/openstackclient
Commit message (Collapse)AuthorAgeFilesLines
* compute: Require image when rebuilding a volume-backed server5.6.1whoami-rajat2022-09-302-3/+30
| | | | | | | | | | | | | | | | A volume-backed server will have no image attribute (or rather the image property will be set to the empty string). As such, if you want to try rebuild you will need to specify an image [*]. Enforce this. [*] Before microversion 2.93, this must be the same image. However, we don't touch on that here. This will be addressed later. Change-Id: I6842dabd7acb4e3a78f894e55e616625757eb6a4 Story: 2010297 Task: 46290 (cherry picked from commit 1f63034441a63b968185e1678049c01205b8e6d7) (cherry picked from commit 0118d57c027c630f726dba4659c1e554ba833405) (cherry picked from commit 53d8667b4bdd749177f39473674a917c0ad5df22)
* Merge "compute: Show flavor in 'server list' with API >= 2.47" into stable/xenaZuul2022-07-052-260/+340
|\
| * compute: Show flavor in 'server list' with API >= 2.47Khomesh Thakre2021-12-012-260/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the issue where the flavor name was empty in server list output. This requires somewhat invasive unit test changes to reflect the changed API response from the server, but this has the upside of meaning we don't need new tests since what we have validates things. Also drop the flavor ID column as it is removed from the compute API. Change-Id: Ica3320242a38901c1180b2b29109c9474366fde0 Signed-off-by: Khomesh Thakre <khomeshthakre24@gmail.com> Story: 2008257 Task: 41113 (cherry picked from commit 8e362402dee07744668bcf7f6774af4fbe9a07e3)
* | Merge "compute: Reorder building of columns for 'server list'" into stable/xenaZuul2022-07-051-87/+105
|\ \ | |/
| * compute: Reorder building of columns for 'server list'Stephen Finucane2021-12-011-87/+105
| | | | | | | | | | | | | | | | | | This has no impact on the end result, but it should make fixing issues introduced by API microversion 2.69 a little easier. Change-Id: I7d70eac8aa1a6197ed05a49f071e6899ec219c03 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> (cherry picked from commit 4c3de28e83babb0672950320a20492dc61803b4a)
* | Merge "Fix typo error in listing server's column name" into stable/xenaZuul2022-07-051-1/+1
|\ \ | |/
| * Fix typo error in listing server's column nameLEE JAE YONG2021-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | openstack server list -c "Created At" command doesn't work because the wrong variable was used here. When we receive resp data, Created At data is saved with the name "created". But in "server.py", we append columns as created_at. So it seems to print an empty table. Story: 2009149 Task: 43112 Change-Id: I06de6903d5cc427a8b0fdcd168fec47192f4365b (cherry picked from commit 4aad7dd77953e09b4973df0b37d1cb23d8b0afbf)
* | Fix: create image from volume commandwhoami-rajat2022-07-042-3/+121
|/ | | | | | | | | | | | | | | | | | | | Currently the command ``openstack image create --volume`` calls cinderclient to upload the volume to image service (glance) but OSC passes ``visibility`` and ``protected`` fields which are only available in microversion 3.1 or greater. This generates an error if the user is using volume microversion < 3.1 and wants to create an image from volume. This patch fixes that by only passing ``visibility`` and ``protected`` fields when the volume microversion is 3.1 or greater and fail otherwise i.e. the following 3 cases: 1) visibility/protected argument + mv >= 3.1 = pass 2) visibility/protected argument + mv < 3.1 = fail 3) not visibility/protected argument + any mv = pass Story: 2010060 Task: 45511 Change-Id: I568a0ea0af8f7f82b16d49a6a1bb0391b99c50dc (cherry picked from commit 9eea28ba59e44526b9d6f1ad9f80c3553d5853e2) (cherry picked from commit 849e7e93f83a220265d11af71e2edc009c3f7bea)
* compute: Fix filtering servers by tagsStephen Finucane2021-10-132-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nova API expects the 'tags' and 'not-tags' filters of the 'GET /servers' (list servers) API to be a CSV string [1]: tags (Optional) A list of tags to filter the server list by. Servers that match all tags in this list will be returned. Boolean expression in this case is 't1 AND t2'. Tags in query must be separated by comma. New in version 2.26 not-tags (Optional) A list of tags to filter the server list by. Servers that don’t match all tags in this list will be returned. Boolean expression in this case is 'NOT (t1 AND t2)'. Tags in query must be separated by comma. New in version 2.26 We were instead providing a Python list, which was simply being URL encoded. Correct this. [1] https://docs.openstack.org/api-ref/compute/?expanded=list-servers-detail#list-servers Change-Id: Ie0251a0dccdf3385089e5bbaedf646a5e928cc48 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Closes-Bug: #1946816 (cherry picked from commit 53debe7fe1978f661768a27430f646a288948ecc)
* Merge "L3 conntrack helper: Use singular name consistently"Zuul2021-08-262-6/+6
|\
| * L3 conntrack helper: Use singular name consistentlyAkihiro Motoki2021-06-082-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | We use singular form for delete command argument in all places. This commit replaces conntrack-helper-ids with a singular form. The only visible change is a fix for the help message below. openstack network l3 conntrack helper delete <router> <conntrack-helper-ids> [<conntrack-helper-ids> ...] Change-Id: I50bbd9f6199071bb86cbb2f37c45ebda1de58433
* | Merge "volume: Add 'volume transfer request create --(no-)snapshots' option"Zuul2021-08-262-0/+82
|\ \
| * | volume: Add 'volume transfer request create --(no-)snapshots' optionStephen Finucane2021-07-132-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | This closes a gap with cinderclient's 'transfer-create' command. Change-Id: I7386a7be15c0e3ee87abbcfc2275ba8524c10ff8 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2009054 Task: 42831
* | | Merge "openstack image create: honor protection/visibility flags"Zuul2021-08-261-0/+2
|\ \ \
| * | | openstack image create: honor protection/visibility flagsCyril Roelandt2021-05-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --protected, --unprotected, --public, --shared, --community, --private flags were ignored when using --volume. Change-Id: Id5c05ef7d7bb0a04b9d7a9d821e544e1ff7b3d28 Story: 2008882
* | | | Merge "volume: Add missing 'volume list --offset' parameter"Zuul2021-08-262-2/+16
|\ \ \ \
| * | | | volume: Add missing 'volume list --offset' parameterStephen Finucane2021-07-272-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looking at the code for the ancient v1 cinder API, we see that this supported offset-style pagination [1][2][3]. Add this parameter, simplifying a future patch to standardize pagination across OSC. [1] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/v1/volumes.py#L259 [2] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/v1/volumes.py#L292 [3] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/common.py#L120 Change-Id: Ifec208ea9ed7afb4bebced6132abb96a3af034b5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | Merge "Replace assertItemsEqual with assertCountEqual"Zuul2021-08-2332-292/+292
|\ \ \ \ \
| * | | | | Replace assertItemsEqual with assertCountEqualDirk Mueller2021-05-0332-292/+292
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assertItemsEqual was removed from Python's unittest.TestCase in Python 3.3 [1][2]. We have been able to use them since then, because testtools required unittest2, which still included it. With testtools removing Python 2.7 support [3][4], we will lose support for assertItemsEqual, so we should switch to use assertCountEqual. [1] - https://bugs.python.org/issue17866 [2] - https://hg.python.org/cpython/rev/d9921cb6e3cd [3] - testing-cabal/testtools#286 [4] - testing-cabal/testtools#277 Change-Id: I0bbffbec8889b8b3067cfe17d258f5cb16624f38
* | | | | Show "Forced Down" compute service status with --longmelanie witt2021-08-173-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the unified client does not have the ability to show the "Forced Down" field of a GET /os-services response in microversion 2.11 even though the legacy client can. This adds a "Forced Down" column to the 'openstack compute service list --long' command output when microversion 2.11 is used. Story: 2009115 Task: 43011 Change-Id: I10bc2fedbf0e867a990227962b2b6e60f5681f69
* | | | | Correct REST API response fields for /os-migrations APImelanie witt2021-07-283-12/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compute APIs are unfortunately inconsistent with regard to the response parameters for migrations. * GET /servers/{server_id}/migrations returns server_uuid * GET /os-migrations returns instance_uuid Because the 'Server UUID' column is being specified for parsing the response from GET /os-migrations, it is always showing as an empty string to users. There are a few other mismatches between the column names and the REST API response fields [1]: * 'Old Flavor' vs 'old_instance_type_id' * 'New Flavor' vs 'new_instance_type_id' * 'Type' vs 'migration_type' This adds a new list containing the REST API response field names to pass to utils.get_item_properties so that the responses are correctly parsed and the client output contains the response data instead of empty strings. Story: 2009078 Task: 42890 [1] https://docs.openstack.org/api-ref/compute/?expanded=list-migrations-detail#list-migrations Change-Id: I8aab60619e0225047f6a1c31e44917ca8fcc799e
* | | | | Merge "compute: Note that '--password' is deployment-specific"Zuul2021-07-271-5/+18
|\ \ \ \ \
| * | | | | compute: Note that '--password' is deployment-specificStephen Finucane2021-06-161-5/+18
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Password injection requires either hypervisor-support or an agent running in the guest that will talk to the metadata service. It can be disabled for a deployment using the '[api] enable_instance_password' nova config option. Indicate this, albeit briefly. Change-Id: Ief94ea07fc7ab6a487af972e8759ca6704d8f085 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | Fix TestListMigrationV223 test class MIGRATION_COLUMNSmelanie witt2021-07-271-6/+3
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently only the test_server_migration_list adds the 'Id' and 'Type' columns to the expected output, so if the test_server_migration_list_no_options test is run by itself, it fails as the actual response contains 'Id' and 'Type' but the reference does not. This example run fails: tox -epy38 test_server_migration_list_no_options The reason the tests pass in the gate is because test_server_migration_list (which adds the 'Id' and 'Type' columns to self.MIGRATION_COLUMNS) appears to always run before test_server_migration_list_no_options, so the latter test gets the benefit of the former test's column additions. This changes the test class to just include the 'Id' and 'Type' columns all the time as they are always returned in microversion 2.23 anyway. Story: 2009079 Task: 42891 Change-Id: I2c97e9f64790b5e978e4d04230d45b8e343b53d4
* | | | tests: Handle removal of block-storage v2 APIStephen Finucane2021-07-234-30/+44
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinder recently removed their v2 API [1] which is causing the functional tests to fail. Improve our 'is_service_enabled' test helper to use the 'versions show' command, which queries the service catalog and can give us information about the service version as well as answer the more general "is this service available" question. We also resolve a long-standing TODO in the process. [1] https://review.opendev.org/c/openstack/cinder/+/792299 Change-Id: I381069357aa008344e15327adf3a863c0c2e1f04 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Merge "compute: Fix typo"Zuul2021-07-021-1/+1
|\ \ \
| * | | compute: Fix typoStephen Finucane2021-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I3795142318b63b7c8f836d78a415a2161f61164d Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "Make functional Neutron tests running fine on ML2/OVN environments"Zuul2021-06-294-13/+45
|\ \ \ \
| * | | | Make functional Neutron tests running fine on ML2/OVN environmentsSlawek Kaplonski2021-05-274-13/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devstack recently switched default Neutron's backend from ML2/OVS to ML2/OVN. As OVN backend has some parity gaps and differences in some APIs, functional tests job was failing with ML2/OVN as some tests weren't properly skipped in case of missing some Neutron API extensions. This patch fixes that by doing some small changes in the functional tests: - skip DHCP/L3 agent tests when dhcp/l3 agent scheduler extensions aren't available, - skip updating neutron agent as OVN agents don't allows that, - skip service providers tests when there is no Neutron L3 agent available, - skip setting router as distributed as OVN backend don't supports that router's attribute at all. Depends-On: https://review.opendev.org/c/openstack/neutron/+/793141 Change-Id: I29a8db202086b0b49fed865409fa8ca244b98439
* | | | | Merge "volume: Add more missing 'volume backup *' options"Zuul2021-06-213-3/+244
|\ \ \ \ \
| * | | | | volume: Add more missing 'volume backup *' optionsStephen Finucane2021-06-103-3/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an additional '--no-property' option to the 'volume backup set' command, along with a brand spanking new 'volume backup unset' command. Change-Id: Id7ca925e0ada03e259f0ecaf3e02af11c900641e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | Merge "volume: Add 'volume group snapshot *' commands"Zuul2021-06-213-0/+549
|\ \ \ \ \ \ | |/ / / / /
| * | | | | volume: Add 'volume group snapshot *' commandsStephen Finucane2021-06-103-0/+549
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder group-snapshot-*' commands, with arguments copied across essentially verbatim. The only significant departure is the replacement of "tenant" terminology with "project". volume group snapshot create volume group snapshot delete volume group snapshot list volume group snapshot show Change-Id: Ia5084749b7c1a5a936fd6d6e8d89b9b80969f68c Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | Merge "volume: Add 'volume group type *' commands"Zuul2021-06-213-1/+888
|\ \ \ \ \ \ | |/ / / / /
| * | | | | volume: Add 'volume group type *' commandsStephen Finucane2021-06-033-1/+888
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder group-type-*' commands, with arguments copied across essentially verbatim. The only significant departure is the merging of some commands, such as 'group-type-default' and 'group-type-list' into 'group type list', and 'group-type-update' and 'group-type-key' into 'group type set/unset'. volume group type create volume group type delete volume group type list volume group type show volume group type set volume group type unset Change-Id: Iee6ee2f1f276e6ef6f75a74f8f2980f14c0d5e2f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | Merge "volume: Add 'volume group *' commands"Zuul2021-06-183-0/+1114
|\ \ \ \ \ \ | |/ / / / /
| * | | | | volume: Add 'volume group *' commandsStephen Finucane2021-06-033-0/+1114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder group-*' commands, with arguments copied across essentially verbatim. The only significant departures are the replacement of "tenant" terminology with "project" and the merging of the various volume group replication action commands into the parent volume group (e.g. 'openstack volume group set --enable-replication' instead of 'cinder group enable-replication') volume group create volume group delete volume group list volume group show volume group set volume group failover Change-Id: I3b2c0cb92b8a53cc1c0cefa3313b80f59c9e5835 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | Merge "tests: Rename 'FakeType' -> 'FakeVolumeType'"Zuul2021-06-188-84/+91
|\ \ \ \ \ \ | |/ / / / /
| * | | | | tests: Rename 'FakeType' -> 'FakeVolumeType'Stephen Finucane2021-06-038-84/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are more types than just volume types. Change-Id: I6af66f966a221437ff79fabcb0b81fd38586fe67 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | Merge "volume: Add missing 'volume backup *' options"Zuul2021-06-182-53/+321
|\ \ \ \ \ \ | |/ / / / /
| * | | | | volume: Add missing 'volume backup *' optionsStephen Finucane2021-06-032-53/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a couple of missing options to each command: volume backup create --no-incremental --property --availability-zone volume backup set --property Most of these are version dependent so we add the relevant version checks as part of this work. While we're here, we also make the formatting a little easier on the eye in places. Change-Id: I328d5c981cb32b2ee9a4b1bd43aa36b22347ff63 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | Merge "volume: Add 'volume message *' commands"Zuul2021-06-183-0/+557
|\ \ \ \ \ \ | |/ / / / /
| * | | | | volume: Add 'volume message *' commandsStephen Finucane2021-06-033-0/+557
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the necessary commands to utilize the Messages API introduced in Cinder API version 3.3. Version 3.5 built upon this by implementing pagination support for these commands which is present in this patch as well. volume message get volume message list volume message delete Change-Id: I64aa0b4a8d4468baa8c63e5e30ee31de68df999d
* | | | | | Merge "volume: Add 'volume attachment *' commands"Zuul2021-06-183-0/+1226
|\ \ \ \ \ \ | |/ / / / /
| * | | | | volume: Add 'volume attachment *' commandsStephen Finucane2021-06-033-0/+1226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder attachment-*' commands, with arguments copied across essentially verbatim. The only significant departure is the replacement of "tenant" terminology with "project". volume attachment create volume attachment delete volume attachment list volume attachment complete volume attachment set volume attachment show Full support for filtering is deferred for now since that's a more complicated change that requires additional commands be added first. TODOs are included to this effect. Change-Id: If47c2b56fe65ee2cee07c000d6ae3688d5ef3b42 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | Merge "volume: Allow more versions"Zuul2021-06-171-5/+50
|\ \ \ \ \ \ | |/ / / / /
| * | | | | volume: Allow more versionsStephen Finucane2021-06-031-5/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copy the API version checks from the 'openstackclient.compute.client' module. These will only be necessary until we migrate everything to SDK but it's very helpful until then. Change-Id: I2d9c68db5bf891ffa25fd5a7fc9e8953e44b73ab Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | compute: Better help text for 'openstack server set --state'Stephen Finucane2021-06-161-1/+6
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually changing the server state is a potentially dangerous operation that should only be done under limited circumstances. It's also an admin-only operation by default. Highlight both points. Change-Id: Ifd8aec94937764202131ba8caf6b507caa76d7e9 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2008549 Task: 41672
* | | | | Add support for Neutron's L3 conntrack helper resourceSlawek Kaplonski2021-06-074-0/+791
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Neutron has got CRUD API for L3 conntrack helper since some time. This patch adds support for it in the OSC. OpenStack SDK supports that since [1] This patch also bumps minimum OpenStack SDK version to the 0.56.0 as that version introduced support for the Neutron's L3 conntrack helper. [1] https://review.opendev.org/c/openstack/openstacksdk/+/782870 Change-Id: I55604182ae50b6ad70c8bc1f7efad8859f191269
* | | | Merge "compute: Update 'server resize --revert', '--confirm' help"Zuul2021-06-021-2/+10
|\ \ \ \ | |_|/ / |/| | |