weizhouapache commented on code in PR #9410:
URL: https://github.com/apache/cloudstack/pull/9410#discussion_r1687585454


##########
engine/schema/src/main/resources/META-INF/db/schema-41910to42000.sql:
##########
@@ -154,3 +154,47 @@ WHERE
 
 -- Quota inject tariff result into subsequent ones
 CALL `cloud_usage`.`IDEMPOTENT_ADD_COLUMN`('cloud_usage.quota_tariff', 
'position', 'bigint(20) NOT NULL DEFAULT 1 COMMENT "Position in the execution 
sequence for tariffs of the same type"');
+
+-- Add tables for AS Numbers and range
+CREATE TABLE `cloud`.`as_number_range` (
+    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
+    `uuid` varchar(40) DEFAULT NULL,
+    `data_center_id` bigint unsigned NOT NULL COMMENT 'zone that it belongs 
to',
+    `start_as_number` bigint unsigned DEFAULT NULL COMMENT 'start AS number of 
the range',
+    `end_as_number` bigint unsigned DEFAULT NULL COMMENT 'end AS number of the 
range',
+    `created` datetime DEFAULT NULL COMMENT 'date created',
+    `removed` datetime DEFAULT NULL COMMENT 'date removed',
+    PRIMARY KEY (`id`),
+    UNIQUE KEY `uk_as_number_range__uuid` (`uuid`),
+    UNIQUE KEY `uk_as_number_range__range` 
(`data_center_id`,`start_as_number`,`end_as_number`, `removed`),
+    CONSTRAINT `fk_as_number_range__data_center_id` FOREIGN KEY 
(`data_center_id`) REFERENCES `data_center` (`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`as_number` (

Review Comment:
   ```suggestion
   CREATE TABLE IF NOT EXISTS `cloud`.`as_number` (
   ```



##########
engine/schema/src/main/resources/META-INF/db/schema-41910to42000.sql:
##########
@@ -154,3 +154,47 @@ WHERE
 
 -- Quota inject tariff result into subsequent ones
 CALL `cloud_usage`.`IDEMPOTENT_ADD_COLUMN`('cloud_usage.quota_tariff', 
'position', 'bigint(20) NOT NULL DEFAULT 1 COMMENT "Position in the execution 
sequence for tariffs of the same type"');
+
+-- Add tables for AS Numbers and range
+CREATE TABLE `cloud`.`as_number_range` (

Review Comment:
   ```suggestion
   CREATE TABLE IF NOT EXISTS `cloud`.`as_number_range` (
   ```



##########
api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java:
##########
@@ -211,6 +211,15 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
             since = "4.16")
     private Boolean enable;
 
+    @Parameter(name = ApiConstants.SPECIFY_AS_NUMBER, type = 
CommandType.BOOLEAN,

Review Comment:
   add `since` 



##########
api/src/main/java/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java:
##########
@@ -136,6 +136,15 @@ public class CreateVPCOfferingCmd extends 
BaseAsyncCreateCmd {
             since = "4.16")
     private Boolean enable;
 
+    @Parameter(name = ApiConstants.SPECIFY_AS_NUMBER, type = 
CommandType.BOOLEAN,

Review Comment:
   add `since`



##########
api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java:
##########
@@ -211,6 +211,15 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
             since = "4.16")
     private Boolean enable;
 
+    @Parameter(name = ApiConstants.SPECIFY_AS_NUMBER, type = 
CommandType.BOOLEAN,
+            description = "true if network offering supports choosing AS 
number")
+    private Boolean specifyAsNumber;
+
+    @Parameter(name = ApiConstants.ROUTING_MODE,
+            type = CommandType.STRING,
+            description = "the routing mode for the network offering. 
Supported types are: Static or Dynamic.")

Review Comment:
   add `since`



##########
api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java:
##########
@@ -49,6 +49,9 @@ public class CreateNetworkCmdByAdmin extends CreateNetworkCmd 
implements AdminCm
             validations = {ApiArgValidator.NotNullOrEmpty})
     private String routerIpv6;
 
+    @Parameter(name=ApiConstants.AS_NUMBER, type=CommandType.LONG, 
description="the AS Number of the network")

Review Comment:
   add `since` ?



##########
api/src/main/java/org/apache/cloudstack/api/command/admin/bgp/ReleaseASNumberCmd.java:
##########
@@ -0,0 +1,75 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you 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 org.apache.cloudstack.api.command.admin.bgp;
+
+import com.cloud.dc.BGPService;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.NetworkRuleConflictException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.user.Account;
+import com.cloud.utils.Pair;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+
+import javax.inject.Inject;
+
+@APICommand(name = "releaseASNumber", description = "Releases an AS Number 
back to the pool",
+        responseObject = SuccessResponse.class, requestHasSensitiveInfo = 
false, responseHasSensitiveInfo = false)

Review Comment:
   add since ?
   
   is   `authorized = {RoleType.Admin})` needed ?



##########
api/src/main/java/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java:
##########
@@ -117,6 +117,9 @@ public class CreateVPCCmd extends BaseAsyncCreateCmd 
implements UserCmd {
             since = "4.19")
     private String sourceNatIP;
 
+    @Parameter(name=ApiConstants.AS_NUMBER, type=CommandType.LONG, 
description="the AS Number of the VPC tiers")

Review Comment:
   add `since`



##########
api/src/main/java/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java:
##########
@@ -136,6 +136,15 @@ public class CreateVPCOfferingCmd extends 
BaseAsyncCreateCmd {
             since = "4.16")
     private Boolean enable;
 
+    @Parameter(name = ApiConstants.SPECIFY_AS_NUMBER, type = 
CommandType.BOOLEAN,
+            description = "true if the VPC offering supports choosing AS 
number")
+    private Boolean specifyAsNumber;
+
+    @Parameter(name = ApiConstants.ROUTING_MODE,
+            type = CommandType.STRING,
+            description = "the routing mode for the VPC offering. Supported 
types are: Static or Dynamic.")

Review Comment:
   add `since`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to