Search in sources :

Example 1 with AddVnicProfileParameters

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

the class NewVnicProfileModel method getActionParameters.

@Override
protected ActionParametersBase getActionParameters() {
    AddVnicProfileParameters parameters = new AddVnicProfileParameters(getProfile());
    parameters.setPublicUse(getPublicUse().getEntity());
    return parameters;
}
Also used : AddVnicProfileParameters(org.ovirt.engine.core.common.action.AddVnicProfileParameters)

Example 2 with AddVnicProfileParameters

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

the class AbstractBackendVnicProfilesResource method add.

protected Response add(VnicProfile vnicProfile) {
    validateParameters(vnicProfile);
    AddVnicProfileParameters addVnicProfileParameters = new AddVnicProfileParameters(map(vnicProfile), !vnicProfile.isSetNetworkFilter());
    return performCreate(ActionType.AddVnicProfile, addVnicProfileParameters, new QueryIdResolver<Guid>(QueryType.GetVnicProfileById, IdQueryParameters.class));
}
Also used : IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) AddVnicProfileParameters(org.ovirt.engine.core.common.action.AddVnicProfileParameters) Guid(org.ovirt.engine.core.compat.Guid)

Example 3 with AddVnicProfileParameters

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

the class AddNetworkCommand method runAddVnicProfile.

private void runAddVnicProfile() {
    if (getNetwork().isVmNetwork() && getParameters().isVnicProfileRequired()) {
        VnicProfile vnicProfile = networkHelper.createVnicProfile(getNetwork());
        AddVnicProfileParameters vnicProfileParameters = new AddVnicProfileParameters(vnicProfile);
        vnicProfileParameters.setPublicUse(getParameters().isVnicProfilePublicUse());
        runInternalAction(ActionType.AddVnicProfile, vnicProfileParameters, getContext().clone().withoutLock());
    }
}
Also used : VnicProfile(org.ovirt.engine.core.common.businessentities.network.VnicProfile) AddVnicProfileParameters(org.ovirt.engine.core.common.action.AddVnicProfileParameters)

Example 4 with AddVnicProfileParameters

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

the class NetworkModel method performProfilesActions.

private void performProfilesActions(Guid networkGuid) {
    List<VnicProfileModel> profileModels = (List<VnicProfileModel>) getProfiles().getItems();
    if (profileModels.isEmpty() || !getProfiles().getIsAvailable()) {
        return;
    }
    networkGuid = networkGuid == null ? getNetwork().getId() : networkGuid;
    ArrayList<ActionParametersBase> paramlist = new ArrayList<>();
    for (VnicProfileModel profileModel : profileModels) {
        if (!StringHelper.isNullOrEmpty(profileModel.getProfile().getName())) {
            VnicProfile vnicProfile = profileModel.getProfile();
            vnicProfile.setNetworkId(networkGuid);
            AddVnicProfileParameters parameters = new AddVnicProfileParameters(vnicProfile, true);
            parameters.setPublicUse(profileModel.getPublicUse().getEntity());
            paramlist.add(parameters);
        }
    }
    Frontend.getInstance().runMultipleActions(ActionType.AddVnicProfile, paramlist, // cast is required to avoid overload ambiguity
    (IFrontendActionAsyncCallback) null);
}
Also used : ArrayList(java.util.ArrayList) VnicProfile(org.ovirt.engine.core.common.businessentities.network.VnicProfile) List(java.util.List) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) AddVnicProfileParameters(org.ovirt.engine.core.common.action.AddVnicProfileParameters) NewVnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel) VnicProfileModel(org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Aggregations

AddVnicProfileParameters (org.ovirt.engine.core.common.action.AddVnicProfileParameters)4 VnicProfile (org.ovirt.engine.core.common.businessentities.network.VnicProfile)2 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1 Guid (org.ovirt.engine.core.compat.Guid)1 NewVnicProfileModel (org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel)1 VnicProfileModel (org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel)1