public static Snapshot map(String configuration, ConfigurationType type, Snapshot snapshot) { snapshot.setInitialization(new Initialization()); snapshot.getInitialization().setConfiguration(new Configuration()); snapshot.getInitialization().getConfiguration().setData(configuration); snapshot.getInitialization().getConfiguration().setType(type); return snapshot; } }
public LinkBuilder requestParameter(final String requestParameter) { org.ovirt.engine.api.model.Body body = new org.ovirt.engine.api.model.Body(); body.setType(requestParameter); Request request = new Request(); request.setBody(body); link.setRequest(request); return this; } public LinkBuilder responseType(final String responseType) {
public static boolean isLunDisk(Disk disk) { return disk.isSetLunStorage() && disk.getLunStorage().isSetLogicalUnits() && disk.getLunStorage().getLogicalUnits().isSetLogicalUnits(); } }
private GlusterBrick clone(GlusterBrick brick) { //Needed to avoid NPE in LinkHelper due to unsetting of grandparent in LinkHelper#addLinks. GlusterBrick cloned = new GlusterBrick(); cloned.setId(brick.getId()); cloned.setGlusterVolume(new GlusterVolume()); cloned.getGlusterVolume().setId(brick.getGlusterVolume().getId()); cloned.getGlusterVolume().setCluster(new Cluster()); cloned.getGlusterVolume().getCluster().setId(brick.getGlusterVolume().getCluster().getId()); return cloned; }
private IscsiDetails mapLogicalUnitToIscsiDetails(LogicalUnit logicalUnit) { IscsiDetails iscsiDetails = new IscsiDetails(); iscsiDetails.setAddress(logicalUnit.getAddress()); iscsiDetails.setPort(logicalUnit.getPort()); iscsiDetails.setTarget(logicalUnit.getTarget()); iscsiDetails.setPortal(logicalUnit.getPortal()); iscsiDetails.setPaths(logicalUnit.getPaths()); iscsiDetails.setVendorId(logicalUnit.getVendorId()); iscsiDetails.setProductId(logicalUnit.getProductId()); iscsiDetails.setSerial(logicalUnit.getSerial()); return iscsiDetails; }
static org.ovirt.engine.api.model.Cluster getModel(int index) { org.ovirt.engine.api.model.Cluster model = new org.ovirt.engine.api.model.Cluster(); model.setName(NAMES[index]); model.setDescription(DESCRIPTIONS[index]); model.setDataCenter(new DataCenter()); model.setCpu(new Cpu()); model.getCpu().setType("Intel Xeon"); return model; }
@Override protected ReportedDevice postPopulate(ReportedDevice model) { model.setType(ReportedDeviceType.NETWORK); for (Ip ip : model.getIps().getIps()) { ip.setVersion(IpVersion.V4); ip.setGateway(null); ip.setNetmask(null); } return model; }
@Override public VnicProfile addParents(VnicProfile vnicProfile) { vnicProfile.setNetwork(new Network()); vnicProfile.getNetwork().setId(networkId); return vnicProfile; }
@Override protected Filter postPopulate(Filter model) { model.setId(ID); SchedulingPolicyUnit schedulingPolicyUnit = new SchedulingPolicyUnit(); schedulingPolicyUnit.setId(ID); model.setSchedulingPolicyUnit(schedulingPolicyUnit); model.setPosition(0); return model; }
private static Network getModelNetwork(NetworkAttachment model) { Network network = model.getNetwork(); if (network == null) { network = new Network(); model.setNetwork(network); } return network; } }
@Override public Network addParents(Network network) { network.setCluster(new org.ovirt.engine.api.model.Cluster()); network.getCluster().setId(clusterId); return network; }
private OpenstackVolumeAuthenticationKey addProvider(OpenstackVolumeAuthenticationKey authenticationKey) { OpenStackVolumeProvider provider = new OpenStackVolumeProvider(); provider.setId(providerId); authenticationKey.setOpenstackVolumeProvider(provider); return authenticationKey; }
@Override protected void updateIncomingId(Balance incoming) { incoming.setId(incoming.getSchedulingPolicyUnit().getId()); } }
public DetailedLink build() { if (!link.getRequest().isSetBody()) { link.getRequest().setBody(new org.ovirt.engine.api.model.Body()); } return addParametersMetadata(link); } }
public static boolean foundOnlyDeprecatedVnicProfileMapping(Action action) { return action.isSetVnicProfileMappings() && (!action.isSetRegistrationConfiguration() || !action.getRegistrationConfiguration().isSetVnicProfileMappings()); } }
public LinkBuilder responseType(final String responseType) { Response response = new Response(); response.setType(responseType); link.setResponse(response); return this; } public LinkBuilder httpMethod(HttpMethod httpMethod) {
static org.ovirt.engine.api.model.Cluster getModel(int index) { org.ovirt.engine.api.model.Cluster model = new org.ovirt.engine.api.model.Cluster(); model.setName(NAMES[index]); model.setDescription(DESCRIPTIONS[index]); model.setDataCenter(new DataCenter()); model.setCpu(new Cpu()); model.getCpu().setType("Intel Xeon"); return model; }