Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions api/src/main/java/com/cloud/network/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,6 @@ public void setIp6Address(String ip6Address) {

boolean isStrechedL2Network();

String getExternalId();

PVlanType getPvlanType();

String getRouterIp();
Expand Down
7 changes: 0 additions & 7 deletions api/src/main/java/com/cloud/network/NetworkProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public class NetworkProfile implements Network {
private Long networkAclId;
private final String guruName;
private boolean strechedL2Subnet;
private String externalId;
private Integer networkCidrSize;

public NetworkProfile(Network network) {
Expand Down Expand Up @@ -99,7 +98,6 @@ public NetworkProfile(Network network) {
strechedL2Subnet = network.isStrechedL2Network();
isRedundant = network.isRedundant();
isRollingRestart = network.isRollingRestart();
externalId = network.getExternalId();
networkCidrSize = network.getNetworkCidrSize();
}

Expand Down Expand Up @@ -345,11 +343,6 @@ public boolean isStrechedL2Network() {
return false;
}

@Override
public String getExternalId() {
return externalId;
}

@Override
public PVlanType getPvlanType() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ public class CreateNetworkCmd extends BaseCmd implements UserCmd {
@Parameter(name = ApiConstants.IP6_CIDR, type = CommandType.STRING, description = "The CIDR of IPv6 network, must be at least /64")
private String ip6Cidr;

@Parameter(name = ApiConstants.EXTERNAL_ID, type = CommandType.STRING, description = "ID of the network in an external system.")
private String externalId;

@Parameter(name = ApiConstants.DISPLAY_NETWORK,
type = CommandType.BOOLEAN,
description = "An optional field, whether to the display the network to the end User or not.", authorized = {RoleType.Admin})
Expand Down Expand Up @@ -266,10 +263,6 @@ public Boolean getDisplayNetwork() {
return displayNetwork;
}

public String getExternalId() {
return externalId;
}

public String getIsolatedPvlanType() {
return isolatedPvlanType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ public void testGetDisplayNetwork() {
Assert.assertEquals(cmd.getDisplayNetwork(), displayNet);
}

@Test
public void testGetExternalId() {
String externalId = "1";
ReflectionTestUtils.setField(cmd, "externalId", externalId);
Assert.assertEquals(cmd.getExternalId(), externalId);
}

@Test
public void testGetAssociatedNetworkId() {
Long associatedNetId = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void prepare(VirtualMachineProfile profile, DeployDestination dest, ReservationC

Network createGuestNetwork(long networkOfferingId, String name, String displayText, String gateway, String cidr, String vlanId, boolean bypassVlanOverlapCheck, String networkDomain, Account owner,
Long domainId, PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Boolean subdomainAccess, Long vpcId, String ip6Gateway, String ip6Cidr,
Boolean displayNetworkEnabled, String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId, String routerIp, String routerIpv6,
Boolean displayNetworkEnabled, String isolatedPvlan, Network.PVlanType isolatedPvlanType, String routerIp, String routerIpv6,
String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2, Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException;

UserDataServiceProvider getPasswordResetProvider(Network network);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public interface VpcManager {
Network
createVpcGuestNetwork(long ntwkOffId, String name, String displayText, String gateway, String cidr, String vlanId, String networkDomain, Account owner,
Long domainId, PhysicalNetwork pNtwk, long zoneId, ACLType aclType, Boolean subdomainAccess, long vpcId, Long aclId, Account caller,
Boolean displayNetworkEnabled, String externalId, String ip6Gateway, String ip6Cidr, String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2,
Boolean displayNetworkEnabled, String ip6Gateway, String ip6Cidr, String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2,
Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize)
throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ private static NetworkVO getNetworkVO(long id, final NetworkOffering offering, f
final NetworkVO vo = new NetworkVO(id, network, offering.getId(), guru.getName(), owner.getDomainId(), owner.getId(),
relatedFile, name, displayText, predefined.getNetworkDomain(), offering.getGuestType(),
plan.getDataCenterId(), plan.getPhysicalNetworkId(), aclType, offering.isSpecifyIpRanges(),
vpcId, offering.isRedundantRouter(), predefined.getExternalId());
vpcId, offering.isRedundantRouter());
vo.setDisplayNetwork(isDisplayNetworkEnabled == null || isDisplayNetworkEnabled);
vo.setStrechedL2Network(offering.isSupportingStrechedL2());
return vo;
Expand Down Expand Up @@ -2722,30 +2722,30 @@ public void removeNics(final VirtualMachineProfile vm) {
public Network createPrivateNetwork(final long networkOfferingId, final String name, final String displayText, final String gateway, final String cidr, final String vlanId, final boolean bypassVlanOverlapCheck, final Account owner, final PhysicalNetwork pNtwk, final Long vpcId) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
// create network for private gateway
return createGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId,
bypassVlanOverlapCheck, null, owner, null, pNtwk, pNtwk.getDataCenterId(), ACLType.Account, null,
vpcId, null, null, true, null, null, null, true, null, null,
null, null, null, null, null, null);
bypassVlanOverlapCheck, null, owner, null, pNtwk, pNtwk.getDataCenterId(),
ACLType.Account, null, vpcId, null, null, true, null, null,
null, null, null, null, null, null, null, null);
}

@Override
@DB
public Network createGuestNetwork(final long networkOfferingId, final String name, final String displayText, final String gateway, final String cidr, String vlanId,
boolean bypassVlanOverlapCheck, String networkDomain, final Account owner, final Long domainId, final PhysicalNetwork pNtwk,
final long zoneId, final ACLType aclType, Boolean subdomainAccess, final Long vpcId, final String ip6Gateway, final String ip6Cidr,
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId,
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType,
String routerIp, String routerIpv6, String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2,
Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {
// create Isolated/Shared/L2 network
return createGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId, bypassVlanOverlapCheck,
networkDomain, owner, domainId, pNtwk, zoneId, aclType, subdomainAccess, vpcId, ip6Gateway, ip6Cidr,
isDisplayNetworkEnabled, isolatedPvlan, isolatedPvlanType, externalId, false, routerIp, routerIpv6, ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, vrIfaceMTUs, networkCidrSize);
isDisplayNetworkEnabled, isolatedPvlan, isolatedPvlanType, false, routerIp, routerIpv6, ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, vrIfaceMTUs, networkCidrSize);
}

@DB
private Network createGuestNetwork(final long networkOfferingId, final String name, final String displayText, final String gateway, final String cidr, String vlanId,
boolean bypassVlanOverlapCheck, String networkDomain, final Account owner, final Long domainId, final PhysicalNetwork pNtwk,
final long zoneId, final ACLType aclType, Boolean subdomainAccess, final Long vpcId, final String ip6Gateway, final String ip6Cidr,
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType, String externalId,
final Boolean isDisplayNetworkEnabled, final String isolatedPvlan, Network.PVlanType isolatedPvlanType,
final Boolean isPrivateNetwork, String routerIp, String routerIpv6, final String ip4Dns1, final String ip4Dns2,
final String ip6Dns1, final String ip6Dns2, Pair<Integer, Integer> vrIfaceMTUs, Integer networkCidrSize) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException {

Expand Down Expand Up @@ -3013,13 +3013,9 @@ public Network doInTransaction(final TransactionStatus status) {
userNetwork.setIp6Gateway(ip6Gateway);
}

if (externalId != null) {
userNetwork.setExternalId(externalId);
}

if (StringUtils.isNotBlank(routerIp)) {
userNetwork.setRouterIp(routerIp);
}
if (StringUtils.isNotBlank(routerIp)) {
userNetwork.setRouterIp(routerIp);
}

if (StringUtils.isNotBlank(routerIpv6)) {
userNetwork.setRouterIpv6(routerIpv6);
Expand Down
14 changes: 1 addition & 13 deletions engine/schema/src/main/java/com/cloud/network/dao/NetworkVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ public class NetworkVO implements Network {
@Column(name = "streched_l2")
boolean strechedL2Network = false;

@Column(name = "external_id")
String externalId;

@Transient
String routerIp;

Expand Down Expand Up @@ -239,7 +236,7 @@ public NetworkVO(TrafficType trafficType, Mode mode, BroadcastDomainType broadca
}

public NetworkVO(long id, Network that, long offeringId, String guruName, long domainId, long accountId, long related, String name, String displayText,
String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId, final boolean isRedundant, String externalId) {
String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId, final boolean isRedundant) {
this(id,
that.getTrafficType(),
that.getMode(),
Expand Down Expand Up @@ -283,7 +280,6 @@ public NetworkVO(long id, Network that, long offeringId, String guruName, long d
if (StringUtils.isNotBlank(that.getIp6Dns2())) {
this.ip6Dns2 = that.getIp6Dns2();
}
this.externalId = externalId;
this.publicMtu = that.getPublicMtu();
this.privateMtu = that.getPrivateMtu();
}
Expand Down Expand Up @@ -701,14 +697,6 @@ public void setVpcId(Long vpcId) {
this.vpcId = vpcId;
}

public String getExternalId() {
return externalId;
}

public void setExternalId(String externalId) {
this.externalId = externalId;
}

public String getVlanIdAsUUID() {
return vlanIdAsUUID;
}
Expand Down
1 change: 0 additions & 1 deletion server/src/main/java/com/cloud/api/ApiResponseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,6 @@ public NetworkResponse createNetworkResponse(ResponseView view, Network network)
}
response.setNetworkSpannedZones(networkSpannedZones);
}
response.setExternalId(network.getExternalId());
response.setRedundantRouter(network.isRedundant());
response.setCreated(network.getCreated());
response.setSupportsVmAutoScaling(networkOfferingDao.findByIdIncludingRemoved(network.getNetworkOfferingId()).isSupportsVmAutoScaling());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,7 @@ public Ternary<Boolean, List<NetworkOfferingVO>, Network> doInTransaction(Transa

guestNetwork = _networkMgr.createGuestNetwork(requiredOfferings.get(0).getId(), owner.getAccountName() + "-network", owner.getAccountName()
+ "-network", null, null, null, false, null, owner, null, physicalNetwork, zoneId, ACLType.Account, null, null, null, null, true, null, null, null, null, null,
null, null, null, null, null, null);
null, null, null, null, null);
if (guestNetwork == null) {
logger.warn("Failed to create default Virtual network for the account {} in zone {}", owner, zone);
throw new CloudRuntimeException(String.format("Failed to create a" +
Expand Down
13 changes: 6 additions & 7 deletions server/src/main/java/com/cloud/network/NetworkServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,6 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac
boolean displayNetwork = ! Boolean.FALSE.equals(cmd.getDisplayNetwork());
Long aclId = cmd.getAclId();
String isolatedPvlan = cmd.getIsolatedPvlan();
String externalId = cmd.getExternalId();
String isolatedPvlanType = cmd.getIsolatedPvlanType();
Long associatedNetworkId = cmd.getAssociatedNetworkId();
Integer publicMtu = cmd.getPublicMtu();
Expand Down Expand Up @@ -1831,7 +1830,7 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac

Network network = commitNetwork(networkOfferingId, gateway, startIP, endIP, netmask, networkDomain, vlanId, bypassVlanOverlapCheck, name, displayText, caller, physicalNetworkId, zone.getId(),
domainId, isDomainSpecific, subdomainAccess, vpcId, startIPv6, endIPv6, ip6Gateway, ip6Cidr, displayNetwork, aclId, secondaryVlanId, privateVlanType, ntwkOff, pNtwk, aclType, owner, cidr, createVlan,
externalId, routerIPv4, routerIPv6, associatedNetwork, ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, interfaceMTUs, networkCidrSize);
routerIPv4, routerIPv6, associatedNetwork, ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, interfaceMTUs, networkCidrSize);

// retrieve, acquire and associate the correct IP addresses
checkAndSetRouterSourceNatIp(owner, cmd, network);
Expand Down Expand Up @@ -1885,7 +1884,7 @@ public Network createGuestNetwork(long networkOfferingId, String name, String di
return _networkMgr.createGuestNetwork(networkOfferingId, name, displayText,
null, null, null, false, null, owner, null, physicalNetwork, zoneId,
aclType, null, null, null, null, true, null,
null, null, null, null, null, null, null, null, null, null);
null, null, null, null, null, null, null, null, null);
}

@Override
Expand All @@ -1897,7 +1896,7 @@ public Network createGuestNetwork(long networkOfferingId, String name, String di
return _networkMgr.createGuestNetwork(networkOfferingId, name, displayText,
null, null, null, false, null, owner, null, physicalNetwork, zoneId,
aclType, null, null, null, null, true, null,
null, null, null, null, null, null, null, null, vrIfaceMTUs, null);
null, null, null, null, null, null, null, null, null);
}

void checkAndSetRouterSourceNatIp(Account owner, CreateNetworkCmd cmd, Network network) throws InsufficientAddressCapacityException, ResourceAllocationException {
Expand Down Expand Up @@ -2277,7 +2276,7 @@ protected Network commitNetwork(final Long networkOfferingId, final String gatew
final Boolean bypassVlanOverlapCheck, final String name, final String displayText, final Account caller, final Long physicalNetworkId, final Long zoneId, final Long domainId,
final boolean isDomainSpecific, final Boolean subdomainAccessFinal, final Long vpcId, final String startIPv6, final String endIPv6, final String ip6Gateway, final String ip6Cidr,
final Boolean displayNetwork, final Long aclId, final String isolatedPvlan, final PVlanType isolatedPvlanType, final NetworkOffering ntwkOff, final PhysicalNetwork pNtwk, final ACLType aclType, final Account ownerFinal,
final String cidr, final boolean createVlan, final String externalId, String routerIp, String routerIpv6,
final String cidr, final boolean createVlan, String routerIp, String routerIpv6,
final Network associatedNetwork, final String ip4Dns1, final String ip4Dns2, final String ip6Dns1, final String ip6Dns2, Pair<Integer, Integer> vrIfaceMTUs,
final Integer networkCidrSize) throws InsufficientCapacityException, ResourceAllocationException {
try {
Expand Down Expand Up @@ -2335,7 +2334,7 @@ public Network doInTransaction(TransactionStatus status) throws InsufficientCapa
}
}
network = _vpcMgr.createVpcGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId, networkDomain, owner, sharedDomainId, pNtwk, zoneId, aclType,
subdomainAccess, vpcId, aclId, caller, displayNetwork, externalId, ip6Gateway, ip6Cidr, ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, vrIfaceMTUs, networkCidrSize);
subdomainAccess, vpcId, aclId, caller, displayNetwork, ip6Gateway, ip6Cidr, ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2, vrIfaceMTUs, networkCidrSize);
} else {
if (_configMgr.isOfferingForVpc(ntwkOff)) {
throw new InvalidParameterValueException("Network offering can be used for VPC networks only");
Expand All @@ -2344,7 +2343,7 @@ public Network doInTransaction(TransactionStatus status) throws InsufficientCapa
throw new InvalidParameterValueException("Internal Lb can be enabled on vpc networks only");
}
network = _networkMgr.createGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId, bypassVlanOverlapCheck, networkDomain, owner, sharedDomainId, pNtwk,
zoneId, aclType, subdomainAccess, vpcId, ip6Gateway, ip6Cidr, displayNetwork, isolatedPvlan, isolatedPvlanType, externalId, routerIp, routerIpv6, ip4Dns1, ip4Dns2,
zoneId, aclType, subdomainAccess, vpcId, ip6Gateway, ip6Cidr, displayNetwork, isolatedPvlan, isolatedPvlanType, routerIp, routerIpv6, ip4Dns1, ip4Dns2,
ip6Dns1, ip6Dns2, vrIfaceMTUs, networkCidrSize);
}

Expand Down
Loading
Loading