use of com.woorea.openstack.quantum.model.Subnet in project ovirt-engine by oVirt.
the class BaseNetworkProviderProxy method addSubnet.
@Override
public void addSubnet(ExternalSubnet subnet) {
com.woorea.openstack.quantum.model.Network externalNetwork = getExternalNetwork(subnet.getExternalNetwork());
Subnet subnetForCreate = createNewSubnetEntity(subnet, externalNetwork);
execute(getClient().subnets().create(subnetForCreate));
}
use of com.woorea.openstack.quantum.model.Subnet in project ovirt-engine by oVirt.
the class BaseNetworkProviderProxy method getAllSubnets.
@Override
public List<ExternalSubnet> getAllSubnets(ProviderNetwork network) {
List<ExternalSubnet> result = new ArrayList<>();
Subnets subnets = execute(getClient().subnets().list());
for (Subnet subnet : subnets.getList()) {
if (network.getExternalId().equals(subnet.getNetworkId())) {
result.add(map(subnet, network));
}
}
return result;
}
use of com.woorea.openstack.quantum.model.Subnet in project ovirt-engine by oVirt.
the class BaseNetworkProviderProxy method createNewSubnetEntity.
protected Subnet createNewSubnetEntity(ExternalSubnet subnet, com.woorea.openstack.quantum.model.Network externalNetwork) {
Subnet subnetForCreate = new Subnet();
subnetForCreate.setCidr(subnet.getCidr());
subnetForCreate.setIpversion(subnet.getIpVersion() == IpVersion.IPV6 ? Subnet.IpVersion.IPV6 : Subnet.IpVersion.IPV4);
subnetForCreate.setName(subnet.getName());
subnetForCreate.setNetworkId(externalNetwork.getId());
subnetForCreate.setEnableDHCP(true);
subnetForCreate.setGw(subnet.getGateway());
subnetForCreate.setDnsNames(subnet.getDnsServers());
subnetForCreate.setTenantId(externalNetwork.getTenantId());
return subnetForCreate;
}
Aggregations