use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class BackendExternalVmImportsResourceTest method createVmImport.
private ExternalVmImport createVmImport() {
File file = new File();
file.setId(DRIVERS_ISO);
ExternalVmImport vmImport = new ExternalVmImport();
vmImport.setName(EXTERNAL_VM_NAME);
vmImport.setVm(new Vm());
vmImport.getVm().setName(CREATED_VM_NAME);
vmImport.setCluster(new Cluster());
vmImport.getCluster().setId(CLUSTER_ID.toString());
vmImport.setStorageDomain(new StorageDomain());
vmImport.getStorageDomain().setId(STORAGE_DOMAIN_ID.toString());
vmImport.setHost(new Host());
vmImport.getHost().setId(HOST_ID.toString());
vmImport.setSparse(true);
vmImport.setProvider(ExternalVmProviderType.VMWARE);
vmImport.setDriversIso(file);
vmImport.setUsername(USERNAME);
vmImport.setPassword(PASSWORD);
vmImport.setUrl(VMWARE_URL);
return vmImport;
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class StorageDomainLeaseMapper method map.
public static StorageDomainLease map(Guid storageDomainId) {
if (storageDomainId != null) {
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(storageDomainId.toString());
StorageDomainLease lease = new StorageDomainLease();
lease.setStorageDomain(storageDomain);
return lease;
}
return null;
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class QuotaMapper method map.
private static void map(QuotaStorageLimit model, QuotaStorage quotaStorage, String storageDomainId, String dataCenterId, String quotaId) {
model.setQuota(new Quota());
model.getQuota().setId(quotaId);
model.getQuota().setDataCenter(new DataCenter());
model.getQuota().getDataCenter().setId(dataCenterId);
if (storageDomainId != null) {
model.setStorageDomain(new StorageDomain());
model.getStorageDomain().setId(storageDomainId);
}
if (quotaStorage.getStorageSizeGB() != null) {
model.setLimit(quotaStorage.getStorageSizeGB());
}
if (quotaStorage.getStorageSizeGBUsage() != null) {
model.setUsage(quotaStorage.getStorageSizeGBUsage());
}
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class LinkHelperTest method testFileLinks.
@Test
public void testFileLinks() throws Exception {
File file = new File();
file.setId(FILE_ID);
file.setStorageDomain(new StorageDomain());
file.getStorageDomain().setId(STORAGE_DOMAIN_ID);
LinkHelper.addLinks(file);
assertEquals(FILE_HREF, file.getHref());
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class LinkHelperTest method testStorageDomainLinks.
@Test
public void testStorageDomainLinks() throws Exception {
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(STORAGE_DOMAIN_ID);
storageDomain.setStorage(new HostStorage());
storageDomain.getStorage().setPath("foo");
LinkHelper.addLinks(storageDomain);
assertEquals(STORAGE_DOMAIN_HREF, storageDomain.getHref());
assertNull(storageDomain.getStorage().getHref());
}
Aggregations