Skip to content

Commit 3b91964

Browse files
Merge branch 'merge/feature-vpc-ipv6' into feature/vpc-ipv6
This closes #3
2 parents 13cef9a + eb6c990 commit 3b91964

File tree

14 files changed

+304
-37
lines changed

14 files changed

+304
-37
lines changed

api/src/org/apache/cloudstack/api/ApiConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ public class ApiConstants {
115115
public static final String GSLB_STICKY_SESSION_METHOD = "gslbstickysessionmethodname";
116116
public static final String GSLB_LBRULE_WEIGHT_MAP = "gslblbruleweightsmap";
117117
public static final String GUEST_CIDR_ADDRESS = "guestcidraddress";
118+
public static final String IP6_SUPER_CIDR_ADDRESS = "ip6supercidraddress";
119+
public static final String AUTONOMOUS_NUMBER = "asnumber";
118120
public static final String GUEST_VLAN_RANGE = "guestvlanrange";
119121
public static final String HA_ENABLE = "haenable";
120122
public static final String HOST_ID = "hostid";

api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ public class CreateZoneCmd extends BaseCmd {
5858
@Parameter(name = ApiConstants.GUEST_CIDR_ADDRESS, type = CommandType.STRING, description = "the guest CIDR address for the Zone")
5959
private String guestCidrAddress;
6060

61+
@Parameter(name = ApiConstants.IP6_SUPER_CIDR_ADDRESS, type = CommandType.STRING, description = "the IPv6 super CIDR address for the Zone. IPv6 CIDR of all the VPCs in this zone should be within this CIDR")
62+
private String ip6SuperCidrAddress;
63+
64+
@Parameter(name = ApiConstants.AUTONOMOUS_NUMBER, type = CommandType.STRING, description = "private autonomous system number for the Zone")
65+
private String asNumber;
66+
6167
@Parameter(name = ApiConstants.INTERNAL_DNS1, type = CommandType.STRING, required = true, description = "the first internal DNS for the Zone")
6268
private String internalDns1;
6369

@@ -112,6 +118,14 @@ public String getGuestCidrAddress() {
112118
return guestCidrAddress;
113119
}
114120

121+
public String getIp6SuperCidrAddress() {
122+
return ip6SuperCidrAddress;
123+
}
124+
125+
public String getAsNumber() {
126+
return asNumber;
127+
}
128+
115129
public String getInternalDns1() {
116130
return internalDns1;
117131
}

api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
import java.util.List;
2020
import java.util.Map;
2121

22-
import org.apache.log4j.Logger;
23-
2422
import org.apache.cloudstack.api.APICommand;
2523
import org.apache.cloudstack.api.ApiConstants;
2624
import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,6 +28,7 @@
3028
import org.apache.cloudstack.api.ServerApiException;
3129
import org.apache.cloudstack.api.response.ZoneResponse;
3230
import org.apache.cloudstack.context.CallContext;
31+
import org.apache.log4j.Logger;
3332

3433
import com.cloud.dc.DataCenter;
3534
import com.cloud.user.Account;
@@ -60,6 +59,12 @@ public class UpdateZoneCmd extends BaseCmd {
6059
@Parameter(name = ApiConstants.GUEST_CIDR_ADDRESS, type = CommandType.STRING, description = "the guest CIDR address for the Zone")
6160
private String guestCidrAddress;
6261

62+
@Parameter(name = ApiConstants.IP6_SUPER_CIDR_ADDRESS, type = CommandType.STRING, description = "the IPv6 super CIDR address for the Zone. IPv6 CIDR of all the VPCs in this zone should be within this CIDR")
63+
private String ip6SuperCidrAddress;
64+
65+
@Parameter(name = ApiConstants.AUTONOMOUS_NUMBER, type = CommandType.STRING, description = "private autonomous system number for the Zone")
66+
private String asNumber;
67+
6368
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ZoneResponse.class, required = true, description = "the ID of the Zone")
6469
private Long id;
6570

@@ -111,6 +116,14 @@ public String getGuestCidrAddress() {
111116
return guestCidrAddress;
112117
}
113118

119+
public String getIp6SuperCidrAddress() {
120+
return ip6SuperCidrAddress;
121+
}
122+
123+
public String getAsNumber() {
124+
return asNumber;
125+
}
126+
114127
public Long getId() {
115128
return id;
116129
}

api/src/org/apache/cloudstack/api/response/ZoneResponse.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import com.cloud.serializer.Param;
3030
import com.google.gson.annotations.SerializedName;
3131

32-
@SuppressWarnings("unused")
3332
@EntityReference(value = DataCenter.class)
3433
public class ZoneResponse extends BaseResponse {
3534
@SerializedName(ApiConstants.ID)
@@ -72,6 +71,14 @@ public class ZoneResponse extends BaseResponse {
7271
@Param(description = "the guest CIDR address for the Zone")
7372
private String guestCidrAddress;
7473

74+
@SerializedName(ApiConstants.IP6_SUPER_CIDR_ADDRESS)
75+
@Param(description = "the IPv6 super CIDR address for the Zone. IPv6 CIDR of all the VPCs in this zone should be within this CIDR")
76+
private String ip6SuperCidrAddress;
77+
78+
@SerializedName(ApiConstants.AUTONOMOUS_NUMBER)
79+
@Param(description = "private autonomous system number for the Zone")
80+
private String asNumber;
81+
7582
//TODO - generate description
7683
@SerializedName("status")
7784
private String status;
@@ -164,6 +171,14 @@ public void setGuestCidrAddress(String guestCidrAddress) {
164171
this.guestCidrAddress = guestCidrAddress;
165172
}
166173

174+
public void setIp6SuperCidrAddress(String ip6SuperCidrAddress) {
175+
this.ip6SuperCidrAddress = ip6SuperCidrAddress;
176+
}
177+
178+
public void setAsNumber(String asNumber) {
179+
this.asNumber = asNumber;
180+
}
181+
167182
public void setStatus(String status) {
168183
this.status = status;
169184
}

engine/components-api/src/com/cloud/configuration/ConfigurationManager.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,19 @@ HostPodVO createPod(long userId, String podName, long zoneId, String gateway, St
149149
* @param guestCidr
150150
* @param zoneType
151151
* @param allocationState
152-
* @param networkDomain
153-
* TODO
152+
* @param networkDomainTODO
154153
* @param isSecurityGroupEnabled
155-
* TODO
156-
* @param ip6Dns1 TODO
157-
* @param ip6Dns2 TODO
154+
* @param ip6Dns1
155+
* @param ip6Dns2
156+
* @param ip6SuperCidr
157+
* @param asNumber
158158
* @return
159159
* @throws
160160
* @throws
161161
*/
162-
DataCenterVO createZone(long userId, String zoneName, String dns1, String dns2, String internalDns1, String internalDns2, String guestCidr, String domain,
163-
Long domainId, NetworkType zoneType, String allocationState, String networkDomain, boolean isSecurityGroupEnabled, boolean isLocalStorageEnabled, String ip6Dns1,
164-
String ip6Dns2);
162+
DataCenterVO createZone(long userId, String zoneName, String dns1, String dns2, String internalDns1, String internalDns2, String guestCidr, String domain, Long domainId,
163+
NetworkType zoneType, String allocationState, String networkDomain, boolean isSecurityGroupEnabled, boolean isLocalStorageEnabled, String ip6Dns1, String ip6Dns2,
164+
String ip6SuperCidr, String asNumber);
165165

166166
/**
167167
* Deletes a VLAN from the database, along with all of its IP addresses. Will not delete VLANs that have allocated

engine/schema/src/com/cloud/dc/dao/DataCenterDao.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,8 @@ public interface DataCenterDao extends GenericDao<DataCenterVO, Long> {
9696
List<DataCenterVO> findByKeyword(String keyword);
9797

9898
List<DataCenterVO> listAllZones();
99+
100+
DataCenterVO findByIp6SuperCidr(String ip6SuperCidr);
101+
102+
DataCenterVO findByAsn(String asNumber);
99103
}

engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
6161
private static final Logger s_logger = Logger.getLogger(DataCenterDaoImpl.class);
6262

6363
protected SearchBuilder<DataCenterVO> NameSearch;
64+
protected SearchBuilder<DataCenterVO> Ip6SuperCidrSearch;
65+
protected SearchBuilder<DataCenterVO> AsnSearch;
6466
protected SearchBuilder<DataCenterVO> ListZonesByDomainIdSearch;
6567
protected SearchBuilder<DataCenterVO> PublicZonesSearch;
6668
protected SearchBuilder<DataCenterVO> ChildZonesSearch;
@@ -91,6 +93,20 @@ public DataCenterVO findByName(String name) {
9193
return findOneBy(sc);
9294
}
9395

96+
@Override
97+
public DataCenterVO findByIp6SuperCidr(String ip6SuperCidr) {
98+
SearchCriteria<DataCenterVO> sc = Ip6SuperCidrSearch.create();
99+
sc.setParameters("ip6SuperNetworkCidr", ip6SuperCidr);
100+
return findOneBy(sc);
101+
}
102+
103+
@Override
104+
public DataCenterVO findByAsn(String asNumber) {
105+
SearchCriteria<DataCenterVO> sc = AsnSearch.create();
106+
sc.setParameters("asNumber", asNumber);
107+
return findOneBy(sc);
108+
}
109+
94110
@Override
95111
public DataCenterVO findByToken(String zoneToken) {
96112
SearchCriteria<DataCenterVO> sc = TokenSearch.create();
@@ -323,6 +339,15 @@ public DataCenterDaoImpl() {
323339
NameSearch.and("name", NameSearch.entity().getName(), SearchCriteria.Op.EQ);
324340
NameSearch.done();
325341

342+
Ip6SuperCidrSearch = createSearchBuilder();
343+
Ip6SuperCidrSearch.and("ip6SuperNetworkCidr", Ip6SuperCidrSearch.entity().getIp6SuperNetworkCidr(), SearchCriteria.Op.EQ);
344+
Ip6SuperCidrSearch.done();
345+
346+
347+
AsnSearch = createSearchBuilder();
348+
AsnSearch.and("asNumber", AsnSearch.entity().getAsNumber(), SearchCriteria.Op.EQ);
349+
AsnSearch.done();
350+
326351
ListZonesByDomainIdSearch = createSearchBuilder();
327352
ListZonesByDomainIdSearch.and("domainId", ListZonesByDomainIdSearch.entity().getDomainId(), SearchCriteria.Op.EQ);
328353
ListZonesByDomainIdSearch.done();

plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/ManagementServerMock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ private void locateZone() {
386386
ConfigurationManager mgr = (ConfigurationManager)_configService;
387387
_zone =
388388
mgr.createZone(User.UID_SYSTEM, "default", "8.8.8.8", null, "8.8.4.4", null, null /* cidr */, "ROOT", Domain.ROOT_DOMAIN, NetworkType.Advanced, null,
389-
null /* networkDomain */, false, false, null, null);
389+
null /* networkDomain */, false, false, null, null, null, null);
390390
}
391391
}
392392

0 commit comments

Comments
 (0)