Search in sources :

Example 1 with InstanceType

use of org.ovirt.engine.api.model.InstanceType in project ovirt-engine by oVirt.

the class BackendInstanceTypeResourceTest method testConflictedUpdate.

@Test
public void testConflictedUpdate() throws Exception {
    setUriInfo(setUpBasicUriExpectations());
    setUpGetEntityExpectations(1);
    InstanceType model = getRestModel(1);
    model.setId(GUIDS[1].toString());
    try {
        resource.update(model);
        fail("expected WebApplicationException");
    } catch (WebApplicationException wae) {
        verifyImmutabilityConstraint(wae);
    }
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) InstanceType(org.ovirt.engine.api.model.InstanceType) Test(org.junit.Test)

Example 2 with InstanceType

use of org.ovirt.engine.api.model.InstanceType in project ovirt-engine by oVirt.

the class BackendInstanceTypesResourceTest method testAddIncompleteParameters.

@Test
public void testAddIncompleteParameters() throws Exception {
    InstanceType model = new InstanceType();
    setUriInfo(setUpBasicUriExpectations());
    try {
        collection.add(model);
        fail("expected WebApplicationException on incomplete parameters");
    } catch (WebApplicationException wae) {
        verifyIncompleteException(wae, "InstanceType", "add", "name");
    }
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) InstanceType(org.ovirt.engine.api.model.InstanceType) Test(org.junit.Test)

Example 3 with InstanceType

use of org.ovirt.engine.api.model.InstanceType in project ovirt-engine by oVirt.

the class BackendInstanceTypesResourceTest method getModel.

static InstanceType getModel(int index) {
    InstanceType model = new InstanceType();
    model.setName(NAMES[index]);
    model.setDescription(DESCRIPTIONS[index]);
    return model;
}
Also used : InstanceType(org.ovirt.engine.api.model.InstanceType)

Example 4 with InstanceType

use of org.ovirt.engine.api.model.InstanceType in project ovirt-engine by oVirt.

the class BackendInstanceTypeNicResource method addParents.

@Override
protected Nic addParents(Nic nic) {
    InstanceType instanceType = new InstanceType();
    instanceType.setId(instanceTypeId.toString());
    nic.setInstanceType(instanceType);
    return nic;
}
Also used : InstanceType(org.ovirt.engine.api.model.InstanceType)

Example 5 with InstanceType

use of org.ovirt.engine.api.model.InstanceType in project ovirt-engine by oVirt.

the class BackendInstanceTypeNicsResource method addParents.

@Override
public Nic addParents(Nic nic) {
    InstanceType instanceType = new InstanceType();
    instanceType.setId(instanceTypeId.toString());
    nic.setInstanceType(instanceType);
    return nic;
}
Also used : InstanceType(org.ovirt.engine.api.model.InstanceType)

Aggregations

InstanceType (org.ovirt.engine.api.model.InstanceType)15 Template (org.ovirt.engine.api.model.Template)3 GetVmTemplateParameters (org.ovirt.engine.core.common.queries.GetVmTemplateParameters)3 WebApplicationException (javax.ws.rs.WebApplicationException)2 Test (org.junit.Test)2 TimeZone (org.ovirt.engine.api.model.TimeZone)2 VM (org.ovirt.engine.core.common.businessentities.VM)2 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)2 ArrayList (java.util.ArrayList)1 Response (javax.ws.rs.core.Response)1 Boot (org.ovirt.engine.api.model.Boot)1 CustomProperties (org.ovirt.engine.api.model.CustomProperties)1 Display (org.ovirt.engine.api.model.Display)1 ExternalHostProvider (org.ovirt.engine.api.model.ExternalHostProvider)1 GuestOperatingSystem (org.ovirt.engine.api.model.GuestOperatingSystem)1 HighAvailability (org.ovirt.engine.api.model.HighAvailability)1 Host (org.ovirt.engine.api.model.Host)1 InstanceTypes (org.ovirt.engine.api.model.InstanceTypes)1 Kernel (org.ovirt.engine.api.model.Kernel)1 OperatingSystem (org.ovirt.engine.api.model.OperatingSystem)1