DaanHoogland commented on a change in pull request #4205:
URL: https://github.com/apache/cloudstack/pull/4205#discussion_r645489863
##########
File path: client/pom.xml
##########
@@ -29,11 +29,17 @@
</parent>
<repositories>
<repository>
- <id>juniper-contrail</id>
- <url>https://juniper.github.io/contrail-maven/snapshots</url>
+ <id>juniper-tungsten-api</id>
+ <url>https://github.com/radu-todirica/tungsten-api/raw/master</url>
Review comment:
is this going to be moved elsewhere?
##########
File path:
api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
##########
@@ -122,6 +122,11 @@
description = "true if network offering is meant to be used for
VPC, false otherwise.")
private Boolean forVpc;
+ @Parameter(name = ApiConstants.FOR_TUNGSTEN,
+ type = CommandType.BOOLEAN,
+ description = "true if network offering is meant to be used for
TUNGSTEN, false otherwise.")
Review comment:
```suggestion
description = "true if network offering is meant to be used for
Tungsten-Fabric, false otherwise.")
```
##########
File path:
plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenPublicNetworkCmd.java
##########
@@ -0,0 +1,104 @@
+// 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.network.tungsten.api.command;
+
+import com.cloud.dc.VlanVO;
+import com.cloud.dc.dao.VlanDao;
+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.network.Network;
+import com.cloud.network.NetworkModel;
+import com.cloud.network.Networks;
+import com.cloud.user.Account;
+import com.cloud.utils.db.SearchCriteria;
+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 org.apache.cloudstack.network.tungsten.service.TungstenService;
+import org.apache.log4j.Logger;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenPublicNetwork", description = "create
tungsten public network", responseObject =
Review comment:
```suggestion
@APICommand(name = "createTungstenFabricPublicNetwork", description =
"create a Tungsten-Fabric public network", responseObject =
```
##########
File path:
plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/GetLoadBalancerSslCertificateCmd.java
##########
@@ -0,0 +1,82 @@
+// 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.network.tungsten.api.command;
+
+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.network.lb.LoadBalancingRule;
+import com.cloud.network.lb.LoadBalancingRulesManager;
+import com.cloud.user.Account;
+import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.network.tungsten.api.response.TlsDataResponse;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "getLoadBalancerSslCertificate", description = "get load
balancer certificate", responseObject =
+ TlsDataResponse.class, requestHasSensitiveInfo = false,
responseHasSensitiveInfo = false)
+public class GetLoadBalancerSslCertificateCmd extends BaseCmd {
+ public static final Logger s_logger =
Logger.getLogger(GetLoadBalancerSslCertificateCmd.class.getName());
+ private static final String s_name = "response";
+
+ @Inject
+ private LoadBalancingRulesManager _lbMgr;
+
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType =
TlsDataResponse.class, required = true,
+ description = "the ID of Lb")
+ private Long id;
+
+ @Override
+ public void execute() throws ResourceUnavailableException,
InsufficientCapacityException, ServerApiException,
+ ConcurrentOperationException, ResourceAllocationException,
NetworkRuleConflictException {
+ LoadBalancingRule.LbSslCert lbSslCert = _lbMgr.getLbSslCert(id);
+ if (lbSslCert != null) {
+ TlsDataResponse tlsDataResponse = new TlsDataResponse();
+
tlsDataResponse.setCrt(Base64.encodeBase64String(lbSslCert.getCert().getBytes()));
+
tlsDataResponse.setKey(Base64.encodeBase64String(lbSslCert.getKey().getBytes()));
+ tlsDataResponse.setResponseName(s_name);
+ tlsDataResponse.setObjectName("data");
+ setResponseObject(tlsDataResponse);
+ } else {
+ throw new CloudRuntimeException("can not get tls data");
+ }
+ }
+
+ @Override
+ public String getCommandName() {
+ return s_name;
Review comment:
ususally this is
```suggestion
return s_name.toLower() + "response";
```
there is a lof of Cmd.java classes here that could be more conformant is
this way.
##########
File path:
plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/GetLoadBalancerSslCertificateCmd.java
##########
@@ -0,0 +1,82 @@
+// 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.network.tungsten.api.command;
+
+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.network.lb.LoadBalancingRule;
+import com.cloud.network.lb.LoadBalancingRulesManager;
+import com.cloud.user.Account;
+import com.cloud.utils.exception.CloudRuntimeException;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.cloudstack.network.tungsten.api.response.TlsDataResponse;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "getLoadBalancerSslCertificate", description = "get load
balancer certificate", responseObject =
+ TlsDataResponse.class, requestHasSensitiveInfo = false,
responseHasSensitiveInfo = false)
+public class GetLoadBalancerSslCertificateCmd extends BaseCmd {
+ public static final Logger s_logger =
Logger.getLogger(GetLoadBalancerSslCertificateCmd.class.getName());
+ private static final String s_name = "response";
Review comment:
this can't be good. what was the intention, here?
##########
File path:
engine/schema/src/main/java/com/cloud/network/TungstenGuestNetworkIpAddressVO.java
##########
@@ -0,0 +1,78 @@
+package com.cloud.network;
Review comment:
```suggestion
// 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 com.cloud.network;
```
##########
File path:
plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenManagementNetworkCmd.java
##########
@@ -0,0 +1,91 @@
+// 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.network.tungsten.api.command;
+
+import com.cloud.dc.HostPodVO;
+import com.cloud.dc.dao.HostPodDao;
+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 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.PodResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenService;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenManagementNetwork", description = "create
tungsten management network",
+ responseObject = SuccessResponse.class, requestHasSensitiveInfo = false,
responseHasSensitiveInfo = false)
+public class CreateTungstenManagementNetworkCmd extends BaseCmd {
+ public static final Logger s_logger =
Logger.getLogger(CreateTungstenManagementNetworkCmd.class.getName());
+
+ private static final String s_name =
"createtungstenmanagementnetworkresponse";
Review comment:
this has a clever constuction pattern, see othe APIs and copy cleverly
at your will.
##########
File path:
plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenManagementNetworkCmd.java
##########
@@ -0,0 +1,91 @@
+// 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.network.tungsten.api.command;
+
+import com.cloud.dc.HostPodVO;
+import com.cloud.dc.dao.HostPodDao;
+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 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.PodResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenService;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenManagementNetwork", description = "create
tungsten management network",
Review comment:
```suggestion
@APICommand(name = "createTungstenFabricManagementNetwork", description =
"create a Tungsten-Fabric management network",
```
##########
File path:
api/src/main/java/org/apache/cloudstack/api/response/NetworkOfferingResponse.java
##########
@@ -99,6 +99,10 @@
@Param(description = "true if network offering can be used by VPC networks
only")
private Boolean forVpc;
+ @SerializedName(ApiConstants.FOR_TUNGSTEN)
+ @Param(description = "true if network offering can be used by tungsten
networks only")
Review comment:
```suggestion
@Param(description = "true if network offering can be used by
Tungsten-Fabric networks only")
```
##########
File path:
plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/ConfigTungstenServiceCmd.java
##########
@@ -0,0 +1,169 @@
+// 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.network.tungsten.api.command;
+
+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.network.Network;
+import com.cloud.network.NetworkModel;
+import com.cloud.network.Networks;
+import com.cloud.network.PhysicalNetworkServiceProvider;
+import com.cloud.network.dao.NetworkServiceMapDao;
+import com.cloud.network.dao.NetworkServiceMapVO;
+import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
+import com.cloud.network.dao.PhysicalNetworkServiceProviderVO;
+import com.cloud.offering.NetworkOffering;
+import com.cloud.offerings.NetworkOfferingServiceMapVO;
+import com.cloud.offerings.NetworkOfferingVO;
+import com.cloud.offerings.dao.NetworkOfferingDao;
+import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
+import com.cloud.user.Account;
+import com.cloud.utils.db.Transaction;
+import com.cloud.utils.db.TransactionCallbackNoReturn;
+import com.cloud.utils.db.TransactionStatus;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.log4j.Logger;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+@APICommand(name = "configTungstenService", description = "config tungsten
service", responseObject =
+ SuccessResponse.class, requestHasSensitiveInfo = false,
responseHasSensitiveInfo = false)
+public class ConfigTungstenServiceCmd extends BaseCmd {
+ public static final Logger s_logger =
Logger.getLogger(ConfigTungstenServiceCmd.class.getName());
+ private static final String s_name = "configtungstenserviceresponse";
+ public final static String DefaultTungstenNetworkOffering =
"DefaultTungstenNetworkOffering";
+
+ @Inject
+ NetworkModel _networkModel;
+ @Inject
+ NetworkOfferingDao _networkOfferingDao;
+ @Inject
+ NetworkOfferingServiceMapDao _networkOfferingServiceMapDao;
+ @Inject
+ NetworkServiceMapDao _networkServiceMapDao;
+ @Inject
+ PhysicalNetworkServiceProviderDao _physicalNetworkServiceProviderDao;
+
+ @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID,
entityType = ZoneResponse.class, required = true
+ , description = "the ID of zone")
+ private Long zoneId;
+
+ @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID, type =
CommandType.UUID, entityType =
+ PhysicalNetworkResponse.class, required = true, description = "the ID
of physical network")
+ private Long physicalNetworkId;
+
+ public Long getZoneId() {
+ return zoneId;
+ }
+
+ public void setZoneId(final Long zoneId) {
+ this.zoneId = zoneId;
+ }
+
+ public Long getPhysicalNetworkId() {
+ return physicalNetworkId;
+ }
+
+ public void setPhysicalNetworkId(final Long physicalNetworkId) {
+ this.physicalNetworkId = physicalNetworkId;
+ }
+
+ @Override
+ public void execute() throws ResourceUnavailableException,
InsufficientCapacityException, ServerApiException,
+ ConcurrentOperationException, ResourceAllocationException,
NetworkRuleConflictException {
+ Transaction.execute(new TransactionCallbackNoReturn() {
+ @Override
+ public void doInTransactionWithoutResult(final TransactionStatus
status) {
+ NetworkOfferingVO networkOfferingVO =
_networkOfferingDao.findByUniqueName(
+ DefaultTungstenNetworkOffering);
+ if (networkOfferingVO == null) {
+ networkOfferingVO = new
NetworkOfferingVO(DefaultTungstenNetworkOffering,
+ "Default offering for Tungsten Network",
Networks.TrafficType.Guest, false, false, null, null,
+ true, NetworkOffering.Availability.Optional, null,
Network.GuestType.Isolated, true, false,
+ false, false, true, false);
+ networkOfferingVO.setForTungsten(true);
+ networkOfferingVO.setState(NetworkOffering.State.Enabled);
+ _networkOfferingDao.persist(networkOfferingVO);
+
+ Map<Network.Service, Network.Provider>
tungstenServiceProvider = new HashMap<>();
+ tungstenServiceProvider.put(Network.Service.Dhcp,
Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Dns,
Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.UserData,
Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.SourceNat,
Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.StaticNat,
Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Connectivity,
Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Firewall,
Network.Provider.Tungsten);
+ tungstenServiceProvider.put(Network.Service.Lb,
Network.Provider.Tungsten);
+
tungstenServiceProvider.put(Network.Service.PortForwarding,
Network.Provider.Tungsten);
+
+ for (Network.Service service :
tungstenServiceProvider.keySet()) {
+ NetworkOfferingServiceMapVO
networkOfferingServiceMapVO = new NetworkOfferingServiceMapVO(
+ networkOfferingVO.getId(), service,
tungstenServiceProvider.get(service));
+
_networkOfferingServiceMapDao.persist(networkOfferingServiceMapVO);
+ }
+ }
+
+ PhysicalNetworkServiceProviderVO
physicalNetworkServiceProvider =
+ _physicalNetworkServiceProviderDao.findByServiceProvider(
+ physicalNetworkId, Network.Provider.Tungsten.getName());
+
physicalNetworkServiceProvider.setState(PhysicalNetworkServiceProvider.State.Enabled);
+
_physicalNetworkServiceProviderDao.persist(physicalNetworkServiceProvider);
+
+ Network publicNetwork =
_networkModel.getSystemNetworkByZoneAndTrafficType(zoneId,
+ Networks.TrafficType.Public);
+ NetworkServiceMapVO publicNetworkServiceMapVO = new
NetworkServiceMapVO(publicNetwork.getId(),
+ Network.Service.Connectivity, Network.Provider.Tungsten);
+ _networkServiceMapDao.persist(publicNetworkServiceMapVO);
+
+ Network managementNetwork =
_networkModel.getSystemNetworkByZoneAndTrafficType(zoneId,
+ Networks.TrafficType.Management);
+ NetworkServiceMapVO managementNetworkServiceMapVO = new
NetworkServiceMapVO(managementNetwork.getId(),
+ Network.Service.Connectivity, Network.Provider.Tungsten);
+ _networkServiceMapDao.persist(managementNetworkServiceMapVO);
+ }
+ });
+
+ SuccessResponse response = new SuccessResponse(getCommandName());
+ response.setDisplayText("config tungsten service successfully");
Review comment:
```suggestion
response.setDisplayText("configered Tungsten-Fabric service
successfully");
```
##########
File path:
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/VRouterVifDriver.java
##########
@@ -0,0 +1,95 @@
+package com.cloud.hypervisor.kvm.resource;
Review comment:
```suggestion
// 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 com.cloud.hypervisor.kvm.resource;
```
##########
File path:
api/src/main/java/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
##########
@@ -119,14 +117,17 @@
private Long domainId;
@Parameter(name = ApiConstants.SUBDOMAIN_ACCESS,
- type = CommandType.BOOLEAN,
- description = "Defines whether to allow"
- + " subdomains to use networks dedicated to their parent
domain(s). Should be used with aclType=Domain, defaulted to
allow.subdomain.network.access global config if not specified")
+ type = CommandType.BOOLEAN,
+ description = "Defines whether to allow"
+ + " subdomains to use networks dedicated to their parent
domain(s). Should be used with aclType=Domain, defaulted to
allow.subdomain.network.access global config if not specified")
private Boolean subdomainAccess;
@Parameter(name = ApiConstants.VPC_ID, type = CommandType.UUID, entityType
= VpcResponse.class, description = "the VPC network belongs to")
private Long vpcId;
+ @Parameter(name = ApiConstants.TUNGSTEN_VIRTUAL_ROUTER_UUID, type =
CommandType.STRING, description = "tungsten virtual router the network belongs
to")
Review comment:
```suggestion
@Parameter(name = ApiConstants.TUNGSTEN_VIRTUAL_ROUTER_UUID, type =
CommandType.STRING, description = "Tungsten-Fabric virtual router the network
belongs to")
```
##########
File path: plugins/network-elements/tungsten/pom.xml
##########
@@ -0,0 +1,47 @@
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>cloud-plugin-network-tungsten</artifactId>
+ <name>Apache CloudStack Plugin - Tungsten Network</name>
Review comment:
```suggestion
<name>Apache CloudStack Plugin - Tungsten-Fabric Network</name>
```
##########
File path:
plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/CreateTungstenProviderCmd.java
##########
@@ -0,0 +1,137 @@
+// 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.network.tungsten.api.command;
+
+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.network.TungstenProvider;
+import com.cloud.user.Account;
+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.ZoneResponse;
+import
org.apache.cloudstack.network.tungsten.api.response.TungstenProviderResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenProviderService;
+
+import javax.inject.Inject;
+
+@APICommand(name = "createTungstenProvider", description = "Create tungsten
provider in cloudstack", responseObject =
Review comment:
I agree with @swill and would advice to remove all instances of
"tungsten" also internal one, for a better chance of automated maintenance, i.e.
tungsten -> tungstenFabric | TungstenFabric | Tungsten-Fabric, what ever is
the most applicable.
##########
File path:
plugins/network-elements/tungsten/src/main/java/org/apache/cloudstack/network/tungsten/api/command/ListTungstenProvidersCmd.java
##########
@@ -0,0 +1,81 @@
+// 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.network.tungsten.api.command;
+
+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 org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.context.CallContext;
+import
org.apache.cloudstack.network.tungsten.api.response.TungstenProviderResponse;
+import org.apache.cloudstack.network.tungsten.service.TungstenProviderService;
+
+import javax.inject.Inject;
+import java.util.Arrays;
+
+@APICommand(name = "listTungstenProviders", responseObject =
TungstenProviderResponse.class, description = "Lists Tungsten providers",
Review comment:
```suggestion
@APICommand(name = "listTungstenFabricProviders", responseObject =
TungstenProviderResponse.class, description = "Lists Tungsten-Fabric providers",
```
##########
File path:
api/src/main/java/org/apache/cloudstack/api/response/NetworkResponse.java
##########
@@ -190,6 +190,10 @@
@Param(description = "VPC the network belongs to")
private String vpcId;
+ @SerializedName(ApiConstants.TUNGSTEN_VIRTUAL_ROUTER_UUID)
+ @Param(description = "Tungsten virtual router the network belongs to")
Review comment:
```suggestion
@Param(description = "Tungsten-Fabric virtual router the network belongs
to")
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]