Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
d745b47
Update design documents and table of content
xieus Oct 1, 2019
1fc253e
Update README.md
Oct 2, 2019
9b0efb6
Add cloud-native key word
Oct 2, 2019
db0a699
Merge branch 'docs/design' of https://github.com/futurewei-cloud/Alio…
xieus Oct 2, 2019
424dd5b
Start docs for comm and controller
xieus Oct 2, 2019
b41edb9
Add design sketch
xieus Oct 8, 2019
3e54c57
Design spec round 1
xieus Oct 19, 2019
d7d8ad9
Rename fast path file and start feature comparison
Oct 20, 2019
4c6588e
Update rescue path doc [DRAFT]
er1cthe0ne Oct 24, 2019
cceaa68
upload rescue_path.GIF
er1cthe0ne Oct 24, 2019
9785656
update rescue path needed change table
er1cthe0ne Oct 24, 2019
3e2b63e
rescue_path.GIF
er1cthe0ne Oct 25, 2019
f8fc472
rescue_path.adoc
er1cthe0ne Oct 25, 2019
2480dd1
Design spec round 2
xieus Oct 25, 2019
68eda0b
Monitoring design outline
Oct 26, 2019
c1c9cc7
Update comm docs
Oct 26, 2019
79e91fe
Update data storage design
xieus Oct 26, 2019
ca69892
Merge branch 'docs/design' of https://github.com/futurewei-cloud/Alio…
xieus Oct 26, 2019
8b154ab
Update data store
Oct 28, 2019
4561d1e
Complete review of existing dbs
xieus Oct 29, 2019
ca4610e
Update review table
xieus Oct 29, 2019
24b4a36
Adjust table column width
xieus Oct 29, 2019
45774da
Update feature comparsion table
Oct 29, 2019
18e500c
Finalize review section in data store
xieus Oct 29, 2019
cc99d14
Add design diagram
xieus Oct 30, 2019
a9c8232
Add a design diagram
xieus Oct 30, 2019
2823921
Add files via upload
er1cthe0ne Oct 30, 2019
47b7e45
fix "design" session level
er1cthe0ne Oct 30, 2019
8c9c004
Update monitoring.adoc
er1cthe0ne Oct 30, 2019
4180450
Update monitoring.adoc
er1cthe0ne Oct 30, 2019
dc39589
Add architectural design discussion
xieus Oct 30, 2019
847900e
Merge branch 'docs/design' of https://github.com/futurewei-cloud/Alio…
xieus Oct 30, 2019
088feff
Update architecture image link
xieus Oct 31, 2019
a16e184
Finalize storage design
xieus Oct 31, 2019
041b203
Update a few subtitles
xieus Oct 31, 2019
359463e
Minor grammar fixes
xieus Oct 31, 2019
5d178e4
Add controller architecture diagram
Nov 2, 2019
ca474b0
Update node_monitoring.adoc
er1cthe0ne Nov 4, 2019
35a4ce3
Update monitoring.adoc
er1cthe0ne Nov 4, 2019
4b97cfe
Update monitoring.adoc
er1cthe0ne Nov 4, 2019
0df003a
Update node_monitoring.adoc
er1cthe0ne Nov 4, 2019
72916af
Update monitoring.adoc
er1cthe0ne Nov 4, 2019
db7c3ee
Minor fixes for adoc file
xieus Nov 5, 2019
ed03395
Update monitoring.adoc
er1cthe0ne Nov 5, 2019
6e9944d
Fix references in monitoring doc
xieus Nov 5, 2019
c0723c0
Merge branch 'docs/design' of https://github.com/futurewei-cloud/Alio…
xieus Nov 5, 2019
9a41b55
Update monitoring.adoc
er1cthe0ne Nov 5, 2019
24dddf8
Update monitoring.adoc
er1cthe0ne Nov 5, 2019
daf7f55
Add details based on disucssion
xieus Nov 5, 2019
f4bae19
Add a table of content
xieus Nov 5, 2019
f20d71f
Update monitoring.adoc
er1cthe0ne Nov 5, 2019
a753035
Update node_monitoring.adoc
er1cthe0ne Nov 5, 2019
691d658
Update monitoring.adoc
er1cthe0ne Nov 5, 2019
310b51d
Add one item for node monitoring
xieus Nov 5, 2019
b414287
Update node_monitoring.adoc
er1cthe0ne Nov 5, 2019
5c8c86e
Reorganize monitoring doc and update design doc metadata format
xieus Nov 6, 2019
1d0606e
Update rescue_path.adoc
er1cthe0ne Nov 8, 2019
a632e48
Add benchmark results
xieus Nov 12, 2019
fd3762d
Update rescue_path.adoc
er1cthe0ne Nov 20, 2019
769f545
Update monitoring.adoc
er1cthe0ne Nov 21, 2019
de441c3
Update data model doc
Feb 5, 2020
eebe700
Merge from master
Feb 24, 2020
4cbd99a
Add API workflow chart for creation of vpc, subnet and port
xieus Feb 27, 2020
46215bf
Update Create workflow chart
xieus Feb 27, 2020
9b1fbec
Create dataplane_abstraction.adoc
er1cthe0ne Mar 2, 2020
62ad9f4
Update dataplane_abstraction.adoc
er1cthe0ne Mar 2, 2020
9e52e6c
Update dataplane_abstraction.adoc
er1cthe0ne Mar 2, 2020
6b7975e
Update dataplane_abstraction.adoc
er1cthe0ne Mar 2, 2020
ea356ae
Update dataplane_abstraction.adoc
er1cthe0ne Mar 2, 2020
b9c563a
Update dataplane_abstraction.adoc
er1cthe0ne Mar 2, 2020
6c071a0
Update dataplane_abstraction.adoc
er1cthe0ne Mar 10, 2020
9728695
Update dataplane_abstraction.adoc
er1cthe0ne Mar 10, 2020
a915d5b
Add workflow option 2
Mar 12, 2020
ad49c7c
Update system_flow.adoc
er1cthe0ne Mar 18, 2020
c93da51
added - Reference: Neutron High Level Flow
er1cthe0ne Mar 19, 2020
7feebf8
Update system_flow.adoc
er1cthe0ne Mar 19, 2020
7dc4d4b
Update creation workflow
Mar 19, 2020
45ba64e
Update system_flow.adoc
er1cthe0ne Mar 19, 2020
68b0553
check permission
Mar 24, 2020
0c0faa6
api gateway draft
Mar 27, 2020
4dcd9f5
Merge branch 'master' into docs/design
Apr 2, 2020
ec05e70
update controller doc
Apr 3, 2020
7b53131
Merge branch 'master' into docs/design
Apr 4, 2020
f0622e2
Update ToC with microservice doc link
Apr 7, 2020
ab9736e
Update ToC and add vpc/mac manager design files
Apr 7, 2020
f5a5154
Add key difference file
Apr 7, 2020
a102fb1
Merge branch 'master' into docs/design
Apr 9, 2020
ac115c6
Minor updates in system flow
Apr 9, 2020
80b4a4d
Add microservice snapshot table
Apr 9, 2020
669c1e4
Add concurrency handling
Apr 10, 2020
cb72f12
Update controller design doc
Apr 10, 2020
516a4f2
update api_gateway file name
Apr 10, 2020
8a63380
update file names
Apr 10, 2020
22b1e64
Merge mac manager design spec from eunju:feature/macmanager
Apr 10, 2020
bdcb7c3
Merge from master
Apr 19, 2020
83e691b
Add API completeness doc
Apr 20, 2020
ef6a1a8
Updtate api_completeness table
Apr 21, 2020
057c314
Add API count
Apr 21, 2020
66743d2
Add references for OpenStack and Alcor
Apr 21, 2020
fb74537
Merge branch 'master' into docs/design
Apr 26, 2020
cdd80c5
Add vpc/subnet pumls
May 4, 2020
af326f9
Merge branch 'master' into docs/design
May 4, 2020
62f6e39
update vpc puml and system flow adoc
May 4, 2020
ef2d717
Add vm/vpc workflows and puml template
May 7, 2020
ad7fd05
Merge from xieus/master
May 8, 2020
f58577c
Squashed commit of the following:
May 9, 2020
592bdd0
Add a set of new workflows and start services docs
May 14, 2020
1804923
Clean node manager pom.xml and modify docker file
May 14, 2020
c3fd4b5
Clean mac manager pom.xml and modify docker file
May 14, 2020
584e38a
Clean port manager pom.xml and modify docker file
May 14, 2020
c58eaf7
Clean ip manager pom.xml and modify docker file
May 14, 2020
c1775e0
Clean route manager pom.xml and modify docker file
May 14, 2020
ad76d8c
Add maven compile plugin to route pom
May 15, 2020
fc7961b
Clean subnet manager pom.xml and modify docker file
May 15, 2020
a532098
Clean vpc manager pom.xml and modify docker file
May 15, 2020
d708224
Clean API gateway pom.xml and modify docker file
May 15, 2020
1647924
Update pom for lib, web and all other services
May 15, 2020
19674f0
Update main pom file
May 15, 2020
f257f57
Update schema pom files and add dependencies to all service pom
May 15, 2020
c19ce7d
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
May 15, 2020
eb3877f
Temp disable mac manager UTs for further investigation
May 16, 2020
5ae43cd
Merge branch 'master' of https://github.com/futurewei-cloud/alcor
May 16, 2020
7912c8d
Merge from master
May 16, 2020
a566f2f
Outline design doc for dpm,mq,nhm,nmm, update controller and toc docs
May 18, 2020
8c0052b
Add nova integration doc
May 18, 2020
e6fdcd1
Update openstack workflow link
May 18, 2020
9158ce3
update link
May 18, 2020
105a37d
update puml file link
May 18, 2020
f3da89d
add a temp vm_create puml under design and update puml file link in n…
May 18, 2020
7ea3c7b
update puml file link
May 18, 2020
b8afc29
update puml file link
May 18, 2020
1665801
update puml file link
May 18, 2020
a8f1ce3
Clean mac manager pom.xml and modify docker file
May 14, 2020
5094345
Clean vpc manager pom.xml and modify docker file
May 15, 2020
67cdfc9
Update pom for lib, web and all other services
May 15, 2020
8b47084
Update schema pom files and add dependencies to all service pom
May 15, 2020
3bca77c
Temp disable mac manager UTs for further investigation
May 16, 2020
2709c68
Merge branch 'master' of https://github.com/xieus/alcor
May 18, 2020
b2446b1
Merge branch 'upstream_master' into docs/design
May 18, 2020
f015303
Reorg design docs into an Antora-supported structure
May 20, 2020
77ef00f
update antora.yml and rename toc to index
May 20, 2020
466a237
Add playbook yml
May 20, 2020
b895a4d
add nav adoc
May 22, 2020
67def70
update antora.yml
May 22, 2020
e7dd179
update antora.yml format
May 22, 2020
7794ff0
Merge pull request #2 from xieus/docs/design
May 22, 2020
44e57fd
Move adoc files under pages folder
May 22, 2020
622ad96
update antora playbook
May 22, 2020
e9de510
update links in README
May 22, 2020
17fbbca
move image and workflow up to ROOT
May 22, 2020
a55ff88
update links in affected docs
May 22, 2020
c15dc85
Merge from alcor/master
May 22, 2020
5085ddf
sync up
kevin-zhonghao Jul 2, 2020
98a447c
Merge remote-tracking branch 'remotes/upstream/master' into new_master
kevin-zhonghao Jul 2, 2020
f6d42f2
Merge branch 'master' of https://github.com/futurewei-cloud/alcor int…
kevin-zhonghao Jul 2, 2020
ee965e7
sync up
kevin-zhonghao Jul 7, 2020
3f81196
Merge branch 'master' of https://github.com/futurewei-cloud/alcor int…
kevin-zhonghao Jul 7, 2020
df99b38
Merge branch 'master' of https://github.com/futurewei-cloud/alcor int…
kevin-zhonghao Jul 8, 2020
d8b23d4
Merge branch 'master' of https://github.com/futurewei-cloud/alcor int…
kevin-zhonghao Jul 9, 2020
af3a28c
Merge branch 'master' of https://github.com/futurewei-cloud/alcor int…
kevin-zhonghao Jul 16, 2020
2d8cf02
Merge branch 'master' of https://github.com/futurewei-cloud/alcor int…
kevin-zhonghao Jul 17, 2020
95d4e01
Merge branch 'master' of https://github.com/futurewei-cloud/alcor int…
kevin-zhonghao Jul 20, 2020
40e30c4
hotfix/issue
kevin-zhonghao Jul 21, 2020
96fa229
update
kevin-zhonghao Jul 21, 2020
eecba2d
fix comments
kevin-zhonghao Jul 21, 2020
612b6e9
sync up
kevin-zhonghao Jul 21, 2020
50e8dab
fix gateway ip behavior issue
kevin-zhonghao Jul 22, 2020
fbdb8ea
fix comments
kevin-zhonghao Jul 22, 2020
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright 2019 The Alcor Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.futurewei.alcor.subnet.config;

