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