Browse Source

Merge "Add Cinder v3 client support for volumes"

tags/3.9.0
Jenkins 2 years ago
parent
commit
3ec0bc9179

+ 0
- 0
openstackclient/tests/functional/volume/v3/__init__.py View File


+ 23
- 0
openstackclient/tests/functional/volume/v3/common.py View File

@@ -0,0 +1,23 @@
1
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+#    not use this file except in compliance with the License. You may obtain
3
+#    a copy of the License at
4
+#
5
+#         http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+#    Unless required by applicable law or agreed to in writing, software
8
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+#    License for the specific language governing permissions and limitations
11
+#    under the License.
12
+
13
+import os
14
+
15
+from openstackclient.tests.functional import base
16
+
17
+
18
+class BaseVolumeTests(base.TestCase):
19
+    """Base class for Volume functional tests. """
20
+
21
+    @classmethod
22
+    def setUpClass(cls):
23
+        os.environ['OS_VOLUME_API_VERSION'] = '3'

+ 23
- 0
openstackclient/tests/functional/volume/v3/test_qos.py View File

@@ -0,0 +1,23 @@
1
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+#    not use this file except in compliance with the License. You may obtain
3
+#    a copy of the License at
4
+#
5
+#         http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+#    Unless required by applicable law or agreed to in writing, software
8
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+#    License for the specific language governing permissions and limitations
11
+#    under the License.
12
+
13
+from openstackclient.tests.functional.volume.v2 import test_qos as v2
14
+import os
15
+
16
+
17
+class QosTests(v2.QosTests):
18
+    """Functional tests for volume qos. """
19
+
20
+    @classmethod
21
+    def setUpClass(cls):
22
+        super(QosTests, cls).setUpClass()
23
+        os.environ['OS_VOLUME_API_VERSION'] = '3'

+ 23
- 0
openstackclient/tests/functional/volume/v3/test_snapshot.py View File

@@ -0,0 +1,23 @@
1
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+#    not use this file except in compliance with the License. You may obtain
3
+#    a copy of the License at
4
+#
5
+#         http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+#    Unless required by applicable law or agreed to in writing, software
8
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+#    License for the specific language governing permissions and limitations
11
+#    under the License.
12
+
13
+from openstackclient.tests.functional.volume.v2 import test_snapshot as v2
14
+import os
15
+
16
+
17
+class VolumeSnapshotTests(v2.VolumeSnapshotTests):
18
+    """Functional tests for volume snapshot. """
19
+
20
+    @classmethod
21
+    def setUpClass(cls):
22
+        super(VolumeSnapshotTests, cls).setUpClass()
23
+        os.environ['OS_VOLUME_API_VERSION'] = '3'

+ 24
- 0
openstackclient/tests/functional/volume/v3/test_transfer_request.py View File

@@ -0,0 +1,24 @@
1
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+#    not use this file except in compliance with the License. You may obtain
3
+#    a copy of the License at
4
+#
5
+#         http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+#    Unless required by applicable law or agreed to in writing, software
8
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+#    License for the specific language governing permissions and limitations
11
+#    under the License.
12
+
13
+from openstackclient.tests.functional.volume.v2 import test_transfer_request \
14
+    as v2
15
+import os
16
+
17
+
18
+class TransferRequestTests(v2.TransferRequestTests):
19
+    """Functional tests for transfer request. """
20
+
21
+    @classmethod
22
+    def setUpClass(cls):
23
+        super(TransferRequestTests, cls).setUpClass()
24
+        os.environ['OS_VOLUME_API_VERSION'] = '3'

+ 23
- 0
openstackclient/tests/functional/volume/v3/test_volume.py View File

@@ -0,0 +1,23 @@
1
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+#    not use this file except in compliance with the License. You may obtain
3
+#    a copy of the License at
4
+#
5
+#         http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+#    Unless required by applicable law or agreed to in writing, software
8
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+#    License for the specific language governing permissions and limitations
11
+#    under the License.
12
+
13
+from openstackclient.tests.functional.volume.v2 import test_volume as v2
14
+import os
15
+
16
+
17
+class VolumeTests(v2.VolumeTests):
18
+    """Functional tests for volume. """
19
+
20
+    @classmethod
21
+    def setUpClass(cls):
22
+        super(VolumeTests, cls).setUpClass()
23
+        os.environ['OS_VOLUME_API_VERSION'] = '3'