public class ConstantsConfig {

public static int HighIpInterval = 1;
public static int LowIpInterval = 3;
public static int BaseInterval = 0;

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class UnitTestConfig {
public static String projectId = "3dda2801-d675-4688-a63f-dcda8d327f50";
public static String vpcId = "9192a4d4-ffff-4ece-b3f0-8d36e3d88038";
public static String subnetId = "9192a4d4-ffff-4ece-b3f0-8d36e3d88000";
public static String gatewayIp = "10.0.0.10";
public static String name = "test_subnet";
public static String updateName = "update_subnet";
public static String cidr = "10.0.0.0/16";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.futurewei.alcor.common.utils.CommonUtil;
import com.futurewei.alcor.common.utils.ControllerUtil;
import com.futurewei.alcor.common.utils.DateUtil;
import com.futurewei.alcor.subnet.exception.GatewayIpUnsupported;
import com.futurewei.alcor.subnet.service.SubnetDatabaseService;
import com.futurewei.alcor.subnet.service.SubnetService;
import com.futurewei.alcor.subnet.utils.RestPreconditionsUtil;
Expand Down Expand Up @@ -50,7 +51,6 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;

import static org.springframework.web.bind.annotation.RequestMethod.*;

Expand Down Expand Up @@ -139,6 +139,13 @@ public SubnetWebJson createSubnetState(@PathVariable String projectId, @RequestB
String subnetId = inSubnetEntity.getId();
String vpcId = inSubnetEntity.getVpcId();
String cidr = inSubnetEntity.getCidr();
String gatewayIp = inSubnetEntity.getGatewayIp();
boolean gatewayIpIsValid = SubnetManagementUtil.checkGatewayIpInputSupported(gatewayIp, cidr);
if (!gatewayIpIsValid) {
throw new GatewayIpUnsupported();
}
boolean gatewayIpIsInAllocatedRange = SubnetManagementUtil.checkGatewayIpIsInAllocatedRange(gatewayIp, cidr);

RestPreconditionsUtil.verifyResourceFound(vpcId);
RestPreconditionsUtil.populateResourceProjectId(inSubnetEntity, projectId);

Expand Down Expand Up @@ -183,11 +190,10 @@ public SubnetWebJson createSubnetState(@PathVariable String projectId, @RequestB
return s;
});


// Verify/Allocate Gateway IP
CompletableFuture<IpAddrRequest> ipFuture = CompletableFuture.supplyAsync(() -> {
try {
return this.subnetService.allocateIpAddressForGatewayPort(subnetId, cidr, vpcId);
return this.subnetService.allocateIpAddressForGatewayPort(subnetId, cidr, vpcId, gatewayIp, gatewayIpIsInAllocatedRange);
} catch (Exception e) {
throw new CompletionException(e);
}
Expand Down Expand Up @@ -218,10 +224,17 @@ public SubnetWebJson createSubnetState(@PathVariable String projectId, @RequestB
if (macState != null) {
inSubnetEntity.setGatewayMacAddress(macState.getMacAddress());
}
inSubnetEntity.setGatewayIp(ipResponse.getIp());
if (ipResponse.getIpVersion() == 4) {
if (gatewayIpIsInAllocatedRange) {
inSubnetEntity.setGatewayIp(ipResponse.getIp());
} else {
String gatewayIP = SubnetManagementUtil.setGatewayIpValue(gatewayIp, cidr);
if (gatewayIp != null) {
inSubnetEntity.setGatewayIp(gatewayIP);
}
}
if (ipResponse != null && ipResponse.getIpVersion() == 4) {
inSubnetEntity.setIpV4RangeId(ipResponse.getRangeId());
}else if (ipResponse.getIpVersion() == 6) {
}else if (ipResponse != null && ipResponse.getIpVersion() == 6) {
inSubnetEntity.setIpV6RangeId(ipResponse.getRangeId());
}

Expand All @@ -239,6 +252,22 @@ public SubnetWebJson createSubnetState(@PathVariable String projectId, @RequestB
inSubnetEntity.setTenantId(inSubnetEntity.getProjectId());
}

// enable_dhcp
Boolean dhcpEnable = inSubnetEntity.getDhcpEnable();
if (dhcpEnable == null) {
inSubnetEntity.setDhcpEnable(true);
}

// allocation_pools
List<AllocationPool> allocationPoolList = inSubnetEntity.getAllocationPools();
if (allocationPoolList == null || allocationPoolList.size() == 0) {
String[] ips = this.subnetService.cidrToFirstIpAndLastIp(cidr);
List<AllocationPool> allocationPools = new ArrayList<>();
AllocationPool allocationPool = new AllocationPool(ips[0], ips[1]);
allocationPools.add(allocationPool);
inSubnetEntity.setAllocationPools(allocationPools);
}

// tags
//// List<String> tags = inSubnetWebResponseObject.getTags();
//// if (tags == null) {
Expand All @@ -259,6 +288,9 @@ public SubnetWebJson createSubnetState(@PathVariable String projectId, @RequestB
// throw new ResourcePersistenceException();
// }

// update to vpc with subnet id
this.subnetService.addSubnetIdToVpc(subnetId, projectId, vpcId);

return new SubnetWebJson(inSubnetEntity);

} catch (CompletionException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Copyright 2019 The Alcor Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.futurewei.alcor.subnet.exception;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(code= HttpStatus.INTERNAL_SERVER_ERROR, reason="GatewayIp is unsupported")
public class GatewayIpUnsupported extends Exception {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Copyright 2019 The Alcor Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.futurewei.alcor.subnet.exception;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

@ResponseStatus(code= HttpStatus.INTERNAL_SERVER_ERROR, reason="Subnet id is null")
public class SubnetIdIsNull extends Exception {
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ public void fallbackOperation (AtomicReference<RouteWebJson> routeResponseAtomic
public MacStateJson allocateMacAddressForGatewayPort(String projectId, String vpcId, String portId) throws Exception;

// Verify/Allocate Gateway IP
public IpAddrRequest allocateIpAddressForGatewayPort(String subnetId, String cidr, String vpcId) throws Exception;
public IpAddrRequest allocateIpAddressForGatewayPort(String subnetId, String cidr, String vpcId, String gatewayIp, boolean isOpenToBeAllocated) throws Exception;

// Transfer cidr to first IP and last IP
public String[] cidrToFirstIpAndLastIp (String cidr);

// Verify cidr block
public boolean verifyCidrBlock (String cidr) throws ParameterUnexpectedValueException, FallbackException;

// update to vpc with subnet id
public void addSubnetIdToVpc (String subnetId, String projectId, String vpcId) throws Exception;

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import com.futurewei.alcor.common.entity.ResponseId;
import com.futurewei.alcor.common.exception.FallbackException;
import com.futurewei.alcor.common.utils.ControllerUtil;
import com.futurewei.alcor.subnet.config.ConstantsConfig;
import com.futurewei.alcor.subnet.config.IpVersionConfig;
import com.futurewei.alcor.subnet.exception.SubnetIdIsNull;
import com.futurewei.alcor.subnet.service.SubnetDatabaseService;
import com.futurewei.alcor.subnet.service.SubnetService;
import com.futurewei.alcor.web.entity.route.RouteEntity;
Expand Down Expand Up @@ -159,7 +161,7 @@ public MacStateJson allocateMacAddressForGatewayPort(String projectId, String vp
}

@Override
public IpAddrRequest allocateIpAddressForGatewayPort(String subnetId, String cidr, String vpcId) throws FallbackException {
public IpAddrRequest allocateIpAddressForGatewayPort(String subnetId, String cidr, String vpcId, String gatewayIp, boolean isOpenToBeAllocated) throws FallbackException {
String ipManagerServiceUrl = ipUrl;
String ipManagerCreateRangeUrl = ipUrl + "range";
String ipAddressRangeId = UUID.randomUUID().toString();
Expand Down Expand Up @@ -200,10 +202,18 @@ public IpAddrRequest allocateIpAddressForGatewayPort(String subnetId, String cid
throw new FallbackException("fallback request");
}

if (!isOpenToBeAllocated) {
IpAddrRequest ipAddrRequest = new IpAddrRequest();
ipAddrRequest.setIpVersion(ipRangeResponse.getIpVersion());
ipAddrRequest.setRangeId(ipRangeResponse.getId());
return ipAddrRequest;
}

// Allocate Ip Address
IpAddrRequest ipAddrRequest = new IpAddrRequest();
ipAddrRequest.setRangeId(ipRangeResponse.getId());
ipAddrRequest.setIpVersion(ipRangeResponse.getIpVersion());
ipAddrRequest.setIp(gatewayIp);
ipAddrRequest.setVpcId(vpcId);
ipAddrRequest.setSubnetId(subnetId);

Expand Down Expand Up @@ -238,6 +248,16 @@ public String[] cidrToFirstIpAndLastIp(String cidr) {
if (highIp == null || lowIp == null) {
return null;
}

String[] highIps = highIp.split("\\.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add the logic here?

cidrToFirstIpAndLastIp is used somewhere else that actually asks the first and last Ip, right? If so, then this new logic is going to break codes in those places.

I think we should have a new method that handles the cut explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is used for creating Ip Address Range, and Ip Address Range may also need this fix, right? let us talk about this.

String[] lowIps = lowIp.split("\\.");
Integer high = Integer.parseInt(highIps[highIps.length - 1]) - ConstantsConfig.HighIpInterval;
Integer low = Integer.parseInt(lowIps[lowIps.length - 1]) + ConstantsConfig.LowIpInterval;
highIps[highIps.length - 1] = String.valueOf(high);
lowIps[lowIps.length - 1] = String.valueOf(low);
highIp = String.join(".", highIps);
lowIp = String.join(".", lowIps);

String[] res = new String[2];
res[0] = lowIp;
res[1] = highIp;
Expand Down Expand Up @@ -282,4 +302,15 @@ public boolean verifyCidrBlock(String cidr) throws FallbackException {

}

@Override
public void addSubnetIdToVpc(String subnetId, String projectId, String vpcId) throws Exception {
if (subnetId == null) {
throw new SubnetIdIsNull();
}

String vpcManagerServiceUrl = vpcUrl + projectId + "/vpcs/" + vpcId + "/subnets/" + subnetId;
restTemplate.put(vpcManagerServiceUrl, VpcWebJson.class);

}

}
Loading