use of org.ovirt.engine.core.common.queries.GetVmFromConfigurationQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getVmFromOva.
public void getVmFromOva(AsyncQuery<QueryReturnValue> aQuery, String ovf) {
aQuery.setHandleFailure(true);
Frontend.getInstance().runQuery(QueryType.GetVmFromConfiguration, new GetVmFromConfigurationQueryParameters(ConfigurationType.OVA, ovf), aQuery);
}
use of org.ovirt.engine.core.common.queries.GetVmFromConfigurationQueryParameters in project ovirt-engine by oVirt.
the class BackendVmsResource method importVmFromConfiguration.
public Response importVmFromConfiguration(Vm vm) {
Initialization initialization = vm.getInitialization();
Configuration config = initialization.getConfiguration();
org.ovirt.engine.core.common.businessentities.VM vmConfiguration = getEntity(org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmFromConfiguration, new GetVmFromConfigurationQueryParameters(VmMapper.map(config.getType(), null), config.getData().trim()), "");
VmMapper.map(vm, vmConfiguration.getStaticData());
Guid clusterId = namedCluster(vm) ? getCluster(vm).getId() : asGuid(vm.getCluster().getId());
ImportVmFromConfParameters parameters = new ImportVmFromConfParameters();
parameters.setVm(vmConfiguration);
parameters.setClusterId(clusterId);
if (initialization.isSetRegenerateIds()) {
parameters.setImportAsNewEntity(initialization.isRegenerateIds());
}
return performCreate(ActionType.ImportVmFromConfiguration, parameters, new QueryIdResolver<Guid>(QueryType.GetVmByVmId, IdQueryParameters.class));
}
Aggregations