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));
}
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());
}
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));
}
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;
}
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;
}
Aggregations