Search in sources :

Example 11 with Option

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

the class BackendGlusterVolumeResourceTest method testResetOption.

@Test
public void testResetOption() throws Exception {
    setupParentExpectations();
    resource.setParent(volumesResourceMock);
    setUriInfo(setUpActionExpectations(ActionType.ResetGlusterVolumeOptions, ResetGlusterVolumeOptionsParameters.class, new String[] { "VolumeId" }, new Object[] { GUIDS[0] }));
    Action action = new Action();
    action.setOption(new Option());
    action.getOption().setName("auth.allow");
    verifyActionResponse(resource.resetOption(action));
}
Also used : Action(org.ovirt.engine.api.model.Action) Option(org.ovirt.engine.api.model.Option) ResetGlusterVolumeOptionsParameters(org.ovirt.engine.core.common.action.gluster.ResetGlusterVolumeOptionsParameters) Test(org.junit.Test) AbstractBackendSubResourceTest(org.ovirt.engine.api.restapi.resource.AbstractBackendSubResourceTest)

Example 12 with Option

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

the class BackendGlusterVolumeResource method setOption.

@Override
public Response setOption(Action action) {
    Option option = action.getOption();
    validateParameters(option, "name", "value");
    return doAction(ActionType.SetGlusterVolumeOption, new GlusterVolumeOptionParameters(new GlusterVolumeOptionEntity(guid, option.getName(), option.getValue())), action);
}
Also used : GlusterVolumeOptionParameters(org.ovirt.engine.core.common.action.gluster.GlusterVolumeOptionParameters) Option(org.ovirt.engine.api.model.Option) GlusterVolumeOptionEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity)

Example 13 with Option

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

the class HostMapper method map.

@Mapping(from = Map.Entry.class, to = Option.class)
public static Option map(Map.Entry<String, String> entity, Option template) {
    Option model = template != null ? template : new Option();
    model.setName(entity.getKey());
    model.setValue(entity.getValue());
    return model;
}
Also used : Option(org.ovirt.engine.api.model.Option)

Aggregations

Option (org.ovirt.engine.api.model.Option)13 Test (org.junit.Test)4 Action (org.ovirt.engine.api.model.Action)4 AbstractBackendSubResourceTest (org.ovirt.engine.api.restapi.resource.AbstractBackendSubResourceTest)4 Options (org.ovirt.engine.api.model.Options)3 WebApplicationException (javax.ws.rs.WebApplicationException)2 GlusterVolumeOptionParameters (org.ovirt.engine.core.common.action.gluster.GlusterVolumeOptionParameters)2 GlusterVolumeOptionEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors.joining (java.util.stream.Collectors.joining)1 StringUtils (org.apache.commons.lang.StringUtils)1 Bonding (org.ovirt.engine.api.model.Bonding)1 BootProtocol (org.ovirt.engine.api.model.BootProtocol)1 GlusterVolume (org.ovirt.engine.api.model.GlusterVolume)1 HostNic (org.ovirt.engine.api.model.HostNic)1 HostNicVirtualFunctionsConfiguration (org.ovirt.engine.api.model.HostNicVirtualFunctionsConfiguration)1 Ip (org.ovirt.engine.api.model.Ip)1 IpVersion (org.ovirt.engine.api.model.IpVersion)1 Mac (org.ovirt.engine.api.model.Mac)1