private org.ovirt.engine.core.common.businessentities.VM getVmConfiguration(Guid snapshotId) { org.ovirt.engine.core.common.businessentities.VM vmConfiguration = getEntity(org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmConfigurationBySnapshot, new IdQueryParameters(snapshotId), ""); return vmConfiguration; }
@Override public Permission get() { return performGet(QueryType.GetPermissionById, new IdQueryParameters(guid), suggestedParentType); }
public BackendGroupAssignedPermissionsResourceTest() { super(GUIDS[1], QueryType.GetPermissionsByAdElementId, new IdQueryParameters(GUIDS[1]), Group.class, "Group.Id", "Id"); }
@Override public Snapshots list() { return mapCollection(getBackendCollection(QueryType.GetAllVmSnapshotsByVmId, new IdQueryParameters(parentId))); }
public void getNumberOfImagesOnStorageDomain(AsyncQuery<Long> aQuery, Guid storageDomainId) { aQuery.converterCallback = source -> (Long) source; IdQueryParameters params = new IdQueryParameters(storageDomainId); Frontend.getInstance().runQuery(QueryType.GetNumberOfImagesByStorageDomainId, params, aQuery); }
public void getNumberOfVmsInCluster(AsyncQuery aQuery, Guid clusterId) { Frontend.getInstance().runQuery(QueryType.GetNumberOfVmsInClusterByClusterId, new IdQueryParameters(clusterId), aQuery); }
@Override public DiskSnapshots list() { return mapCollection(getBackendCollection(QueryType.GetAllDiskSnapshotsByStorageDomainId, new IdQueryParameters(this.storageDomainId))); }
private org.ovirt.engine.core.common.businessentities.profiles.CpuProfile getCpuProfile(String id) { return getEntity( org.ovirt.engine.core.common.businessentities.profiles.CpuProfile.class, QueryType.GetCpuProfileById, new IdQueryParameters(asGuidOr404(id)), "CpuProfiles" ); }
private org.ovirt.engine.core.common.businessentities.Permission getPermissions() { return getEntity( org.ovirt.engine.core.common.businessentities.Permission.class, QueryType.GetPermissionById, new IdQueryParameters(guid), guid.toString() ); } }
@Override public org.ovirt.engine.core.common.businessentities.storage.Disk lookupEntity(Guid id) throws BackendFailureException { return getEntity( org.ovirt.engine.core.common.businessentities.storage.Disk.class, QueryType.GetDiskByDiskId, new IdQueryParameters(id), id.toString(), false ); } }
/** * Finds the provider that corresponds to the given identifier. * * @param resource the resource that will be used to perform the required queries * @param id the identifier of the provider * @return the reference to the provider or {@code null} if no such provider exists */ public static Provider getProvider(BackendResource resource, String id) { Guid guid = Guid.createGuidFromString(id); IdQueryParameters parameters = new IdQueryParameters(guid); return resource.getEntity(Provider.class, QueryType.GetProviderById, parameters, id, true); }
@SuppressWarnings("unchecked") protected List<org.ovirt.engine.core.common.businessentities.network.Network> getClusterNetworks(){ VDS vds = getEntity(VDS.class, QueryType.GetVdsByVdsId, new IdQueryParameters(Guid.createGuidFromStringDefaultEmpty(getHostId())), "Host"); return getEntity(List.class, QueryType.GetAllNetworksByClusterId, new IdQueryParameters(vds.getClusterId()), "Networks"); }
public void getStorageDevices(AsyncQuery<List<StorageDevice>> aQuery, Guid hostId) { aQuery.converterCallback = new CastingConverter<>(); Frontend.getInstance().runQuery(QueryType.GetGlusterStorageDevices, new IdQueryParameters(hostId), aQuery); }
public DbUser getUserById(Guid userId) { IdQueryParameters queryParameters = new IdQueryParameters(userId); QueryReturnValue userQueryResponse = runQuery(QueryType.GetAnyDbUserByUserId, queryParameters); DbUser returnValue = null; if (userQueryResponse != null && userQueryResponse.getSucceeded()) { returnValue = userQueryResponse.getReturnValue(); } return returnValue; }
@Override public Response resetEmulatedMachine(Action action) { QueryReturnValue result = runQuery(QueryType.GetClusterById, new IdQueryParameters(guid)); if (result != null && result.getSucceeded() && result.getReturnValue() != null) { ManagementNetworkOnClusterOperationParameters param = new ManagementNetworkOnClusterOperationParameters(result.getReturnValue()); param.setForceResetEmulatedMachine(true); return doAction(ActionType.UpdateCluster, param, action); } else { throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build()); } }
@Override protected void syncSearch() { if (getEntity() != null) { super.syncSearch(queryType, new IdQueryParameters(getEntity().getId())); } }
private void checkForQuotaInDC(StoragePool storage_pool, final ICommandTarget commandTarget) { IdQueryParameters parameters = new IdQueryParameters(storage_pool.getId()); Frontend.getInstance().runQuery(QueryType.GetQuotaByStoragePoolId, parameters, new AsyncQuery<QueryReturnValue>(returnValue -> { if (((ArrayList<Quota>) returnValue.getReturnValue()).size() == 0) { promptNoQuotaInDCMessage(); } else { onSaveInternal(); } })); }
@Override public AffinityLabels list() { AffinityLabels affinityLabels = mapCollection( getBackendCollection(QueryType.GetLabelByEntityId, new IdQueryParameters(GuidUtils.asGuid(parentId)))); for (AffinityLabel affinityLabel : affinityLabels.getAffinityLabels()) { linkSubCollections(affinityLabel); } return affinityLabels; }
@Override protected void validateParameters(DiskProfile diskProfile) { validateParameters(diskProfile, "name", "storageDomain.id"); String storageId = diskProfile.getStorageDomain().getId(); // verify the storagedomain.id is well provided getEntity(StorageDomain.class, QueryType.GetStorageDomainById, new IdQueryParameters(asGuid(storageId)), "storagedomain: id=" + storageId); }
public Disks list() { boolean unregistered = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, UNREGISTERED, true, false); if (unregistered) { Guid dataCenterId = BackendDataCenterHelper.lookupByStorageDomainId(this, storageDomainId); return mapCollection(getBackendCollection(QueryType.GetUnregisteredDisks, new GetUnregisteredDisksQueryParameters(storageDomainId, dataCenterId))); } else { return mapCollection(getBackendCollection(QueryType.GetAllDisksByStorageDomainId, new IdQueryParameters(storageDomainId))); } }