Commit graph

4042 commits

Author SHA1 Message Date
Zuul
456c66ff63 Merge "volume: Allow filtering volume types by properties" 2023-10-31 14:53:36 +00:00
Zuul
d735b6cc07 Merge "volume: Support same_host, different_host hint as list" 2023-10-31 14:53:35 +00:00
Zuul
c258d196a4 Merge "Migrate resource filter commands to SDK" 2023-10-31 10:25:55 +00:00
Johannes Kulik
60a0e379a4 volume: Support same_host, different_host hint as list
When creating a volume, the scheduler hints can be supplied as strings.
The "same_host" and "different_host" hints can also be supplied as a
list if affinity/anti-affinity to multiple volumes is requested [0]

The previously-used `KeyValueAction` only supplies strings as values - the
last one if multiple --hint contain the same key. An alternative already
used in `CreateServer` would be `KeyValueAppendAction`, but only a subset of
the scheduler hints accept lists, so we cannot use that in general.

Therefore, we create `KeyValueHintAction`. It contains both a
`KeyValueAction` and a `KeyValueAppendAction` object and calls the
appropriate action based on the beginning of the given values as defined
in `APPEND_KEYS`.

[0] d96b705774/cinder/api/schemas/scheduler_hints.py (L31-L65)

Change-Id: Ida7f4662dc9fea24510758541fd4f2622b73bf31
2023-10-31 09:22:25 +01:00
Rajat Dhasmana
ae10851a68 Migrate resource filter commands to SDK
This patch migrates ``block storage resource filter list`` and
``block storage resource filter show`` commands to SDK.

Change-Id: Ibc50963954418aab0be35e120f8dcfadbe4020b8
2023-10-30 12:06:14 +05:30
Zuul
53e7d713f0 Merge "Migrate volume backend commands to SDK" 2023-10-27 17:35:06 +00:00
Zuul
491e5b9e9a Merge "tests: Add compute v2 FakeClientMixin" 2023-10-27 16:38:55 +00:00
Zuul
f576cb62b6 Merge "tests: Use consistent shortcut to fake compute client" 2023-10-27 16:38:53 +00:00
Zuul
14a4f89030 Merge "tests: Add volume v1, v2, v3 FakeClientMixin" 2023-10-27 16:23:55 +00:00
Zuul
dd5a21ff02 Merge "tests: Use consistent shortcut to fake volume client" 2023-10-27 16:23:53 +00:00
Zuul
b884e83e37 Merge "tests: Use central SDK client fake" 2023-10-27 16:20:27 +00:00
Stephen Finucane
67bec7785c volume: Allow filtering volume types by properties
Starting in volume API microversion 3.52, it is possible to filter
volume types by extra specs (a.k.a. properties). Even non-admins can do
this for so-called "user visible" extra specs. Make it possible to do
this.

While we're here, the test file is renamed to match the name of the
module under test.

Change-Id: Ia9acc06c0c615bf24e12b63146ea97ac2505f596
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-10-27 16:37:15 +01:00
Slawek Kaplonski
7b99b57165 Add support for default security group rule CRUDs
Change-Id: I1c18c2ec5eb4923e1ab8b3fc6199ef6f329b4a4d
2023-10-19 16:04:22 +02:00
Cyril Roelandt
d9c4c43a40 Add "image metadef property create" command
Change-Id: Icb4fab0aef13b28212771da3a3b7c4a0775bb38e
2023-10-18 13:26:15 +00:00
Cyril Roelandt
190f06a963 Add "image metadef property show" command
Change-Id: I326735014dfcb4477b109a99aa31f71b07b91c7b
2023-10-18 12:39:39 +00:00
Cyril Roelandt
5fb922e469 Add "image metadef property list" command.
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/857727
Change-Id: I8f6692e779c4721225052d348b4b947a545bd6c0
2023-10-18 12:39:35 +00:00
Rajat Dhasmana
39a084f91c Migrate volume backend commands to SDK
This patch migrates following volume backend commands to SDK:

