Search in sources :

Example 1 with AddExternalSubnetParameters

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

the class BackendOpenStackSubnetsResource method add.

@Override
public Response add(OpenStackSubnet subnet) {
    AddExternalSubnetParameters parameters = new AddExternalSubnetParameters();
    parameters.setSubnet(map(subnet));
    parameters.setProviderId(asGuid(providerId));
    parameters.setNetworkId(networkId);
    return performCreate(ActionType.AddSubnetToProvider, parameters, new SubnetNameResolver(subnet.getName()));
}
Also used : AddExternalSubnetParameters(org.ovirt.engine.core.common.action.AddExternalSubnetParameters)

Example 2 with AddExternalSubnetParameters

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

the class NewExternalSubnetModel method onSave.

private void onSave() {
    if (!validate()) {
        return;
    }
    // Save changes.
    flush();
    startProgress();
    ProviderNetwork providedBy = getNetwork().getEntity().getProvidedBy();
    Frontend.getInstance().runAction(ActionType.AddSubnetToProvider, new AddExternalSubnetParameters(getSubnetModel().getSubnet(), providedBy.getProviderId(), providedBy.getExternalId()), result -> {
        ActionReturnValue returnValue = result.getReturnValue();
        stopProgress();
        if (returnValue != null && returnValue.getSucceeded()) {
            cancel();
        }
    }, this, true);
}
Also used : AddExternalSubnetParameters(org.ovirt.engine.core.common.action.AddExternalSubnetParameters) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)

Example 3 with AddExternalSubnetParameters

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

the class AddNetworkWithSubnetOnProviderCommand method postAddNetwork.

@Override
protected void postAddNetwork(Guid providerId, String externalId) {
    ExternalSubnet externalSubnet = getParameters().getExternalSubnet();
    if (externalSubnet != null) {
        AddExternalSubnetParameters subnetParameters = new AddExternalSubnetParameters(externalSubnet, providerId, externalId);
        backend.runInternalMultipleActions(ActionType.AddSubnetToProvider, Arrays.asList(subnetParameters));
    }
}
Also used : AddExternalSubnetParameters(org.ovirt.engine.core.common.action.AddExternalSubnetParameters) ExternalSubnet(org.ovirt.engine.core.common.businessentities.network.ExternalSubnet)

Aggregations

AddExternalSubnetParameters (org.ovirt.engine.core.common.action.AddExternalSubnetParameters)3 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 ExternalSubnet (org.ovirt.engine.core.common.businessentities.network.ExternalSubnet)1 ProviderNetwork (org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)1