Search in sources :

Example 1 with OpenStackNetwork

use of org.ovirt.engine.api.model.OpenStackNetwork in project ovirt-engine by oVirt.

the class BackendOpenStackSubnetResource method addParents.

@Override
protected OpenStackSubnet addParents(OpenStackSubnet subnet) {
    OpenStackNetworkProvider provider = new OpenStackNetworkProvider();
    provider.setId(providerId);
    OpenStackNetwork network = new OpenStackNetwork();
    network.setId(networkId);
    network.setOpenstackNetworkProvider(provider);
    subnet.setOpenstackNetwork(network);
    return super.addParents(subnet);
}
Also used : OpenStackNetworkProvider(org.ovirt.engine.api.model.OpenStackNetworkProvider) OpenStackNetwork(org.ovirt.engine.api.model.OpenStackNetwork)

Example 2 with OpenStackNetwork

use of org.ovirt.engine.api.model.OpenStackNetwork in project ovirt-engine by oVirt.

the class BackendOpenStackSubnetsResource method addParents.

@Override
protected OpenStackSubnet addParents(OpenStackSubnet subnet) {
    OpenStackNetworkProvider provider = new OpenStackNetworkProvider();
    provider.setId(providerId);
    OpenStackNetwork network = new OpenStackNetwork();
    network.setId(networkId);
    network.setOpenstackNetworkProvider(provider);
    subnet.setOpenstackNetwork(network);
    return super.addParents(subnet);
}
Also used : OpenStackNetworkProvider(org.ovirt.engine.api.model.OpenStackNetworkProvider) OpenStackNetwork(org.ovirt.engine.api.model.OpenStackNetwork)

Example 3 with OpenStackNetwork

use of org.ovirt.engine.api.model.OpenStackNetwork in project ovirt-engine by oVirt.

the class OpenStackNetworkMapper method map.

@Mapping(from = Network.class, to = OpenStackNetwork.class)
public static OpenStackNetwork map(Network entity, OpenStackNetwork template) {
    OpenStackNetwork model = template != null ? template : new OpenStackNetwork();
    ProviderNetwork providedBy = entity.getProvidedBy();
    if (providedBy != null) {
        if (providedBy.getExternalId() != null) {
            model.setId(providedBy.getExternalId());
        }
    }
    if (entity.getName() != null) {
        model.setName(entity.getName());
    }
    return model;
}
Also used : ProviderNetwork(org.ovirt.engine.core.common.businessentities.network.ProviderNetwork) OpenStackNetwork(org.ovirt.engine.api.model.OpenStackNetwork) Mapping(org.ovirt.engine.api.restapi.types.Mapping)

Aggregations

OpenStackNetwork (org.ovirt.engine.api.model.OpenStackNetwork)3 OpenStackNetworkProvider (org.ovirt.engine.api.model.OpenStackNetworkProvider)2 Mapping (org.ovirt.engine.api.restapi.types.Mapping)1 ProviderNetwork (org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)1