volume backend capability show
volume backend pool list

Change-Id: Idded38a5f87d51574426c4ac10c806af52984b7c
2023-10-12 01:14:35 +05:30
Zuul
0fb1cae1a8 Merge "Fix "server create"command with --boot-from-volume" 2023-10-11 15:59:24 +00:00
Zuul
98fbc56603 Merge "Fix --security-group for port list" 2023-10-11 15:59:22 +00:00
Stephen Finucane
912a21a8fd tests: Add compute v2 FakeClientMixin
This ensures we are speccing the compute proxy API.

Change-Id: I7adbf2666d71f222fbd9c1479216f72cb9893348
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:32 +01:00
Stephen Finucane
187a454ec0 tests: Use consistent shortcut to fake compute client
This removes the need for a number of base test case subclasses. We use
'compute_client' rather than 'client' to avoid conflicts with clients
for other services.

Change-Id: I430214cd79eca481bd8d8c53bf97eaede6766eb4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:32 +01:00
Stephen Finucane
98fb1678bc tests: Add volume v1, v2, v3 FakeClientMixin
This ensures we are speccing the image proxy API, as we did previously
for the network tests in Ic203964c7dede7dd80ae2d93b8fa1b7e6634a758.

Change-Id: I132ccd1170cc903f6edc505926b071170aeaa08c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:32 +01:00
Stephen Finucane
4cabf6f7a2 tests: Use consistent shortcut to fake volume client
This removes the need for a number of base test case subclasses. We use
'volume_client' rather than 'client' to avoid conflicts with clients for
other services.

Change-Id: I28d78f32142bb3a3fde0ba1780c504adc31cc77c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:30 +01:00
Stephen Finucane
02cc064258 tests: Use central SDK client fake
Avoid double mocking.

Change-Id: Ic8fadd41f3687eabd3a149681effae6883edb12e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:12:19 +01:00
Christian Rohmann
98b949646c Add is_incremental to ListVolumeBackup
It's of interest which backups are incremental or full. Returning this
information as a column to the list of backups.

Change-Id: I766330228634d5db678df11c23877077a3635372
2023-09-19 22:10:04 +02:00
Zuul
619925e45f Merge "Remove use of oslo.utils" 2023-09-19 13:14:12 +00:00
Zuul
5f4082d046 Merge "Add a warning for resizing servers booted from volumes" 2023-09-19 13:14:06 +00:00
Zuul
7c0bdd5e7e Merge "volume: Deprecate '--detailed' options" 2023-09-19 13:11:32 +00:00
Zuul
cab84d6760 Merge "tests: Explicitly specify port fields for output" 2023-09-19 13:11:31 +00:00
Stephen Finucane
fb2e0ced6e tests: Explicitly specify port fields for output
Rather than excluding the few fields we don't want, explicitly indicate
the ones we do want. We were already in-effect doing this in our tests,
so this is simply moving the definition from tests to the main code.

Note that this is a problem in the tests for virtually all commands
that will be seen as the SDK continues to evolve and new fields are
added to existing resources. This is a problem that be solved over
time though, rather than in a big bang commit.

Change-Id: Iaa64e97450f5c73cab2e2c3b0c741aec1495b4f1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-12 08:33:20 +00:00
Stephen Finucane
08551106e6 Remove use of oslo.utils
While a relatively small library, this is one import that we really
don't need. Remove it.

Change-Id: I726f3c3548cbd896588ef0613222e36c529f5bcc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-11 11:02:55 +01:00
Stephen Finucane
8735b862c5 volume: Deprecate '--detailed' options
We use flags, not options with boolean-like values, for boolean
parameters. The affected commands were only introduced recently so this
should have minimal fallout.

