Search in sources :

Example 1 with CpuProfileParameters

use of org.ovirt.engine.core.common.action.CpuProfileParameters in project ovirt-engine by oVirt.

the class AbstractBackendCpuProfilesResource method add.

protected Response add(CpuProfile cpuProfile) {
    validateParameters(cpuProfile);
    CpuProfileParameters parameters = new CpuProfileParameters();
    org.ovirt.engine.core.common.businessentities.profiles.CpuProfile map = map(cpuProfile);
    parameters.setProfile(map);
    parameters.setAddPermissions(true);
    return performCreate(ActionType.AddCpuProfile, parameters, new QueryIdResolver<Guid>(QueryType.GetCpuProfileById, IdQueryParameters.class));
}
Also used : IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) CpuProfileParameters(org.ovirt.engine.core.common.action.CpuProfileParameters) Guid(org.ovirt.engine.core.compat.Guid)

Example 2 with CpuProfileParameters

use of org.ovirt.engine.core.common.action.CpuProfileParameters in project ovirt-engine by oVirt.

the class AddClusterCommand method addDefaultCpuProfile.

private void addDefaultCpuProfile() {
    CpuProfile cpuProfile = CpuProfileHelper.createCpuProfile(getParameters().getCluster().getId(), getParameters().getCluster().getName());
    CpuProfileParameters cpuProfileAddParameters = new CpuProfileParameters(cpuProfile);
    cpuProfileAddParameters.setAddPermissions(true);
    cpuProfileAddParameters.setParametersCurrentUser(getCurrentUser());
    cpuProfileAddParameters.setSessionId(getContext().getEngineContext().getSessionId());
    ActionReturnValue addCpuProfileReturnValue = backend.runAction(ActionType.AddCpuProfile, cpuProfileAddParameters);
    cpuProfile.setId(addCpuProfileReturnValue.getActionReturnValue());
}
Also used : ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile) CpuProfileParameters(org.ovirt.engine.core.common.action.CpuProfileParameters)

Example 3 with CpuProfileParameters

use of org.ovirt.engine.core.common.action.CpuProfileParameters in project ovirt-engine by oVirt.

the class AbstractBackendCpuProfileResource method remove.

public Response remove() {
    get();
    org.ovirt.engine.core.common.businessentities.profiles.CpuProfile cpuProfile = getCpuProfile(id);
    return performAction(ActionType.RemoveCpuProfile, new CpuProfileParameters(cpuProfile));
}
Also used : CpuProfileParameters(org.ovirt.engine.core.common.action.CpuProfileParameters)

Example 4 with CpuProfileParameters

use of org.ovirt.engine.core.common.action.CpuProfileParameters in project ovirt-engine by oVirt.

the class CpuProfileBaseModel method getParameters.

@Override
protected ProfileParametersBase<CpuProfile> getParameters() {
    CpuProfileParameters cpuProfileParameters = new CpuProfileParameters(getProfile());
    cpuProfileParameters.setAddPermissions(true);
    return cpuProfileParameters;
}
Also used : CpuProfileParameters(org.ovirt.engine.core.common.action.CpuProfileParameters)

Example 5 with CpuProfileParameters

use of org.ovirt.engine.core.common.action.CpuProfileParameters in project ovirt-engine by oVirt.

the class AddCpuProfileCommandTest method createParameters.

private static CpuProfileParameters createParameters() {
    CpuProfile cpuProfile = CpuProfileHelper.createCpuProfile(CLUSTER_ID, PROFILE_NAME);
    CpuProfileParameters parameters = new CpuProfileParameters(cpuProfile);
    parameters.setCorrelationId(CORRELATION_ID);
    parameters.setAddPermissions(true);
    parameters.setSessionId(SESSION_ID);
    return parameters;
}
Also used : CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile) CpuProfileParameters(org.ovirt.engine.core.common.action.CpuProfileParameters)

Aggregations

CpuProfileParameters (org.ovirt.engine.core.common.action.CpuProfileParameters)5 CpuProfile (org.ovirt.engine.core.common.businessentities.profiles.CpuProfile)2 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1 Guid (org.ovirt.engine.core.compat.Guid)1