Search in sources :

Example 1 with DiskProfileParameters

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

the class StorageDomainCommandBase method createDefaultDiskProfile.

/**
 * Creates default disk profile for existing storage domain.
 */
protected void createDefaultDiskProfile() {
    executeInNewTransaction(() -> {
        final DiskProfile diskProfile = diskProfileHelper.createDiskProfile(getStorageDomain().getId(), getStorageDomainName());
        DiskProfileParameters diskProfileParameters = new DiskProfileParameters(diskProfile, true);
        runInternalActionWithTasksContext(ActionType.AddDiskProfile, diskProfileParameters);
        getCompensationContext().snapshotNewEntity(diskProfile);
        getCompensationContext().stateChanged();
        return null;
    });
}
Also used : DiskProfileParameters(org.ovirt.engine.core.common.action.DiskProfileParameters) DiskProfile(org.ovirt.engine.core.common.businessentities.profiles.DiskProfile)

Example 2 with DiskProfileParameters

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

the class AbstractBackendDiskProfileResource method remove.

public Response remove() {
    get();
    org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile = getDiskProfile(id);
    return performAction(ActionType.RemoveDiskProfile, new DiskProfileParameters(diskProfile));
}
Also used : DiskProfileParameters(org.ovirt.engine.core.common.action.DiskProfileParameters)

Example 3 with DiskProfileParameters

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

the class AbstractBackendDiskProfilesResource method add.

protected Response add(DiskProfile diskProfile) {
    validateParameters(diskProfile);
    org.ovirt.engine.core.common.businessentities.profiles.DiskProfile map = map(diskProfile);
    DiskProfileParameters parameters = new DiskProfileParameters(map);
    return performCreate(ActionType.AddDiskProfile, parameters, new QueryIdResolver<Guid>(QueryType.GetDiskProfileById, IdQueryParameters.class));
}
Also used : DiskProfileParameters(org.ovirt.engine.core.common.action.DiskProfileParameters) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) Guid(org.ovirt.engine.core.compat.Guid)

Aggregations

DiskProfileParameters (org.ovirt.engine.core.common.action.DiskProfileParameters)3 DiskProfile (org.ovirt.engine.core.common.businessentities.profiles.DiskProfile)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1 Guid (org.ovirt.engine.core.compat.Guid)1