+ 23
- 0
openstackclient/tests/functional/volume/v3/test_volume_type.py View File

@@ -0,0 +1,23 @@
1
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2
+#    not use this file except in compliance with the License. You may obtain
3
+#    a copy of the License at
4
+#
5
+#         http://www.apache.org/licenses/LICENSE-2.0
6
+#
7
+#    Unless required by applicable law or agreed to in writing, software
8
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
+#    License for the specific language governing permissions and limitations
11
+#    under the License.
12
+
13
+from openstackclient.tests.functional.volume.v2 import test_volume_type as v2
14
+import os
15
+
16
+
17
+class VolumeTypeTests(v2.VolumeTypeTests):
18
+    """Functional tests for volume type. """
19
+
20
+    @classmethod
21
+    def setUpClass(cls):
22
+        super(VolumeTypeTests, cls).setUpClass()
23
+        os.environ['OS_VOLUME_API_VERSION'] = '3'

+ 0
- 0
openstackclient/tests/unit/volume/v3/__init__.py View File


+ 2
- 1
openstackclient/volume/client.py View File

@@ -27,7 +27,8 @@ API_VERSION_OPTION = 'os_volume_api_version'
27 27
 API_NAME = "volume"
28 28
 API_VERSIONS = {
29 29
     "1": "cinderclient.v1.client.Client",
30
-    "2": "cinderclient.v2.client.Client"
30
+    "2": "cinderclient.v2.client.Client",
31
+    "3": "cinderclient.v3.client.Client",
31 32
 }
32 33
 
33 34
 

+ 0
- 0
openstackclient/volume/v3/__init__.py View File


+ 10
- 0
releasenotes/notes/change-098377fd53cce7a0.yaml View File

@@ -0,0 +1,10 @@
1
+---
2
+features:
3
+  - |
4
+    Added support for Volume API v3 for the following block storage command
5
+    resources: ``consistency group``, ``consistency group snapshot``,
6
+    ``volume``, ``volume backup``, ``volume host``, ``volume snapshot``,
7
+    ``volume type``, ``volume qos``, ``volume service``,
8
+    ``volume transfer request``. Note that microversion support for Volume API
9
+    v3 is not yet implemented, each command will assume the API version is
10
+    ``3.0``.

+ 63
- 0
setup.cfg View File

@@ -612,6 +612,69 @@ openstack.volume.v2 =
612 612
     volume_transfer_request_list = openstackclient.volume.v2.volume_transfer_request:ListTransferRequest
613 613
     volume_transfer_request_show = openstackclient.volume.v2.volume_transfer_request:ShowTransferRequest
614 614
 
