Gilad Chaplik has uploaded a new change for review.

Change subject: restapi: add disk profile to disk
......................................................................

restapi: add disk profile to disk

Change-Id: Ie16441ce28390c42a0f97ab7014aa3669964ae57
Signed-off-by: Gilad Chaplik <gchap...@redhat.com>
---
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
3 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/40/31840/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 c9d2198..e30c18a 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
@@ -3421,6 +3421,7 @@
           <xs:element name="lun_storage" type="Storage" minOccurs="0"/>
           <xs:element name="sgio" type="xs:string" minOccurs="0"/>
           <xs:element ref="snapshot" minOccurs="0" maxOccurs="1"/>
+          <xs:element ref="disk_profile" 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 bafe0ac..a79bd9a 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
@@ -667,6 +667,7 @@
           disk.propagate_errors: xs:boolean
           disk.wipe_after_delete: xs:boolean
           disk.quota.id: xs:string
+          disk.disk_profile.id: xs:string
           disk.sgio: xs:string
           disk.read_only: xs:boolean
           description: update the size, boot flag and other parameters of the 
disk attached to the virtual machine
@@ -691,6 +692,7 @@
           disk.propagate_errors: xs:boolean
           disk.wipe_after_delete: xs:boolean
           disk.quota.id: xs:string
+          disk.disk_profile.id: xs:string
           disk.storage_domains.storage_domain--COLLECTION: 
{storage_domain.id|name: '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.
@@ -1188,6 +1190,7 @@
           disk.propagate_errors: xs:boolean
           disk.wipe_after_delete: xs:boolean
           disk.quota.id: xs:string
+          disk.disk_profile.id: xs:string
           disk.storage_domains.storage_domain--COLLECTION: 
{storage_domain.id|name: '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.
@@ -4676,6 +4679,7 @@
           disk.propagate_errors: xs:boolean
           disk.wipe_after_delete: xs:boolean
           disk.quota.id: xs:string
+          disk.disk_profile.id: 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',
@@ -4768,6 +4772,7 @@
           disk.propagate_errors: xs:boolean
           disk.wipe_after_delete: xs:boolean
           disk.quota.id: xs:string
+          disk.disk_profile.id: 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 d1ed62a..26cca9a 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
@@ -6,6 +6,7 @@
 import org.ovirt.engine.api.model.Disk;
 import org.ovirt.engine.api.model.DiskFormat;
 import org.ovirt.engine.api.model.DiskInterface;
+import org.ovirt.engine.api.model.DiskProfile;
 import org.ovirt.engine.api.model.DiskStatus;
 import org.ovirt.engine.api.model.Quota;
 import org.ovirt.engine.api.model.ScsiGenericIO;
@@ -135,6 +136,9 @@
         if (disk.isSetQuota() && disk.getQuota().isSetId()) {
             diskImage.setQuotaId(GuidUtils.asGuid(disk.getQuota().getId()));
         }
+        if (disk.isSetDiskProfile() && disk.getDiskProfile().isSetId()) {
+            
diskImage.setDiskProfileId(GuidUtils.asGuid(disk.getDiskProfile().getId()));
+        }
     }
 
     @Mapping(from = org.ovirt.engine.core.common.businessentities.Disk.class, 
to = Disk.class)
@@ -203,6 +207,11 @@
             quota.setId(entity.getQuotaId().toString());
             model.setQuota(quota);
         }
+        if (entity.getDiskProfileId() != null) {
+            DiskProfile diskProfile = new DiskProfile();
+            diskProfile.setId(entity.getDiskProfileId().toString());
+            model.setDiskProfile(diskProfile);
+        }
     }
 
     @Mapping(from = DiskFormat.class, to = String.class)


-- 
To view, visit http://gerrit.ovirt.org/31840
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie16441ce28390c42a0f97ab7014aa3669964ae57
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to