Daniel Erez has uploaded a new change for review.

Change subject: restapi: openstack_volume_type on Disk entity
......................................................................

restapi: openstack_volume_type on Disk entity

Supporting 'openstack_volume_type' element upon creating a new Cinder disk.
This element is optional when creating a new Cinder disk (to imply
Cinder which volume driver to use). Note: Volume Types sub-collection
has already been added in [1]).

Feature Page: http://www.ovirt.org/Features/Cinder_Integration

[1] http://gerrit.ovirt.org/39371

Change-Id: I952c431b8f7e7d0508855892b518c43bef9c7b7f
Bug-Url: https://bugzilla.redhat.com/1185826
Signed-off-by: Daniel Erez <[email protected]>
---
M 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M 
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
M 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
M 
backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
4 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/66/41966/1

diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
index a896dbb..8434cdf 100644
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
@@ -3763,6 +3763,7 @@
           <xs:element ref="disk_profile" minOccurs="0" maxOccurs="1"/>
           <xs:element name="logical_name" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
           <xs:element name="storage_type" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
+          <xs:element name="openstack_volume_type" type="xs:string" 
minOccurs="0" maxOccurs="1"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
index a9b1697..e1253fe 100644
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
@@ -602,6 +602,7 @@
           disk.quota.id: xs:string
           disk.disk_profile.id: xs:string
           disk.storage_domains.storage_domain--COLLECTION: 
{storage_domain.id|name: 'xs:string'}
+          disk.openstack_volume_type: xs:string
         description: add a new disk to the virtual machine allocating space 
from the storage domain
         #the signature below is for direct-LUN disk, which doesn't require 
size, but requires the lun id, the lun type, and the lun connection-details.
       - mandatoryArguments: {disk.interface: 'xs:string', 
disk.lun_storage.type: 'xs:string',
@@ -876,6 +877,7 @@
           disk.quota.id: xs:string
           disk.disk_profile.id: xs:string
           disk.storage_domains.storage_domain--COLLECTION: 
{storage_domain.id|name: 'xs:string'}
+          disk.openstack_volume_type: xs:string
         description: add a new disk to the system with specified size, space 
will be allocated from the storage domain for the disk
         #the signature below is for direct-LUN disk, which doesn't require 
size, but requires the lun id, the lun type, and the lun connection-details.
       - mandatoryArguments: {disk.interface: 'xs:string', 
disk.lun_storage.type: 'xs:string',
@@ -2930,6 +2932,7 @@
           disk.wipe_after_delete: xs:boolean
           disk.quota.id: xs:string
           disk.disk_profile.id: xs:string
+          disk.openstack_volume_type: xs:string
         description: add a new disk to the storage domain with the specified 
size allocating space from the storage domain
         #the signature below is for direct-LUN disk, which doesn't require 
size, but requires the lun id, the lun type, and the lun connection-details.
       - mandatoryArguments: {disk.interface: 'xs:string', disk.format: 
'xs:string', disk.lun_storage.type: 'xs:string',
@@ -2996,6 +2999,7 @@
           disk.wipe_after_delete: xs:boolean
           disk.quota.id: xs:string
           disk.disk_profile.id: xs:string
+          disk.openstack_volume_type: xs:string
         description: add a new disk with the specified size to the storage 
domain in the data center, allocating space from the storage domain
         #the signature below is for direct-LUN disk, which doesn't require 
size, but requires the lun id, the lun type, and the lun connection-details.
       - mandatoryArguments: {disk.interface: 'xs:string', disk.format: 
'xs:string', disk.lun_storage.type: 'xs:string',
diff --git 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
index e121b77..e11a10a 100644
--- 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
+++ 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DiskMapper.java
@@ -160,6 +160,9 @@
         if (disk.isSetDiskProfile() && disk.getDiskProfile().isSetId()) {
             
diskImage.setDiskProfileId(GuidUtils.asGuid(disk.getDiskProfile().getId()));
         }
+        if (disk.isSetOpenstackVolumeType()) {
+            diskImage.setCinderVolumeType(disk.getOpenstackVolumeType());
+        }
     }
 
     @Mapping(from = 
org.ovirt.engine.core.common.businessentities.storage.Disk.class, to = 
Disk.class)
@@ -237,6 +240,9 @@
             diskProfile.setId(entity.getDiskProfileId().toString());
             model.setDiskProfile(diskProfile);
         }
+        if (entity.getCinderVolumeType() != null) {
+            model.setOpenstackVolumeType(entity.getCinderVolumeType());
+        }
     }
 
     @Mapping(from = DiskFormat.class, to = String.class)
diff --git 
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
 
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
index 9548094..37d65cd 100644
--- 
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
+++ 
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/DiskMapperTest.java
@@ -38,6 +38,7 @@
         assertEquals(model.isReadOnly(), transform.isReadOnly());
         assertEquals(model.getDescription(), transform.getDescription());
         assertEquals(model.getLogicalName(), transform.getLogicalName());
+        assertEquals(model.getOpenstackVolumeType(), 
transform.getOpenstackVolumeType());
         assertNotNull(model.getSnapshot());
         assertEquals(model.getSnapshot().getId(), 
transform.getSnapshot().getId());
         assertEquals("unexpected status", model.getStatus().getState(), 
transform.getStatus().getState());


-- 
To view, visit https://gerrit.ovirt.org/41966
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I952c431b8f7e7d0508855892b518c43bef9c7b7f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to