Change-Id: I700733e750bff539806af167c9d47cec769c3343
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-11 11:02:55 +01:00
Zuul
08faf81d0d Merge "tests: Add image v1, v2 FakeClientMixin" 2023-09-06 12:29:14 +00:00
Zuul
6ae38b2888 Merge "tests: Use consistent shortcut to fake image client" 2023-09-06 12:26:00 +00:00
Zuul
98c62dfbe0 Merge "tests: Remove FakeImagev1Client, FakeImagev2Client" 2023-09-06 12:16:35 +00:00
Zuul
09eb21ea35 Merge "tests: Add network v2 FakeClientMixin" 2023-09-06 12:08:34 +00:00
Zuul
6423b61326 Merge "tests: Use consistent shortcut to fake network client" 2023-09-05 19:35:50 +00:00
Zuul
d69d738c74 Merge "tests: Remove FakeNetworkV2Client" 2023-09-05 19:30:07 +00:00
Zuul
9e2316fd06 Merge "Remove project purge image commands" 2023-09-05 19:30:05 +00:00
Zuul
876c120a9c Merge "Migrate 'extension list' to SDK" 2023-09-05 19:30:04 +00:00
Zuul
5ab1b13d5e Merge "Migrate 'availability zone list' to SDK" 2023-09-05 19:30:02 +00:00
Zuul
94caaa487d Merge "Migrate backup commands to SDK" 2023-09-01 02:45:27 +00:00
Stephen Finucane
e1a86368bd tests: Add image v1, v2 FakeClientMixin
This ensures we are speccing the image proxy API, as we did previously
for the network tests in Ic203964c7dede7dd80ae2d93b8fa1b7e6634a758.

Change-Id: I09539cbf35444272fb3aaabfecd5d731d1ecc4a8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
28b1267921 tests: Use consistent shortcut to fake image client
This removes the need for a number of base test case subclasses. We use
'image_client' rather than 'client' to avoid conflicts with clients for
other services.

Note that this highlights a minor bug with the 'volume create' command
when using the v1 block storage API and creating a volume from an image.
This is corrected, though it can be assumed that no one is actually
using this code path to say it hasn't been reported in the few years
since the bug was introduced in Ussuri.

Change-Id: I571be27f68bb7669dcb883f3b4799731b4a35479
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
a823228527 tests: Remove FakeImagev1Client, FakeImagev2Client
These no longer makes any sense since all image calls use the SDK proxy
API now.

Change-Id: I48e1d90f9c0dfa904fe37caa0de60d20945f1118
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
a39bde5c3a tests: Add network v2 FakeClientMixin
This ensures we are speccing the network proxy API. Future changes will
do the same for the image proxy API and eventually the compute proxy API
(once everything has been converted).

Change-Id: Ic203964c7dede7dd80ae2d93b8fa1b7e6634a758
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
b25742499a tests: Use consistent shortcut to fake network client
This removes the need for a number of base test case subclasses. We use
'network_client' rather than 'network' for consistency with other
services.

Change-Id: I61f7c43341acf19ae16d06db34e18970297fbb93
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
84dd5b0018 tests: Remove FakeNetworkV2Client
This no longer makes any sense since all network calls uses the SDK
proxy API now.

Change-Id: I0d57d7561b697270b24acd7b8ff62db73a83f49a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
601d9717c2 Remove project purge image commands
This was still using glanceclient-style calls despite us having switched
all image command to SDK way back in 5.2.0 (Ussuri). It therefore hasn't
worked since then, so we remove without deprecation.

Change-Id: Ibea79ea10bb272cba194debfe4bcbaeebf3875b7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
b87b57551b Migrate 'extension list' to SDK
Migrate the block storage aspects of this command to SDK. This means the
'extension list' command, like the 'availability zone list' command
previously, is now using SDK entirely.

While we're here, we also make some fixes to the unit tests for the
network and compute aspects of the command. While we migrated the
network and compute extension commands from neutronclient and novaclient
respectively some time back, we never fully updated the tests. Do this
now.

Change-Id: I631a6a09dfd9d614b1dd7b322dcee8490a52cc43
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/885132
2023-08-28 13:51:34 +01:00