Add Cinder v3 client support for volumes

Initial Cinder v3 support

Change-Id: Idd5074832e80697ed0671f06d3291dfd92dbfb08
This commit is contained in:
Justin A Wilson 2016-09-30 13:44:26 -07:00 committed by Steve Martinelli
parent 1e3dc48c64
commit 4d5f2c3925
12 changed files with 214 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

View File

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

View File

@ -602,6 +602,69 @@ openstack.volume.v2 =
volume_transfer_request_list = openstackclient.volume.v2.volume_transfer_request:ListTransferRequest
volume_transfer_request_show = openstackclient.volume.v2.volume_transfer_request:ShowTransferRequest
openstack.volume.v3 =
consistency_group_add_volume = openstackclient.volume.v2.consistency_group:AddVolumeToConsistencyGroup
consistency_group_create = openstackclient.volume.v2.consistency_group:CreateConsistencyGroup
consistency_group_delete = openstackclient.volume.v2.consistency_group:DeleteConsistencyGroup
consistency_group_list = openstackclient.volume.v2.consistency_group:ListConsistencyGroup
consistency_group_remove_volume = openstackclient.volume.v2.consistency_group:RemoveVolumeFromConsistencyGroup
consistency_group_set = openstackclient.volume.v2.consistency_group:SetConsistencyGroup
consistency_group_show = openstackclient.volume.v2.consistency_group:ShowConsistencyGroup
consistency_group_snapshot_create = openstackclient.volume.v2.consistency_group_snapshot:CreateConsistencyGroupSnapshot
consistency_group_snapshot_delete = openstackclient.volume.v2.consistency_group_snapshot:DeleteConsistencyGroupSnapshot
consistency_group_snapshot_list = openstackclient.volume.v2.consistency_group_snapshot:ListConsistencyGroupSnapshot
consistency_group_snapshot_show = openstackclient.volume.v2.consistency_group_snapshot:ShowConsistencyGroupSnapshot
volume_create = openstackclient.volume.v2.volume:CreateVolume
volume_delete = openstackclient.volume.v2.volume:DeleteVolume
volume_list = openstackclient.volume.v2.volume:ListVolume
volume_migrate = openstackclient.volume.v2.volume:MigrateVolume
volume_set = openstackclient.volume.v2.volume:SetVolume
volume_show = openstackclient.volume.v2.volume:ShowVolume
volume_unset = openstackclient.volume.v2.volume:UnsetVolume
volume_backup_create = openstackclient.volume.v2.backup:CreateVolumeBackup
volume_backup_delete = openstackclient.volume.v2.backup:DeleteVolumeBackup
volume_backup_list = openstackclient.volume.v2.backup:ListVolumeBackup
volume_backup_restore = openstackclient.volume.v2.backup:RestoreVolumeBackup
volume_backup_set = openstackclient.volume.v2.backup:SetVolumeBackup
volume_backup_show = openstackclient.volume.v2.backup:ShowVolumeBackup
volume_host_set = openstackclient.volume.v2.volume_host:SetVolumeHost
volume_snapshot_create = openstackclient.volume.v2.volume_snapshot:CreateVolumeSnapshot
volume_snapshot_delete = openstackclient.volume.v2.volume_snapshot:DeleteVolumeSnapshot
volume_snapshot_list = openstackclient.volume.v2.volume_snapshot:ListVolumeSnapshot
volume_snapshot_set = openstackclient.volume.v2.volume_snapshot:SetVolumeSnapshot
volume_snapshot_show = openstackclient.volume.v2.volume_snapshot:ShowVolumeSnapshot
volume_snapshot_unset = openstackclient.volume.v2.volume_snapshot:UnsetVolumeSnapshot
volume_type_create = openstackclient.volume.v2.volume_type:CreateVolumeType
volume_type_delete = openstackclient.volume.v2.volume_type:DeleteVolumeType
volume_type_list = openstackclient.volume.v2.volume_type:ListVolumeType
volume_type_set = openstackclient.volume.v2.volume_type:SetVolumeType
volume_type_show = openstackclient.volume.v2.volume_type:ShowVolumeType
volume_type_unset = openstackclient.volume.v2.volume_type:UnsetVolumeType
volume_qos_associate = openstackclient.volume.v2.qos_specs:AssociateQos
volume_qos_create = openstackclient.volume.v2.qos_specs:CreateQos
volume_qos_delete = openstackclient.volume.v2.qos_specs:DeleteQos
volume_qos_disassociate = openstackclient.volume.v2.qos_specs:DisassociateQos
volume_qos_list = openstackclient.volume.v2.qos_specs:ListQos
volume_qos_set = openstackclient.volume.v2.qos_specs:SetQos
volume_qos_show = openstackclient.volume.v2.qos_specs:ShowQos
volume_qos_unset = openstackclient.volume.v2.qos_specs:UnsetQos
volume_service_list = openstackclient.volume.v2.service:ListService
volume_service_set = openstackclient.volume.v2.service:SetService
volume_transfer_request_accept = openstackclient.volume.v2.volume_transfer_request:AcceptTransferRequest
volume_transfer_request_create = openstackclient.volume.v2.volume_transfer_request:CreateTransferRequest
volume_transfer_request_delete = openstackclient.volume.v2.volume_transfer_request:DeleteTransferRequest
volume_transfer_request_list = openstackclient.volume.v2.volume_transfer_request:ListTransferRequest
volume_transfer_request_show = openstackclient.volume.v2.volume_transfer_request:ShowTransferRequest
[build_sphinx]
source-dir = doc/source
build-dir = doc/build