615
+openstack.volume.v3 =
616
+    consistency_group_add_volume = openstackclient.volume.v2.consistency_group:AddVolumeToConsistencyGroup
617
+    consistency_group_create = openstackclient.volume.v2.consistency_group:CreateConsistencyGroup
618
+    consistency_group_delete = openstackclient.volume.v2.consistency_group:DeleteConsistencyGroup
619
+    consistency_group_list = openstackclient.volume.v2.consistency_group:ListConsistencyGroup
620
+    consistency_group_remove_volume = openstackclient.volume.v2.consistency_group:RemoveVolumeFromConsistencyGroup
621
+    consistency_group_set = openstackclient.volume.v2.consistency_group:SetConsistencyGroup
622
+    consistency_group_show = openstackclient.volume.v2.consistency_group:ShowConsistencyGroup
623
+
624
+    consistency_group_snapshot_create = openstackclient.volume.v2.consistency_group_snapshot:CreateConsistencyGroupSnapshot
625
+    consistency_group_snapshot_delete = openstackclient.volume.v2.consistency_group_snapshot:DeleteConsistencyGroupSnapshot
626
+    consistency_group_snapshot_list = openstackclient.volume.v2.consistency_group_snapshot:ListConsistencyGroupSnapshot
627
+    consistency_group_snapshot_show = openstackclient.volume.v2.consistency_group_snapshot:ShowConsistencyGroupSnapshot
628
+
629
+    volume_create = openstackclient.volume.v2.volume:CreateVolume
630
+    volume_delete = openstackclient.volume.v2.volume:DeleteVolume
631
+    volume_list = openstackclient.volume.v2.volume:ListVolume
632
+    volume_migrate = openstackclient.volume.v2.volume:MigrateVolume
633
+    volume_set = openstackclient.volume.v2.volume:SetVolume
634
+    volume_show = openstackclient.volume.v2.volume:ShowVolume
635
+    volume_unset = openstackclient.volume.v2.volume:UnsetVolume
636
+
637
+    volume_backup_create = openstackclient.volume.v2.backup:CreateVolumeBackup
638
+    volume_backup_delete = openstackclient.volume.v2.backup:DeleteVolumeBackup
639
+    volume_backup_list = openstackclient.volume.v2.backup:ListVolumeBackup
640
+    volume_backup_restore = openstackclient.volume.v2.backup:RestoreVolumeBackup
641
+    volume_backup_set = openstackclient.volume.v2.backup:SetVolumeBackup
642
+    volume_backup_show = openstackclient.volume.v2.backup:ShowVolumeBackup
643
+
644
+    volume_host_set = openstackclient.volume.v2.volume_host:SetVolumeHost
645
+
646
+    volume_snapshot_create = openstackclient.volume.v2.volume_snapshot:CreateVolumeSnapshot
647
+    volume_snapshot_delete = openstackclient.volume.v2.volume_snapshot:DeleteVolumeSnapshot
648
+    volume_snapshot_list = openstackclient.volume.v2.volume_snapshot:ListVolumeSnapshot
649
+    volume_snapshot_set = openstackclient.volume.v2.volume_snapshot:SetVolumeSnapshot
650
+    volume_snapshot_show = openstackclient.volume.v2.volume_snapshot:ShowVolumeSnapshot
651
+    volume_snapshot_unset = openstackclient.volume.v2.volume_snapshot:UnsetVolumeSnapshot
652
+
653
+    volume_type_create = openstackclient.volume.v2.volume_type:CreateVolumeType
654
+    volume_type_delete = openstackclient.volume.v2.volume_type:DeleteVolumeType
655
+    volume_type_list = openstackclient.volume.v2.volume_type:ListVolumeType
656
+    volume_type_set = openstackclient.volume.v2.volume_type:SetVolumeType
657
+    volume_type_show = openstackclient.volume.v2.volume_type:ShowVolumeType
658
+    volume_type_unset = openstackclient.volume.v2.volume_type:UnsetVolumeType
659
+
660
+    volume_qos_associate = openstackclient.volume.v2.qos_specs:AssociateQos
661
+    volume_qos_create = openstackclient.volume.v2.qos_specs:CreateQos
662
+    volume_qos_delete = openstackclient.volume.v2.qos_specs:DeleteQos
663
+    volume_qos_disassociate = openstackclient.volume.v2.qos_specs:DisassociateQos
664
+    volume_qos_list = openstackclient.volume.v2.qos_specs:ListQos
665
+    volume_qos_set = openstackclient.volume.v2.qos_specs:SetQos
666
+    volume_qos_show = openstackclient.volume.v2.qos_specs:ShowQos
667
+    volume_qos_unset = openstackclient.volume.v2.qos_specs:UnsetQos
668
+
669
+    volume_service_list = openstackclient.volume.v2.service:ListService
670
+    volume_service_set = openstackclient.volume.v2.service:SetService
671
+
672
+    volume_transfer_request_accept = openstackclient.volume.v2.volume_transfer_request:AcceptTransferRequest
673
+    volume_transfer_request_create = openstackclient.volume.v2.volume_transfer_request:CreateTransferRequest
674
+    volume_transfer_request_delete = openstackclient.volume.v2.volume_transfer_request:DeleteTransferRequest
675
+    volume_transfer_request_list = openstackclient.volume.v2.volume_transfer_request:ListTransferRequest
676
+    volume_transfer_request_show = openstackclient.volume.v2.volume_transfer_request:ShowTransferRequest
677
+
615 678
 [build_sphinx]
616 679
 source-dir = doc/source
617 680
 build-dir = doc/build

Loading…
Cancel
Save