Tungsten integration (#7065)

Co-authored-by: rtodirica <rtodirica@ena.com>
Co-authored-by: Huy Le <huylm@unitech.vn>
Co-authored-by: radu-todirica <Radu.Todirica@ness.com>
Co-authored-by: Huy Le <minh.le@ext.ewerk.com>
Co-authored-by: Simon Weller <siweller77@gmail.com>
Co-authored-by: dahn <daan@onecht.net>
This commit is contained in:
David Jumani 2023-02-01 13:49:53 +05:30 committed by GitHub
parent d8c7e34b38
commit c774b865c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
333 changed files with 41303 additions and 37 deletions

View File

@ -161,6 +161,35 @@ public class EventTypes {
public static final String EVENT_FIREWALL_EGRESS_CLOSE = "FIREWALL.EGRESS.CLOSE";
public static final String EVENT_FIREWALL_EGRESS_UPDATE = "FIREWALL.EGRESS.UPDATE";
// Tungsten-Fabric
public static final String EVENT_TUNGSTEN_ADD_POLICY_RULE = "TUNGSTEN.ADD.POLICY.RULE";
public static final String EVENT_TUNGSTEN_APPLY_POLICY = "TUNGSTEN.APPLY.POLICY";
public static final String EVENT_TUNGSTEN_APPLY_TAG = "TUNGSTEN.APPLY.TAG";
public static final String EVENT_TUNGSTEN_CREATE_POLICY = "TUNGSTEN.CREATE.POLICY";
public static final String EVENT_TUNGSTEN_CREATE_TAG = "TUNGSTEN.CREATE.TAG";
public static final String EVENT_TUNGSTEN_CREATE_TAGTYPE = "TUNGSTEN.CREATE.TAGTYPE";
public static final String EVENT_TUNGSTEN_CREATE_ADDRESS_GROUP = "TUNGSTEN.CREATE.ADDRESS.GROUP";
public static final String EVENT_TUNGSTEN_CREATE_SERVICE_GROUP = "TUNGSTEN.CREATE.SERVICE.GROUP";
public static final String EVENT_TUNGSTEN_CREATE_APPLICATION_POLICY_SET = "TUNGSTEN.CREATE.APS";
public static final String EVENT_TUNGSTEN_CREATE_FIREWALL_POLICY = "TUNGSTEN.CREATE.FIREWALL.POLICY";
public static final String EVENT_TUNGSTEN_CREATE_FIREWALL_RULE = "TUNGSTEN.CREATE.FIREWALL.RULE";
public static final String EVENT_TUNGSTEN_DELETE_POLICY = "TUNGSTEN.DELETE.POLICY";
public static final String EVENT_TUNGSTEN_DELETE_TAG = "TUNGSTEN.DELETE.TAG";
public static final String EVENT_TUNGSTEN_DELETE_TAGTYPE = "TUNGSTEN.DELETE.TAGTYPE";
public static final String EVENT_TUNGSTEN_DELETE_ADDRESS_GROUP = "TUNGSTEN.DELETE.ADDRESS.GROUP";
public static final String EVENT_TUNGSTEN_DELETE_APPLICATION_POLICY_SET = "TUNGSTEN.DELETE.APS";
public static final String EVENT_TUNGSTEN_DELETE_FIREWALL_POLICY = "TUNGSTEN.DELETE.FIREWALL.POLICY";
public static final String EVENT_TUNGSTEN_DELETE_FIREWALL_RULE = "TUNGSTEN.DELETE.FIREWALL.RULE";
public static final String EVENT_TUNGSTEN_DELETE_SERVICE_GROUP = "TUNGSTEN.DELETE.SERVICE.GROUP";
public static final String EVENT_TUNGSTEN_REMOVE_POLICY = "TUNGSTEN.REMOVE.POLICY";
public static final String EVENT_TUNGSTEN_REMOVE_TAG = "TUNGSTEN.REMOVE.TAG";
public static final String EVENT_TUNGSTEN_REMOVE_POLICY_RULE = "TUNGSTEN.REMOVE.POLICY.RULE";
public static final String EVENT_TUNGSTEN_CREATE_LOGICAL_ROUTER = "TUNGSTEN.CREATE.LOGICAL.ROUTER";
public static final String EVENT_TUNGSTEN_ADD_NETWORK_GATEWAY_TO_LOGICAL_ROUTER = "TUNGSTEN.ADD.NETWORK.GW.TO.LG";
public static final String EVENT_TUNGSTEN_REMOVE_NETWORK_GATEWAY_FROM_LOGICAL_ROUTER = "TUNGSTEN.RM.NETWORK.GW.FROM.LG";
public static final String EVENT_TUNGSTEN_DELETE_LOGICAL_ROUTER = "TUNGSTEN.DELETE.LOGICAL.ROUTER";
public static final String EVENT_TUNGSTEN_UPDATE_LB_HEALTH_MONITOR = "TUNGSTEN.UPDATE.LB.HM";
//NIC Events
public static final String EVENT_NIC_CREATE = "NIC.CREATE";
public static final String EVENT_NIC_DELETE = "NIC.DELETE";

View File

@ -202,6 +202,8 @@ public interface Network extends ControlledEntity, StateObject<Network.State>, I
public static final Provider BigSwitchBcf = new Provider("BigSwitchBcf", false);
//Add ConfigDrive provider
public static final Provider ConfigDrive = new Provider("ConfigDrive", false);
//Add Tungsten Fabric provider
public static final Provider Tungsten = new Provider("Tungsten", false);
private final String name;
private final boolean isExternal;

View File

@ -63,6 +63,8 @@ public interface NetworkService {
public static final Integer DEFAULT_MTU = 1500;
public static final Integer MINIMUM_MTU = 68;
public static final String MESSAGE_ASSIGN_NIC_SECONDARY_IP_EVENT = "Message.AssignNicSecondaryIp.Event";
public static final String MESSAGE_RELEASE_NIC_SECONDARY_IP_EVENT = "Message.ReleaseNicSecondaryIp.Event";
public static final ConfigKey<Integer> VRPublicInterfaceMtu = new ConfigKey<>("VirtualRouter", Integer.class,
"vr.public.interface.max.mtu", "1500", "The maximum value the MTU can have on the VR's public interfaces",

View File

@ -127,7 +127,8 @@ public class Networks {
}
},
UnDecided(null, null),
OpenDaylight("opendaylight", String.class);
OpenDaylight("opendaylight", String.class),
TUNGSTEN("tf", String.class);
private final String scheme;
private final Class<?> type;

View File

@ -0,0 +1,31 @@
// 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;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface TungstenProvider extends InternalIdentity, Identity {
String getHostname();
String getPort();
String getProviderName();
String getGateway();
String getIntrospectPort();
String getVrouterPort();
long getZoneId();
long getHostId();
}

View File

@ -55,4 +55,9 @@ public interface SecurityGroupService {
public List<? extends SecurityRule> authorizeSecurityGroupEgress(AuthorizeSecurityGroupEgressCmd cmd);
public boolean securityGroupRulesForVmSecIp(long nicId, String secondaryIp, boolean ruleAction);
String MESSAGE_CREATE_TUNGSTEN_SECURITY_GROUP_EVENT = "Message.CreateTungstenSecurityGroup.Event";
String MESSAGE_DELETE_TUNGSTEN_SECURITY_GROUP_EVENT = "Message.DeleteTungstenSecurityGroup.Event";
String MESSAGE_ADD_SECURITY_GROUP_RULE_EVENT = "Message.AddSecurityGroupRule.Event";
String MESSAGE_REMOVE_SECURITY_GROUP_RULE_EVENT = "Message.RemoveSecurityGroupRule.Event";
}

View File

@ -0,0 +1,23 @@
// 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.security;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
public interface TungstenSecurityGroupRule extends Identity, InternalIdentity {
}

View File

@ -51,6 +51,7 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
public final static String SystemPrivateGatewayNetworkOfferingWithoutVlan = "System-Private-Gateway-Network-Offering-Without-Vlan";
public final static String DefaultSharedNetworkOfferingWithSGService = "DefaultSharedNetworkOfferingWithSGService";
public static final String DEFAULT_TUNGSTEN_SHARED_NETWORK_OFFERING_WITH_SGSERVICE = "DefaultTungstenSharedNetworkOfferingWithSGService";
public final static String QuickCloudNoServices = "QuickCloudNoServices";
public final static String DefaultIsolatedNetworkOfferingWithSourceNatService = "DefaultIsolatedNetworkOfferingWithSourceNatService";
public final static String OvsIsolatedNetworkOfferingWithSourceNatService = "OvsIsolatedNetworkOfferingWithSourceNatService";
@ -87,6 +88,8 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
boolean isForVpc();
boolean isForTungsten();
TrafficType getTrafficType();
boolean isSpecifyVlan();

View File

@ -663,6 +663,67 @@ public class ApiConstants {
public static final String VSWITCH_TYPE_PUBLIC_TRAFFIC = "publicvswitchtype";
public static final String VSWITCH_NAME_GUEST_TRAFFIC = "guestvswitchname";
public static final String VSWITCH_NAME_PUBLIC_TRAFFIC = "publicvswitchname";
// Tungsten-Fabric
public static final String TUNGSTEN_VIRTUAL_ROUTER_UUID = "tungstenvirtualrouteruuid";
public static final String TUNGSTEN_PROVIDER_HOSTNAME = "tungstenproviderhostname";
public static final String TUNGSTEN_PROVIDER_PORT = "tungstenproviderport";
public static final String TUNGSTEN_PROVIDER_UUID = "tungstenprovideruuid";
public static final String TUNGSTEN_GATEWAY = "tungstengateway";
public static final String TUNGSTEN_PROVIDER_VROUTER_PORT = "tungstenprovidervrouterport";
public static final String TUNGSTEN_PROVIDER_INTROSPECT_PORT = "tungstenproviderintrospectport";
public static final String SRC_NETWORK = "srcnetwork";
public static final String SRC_IP_PREFIX = "srcipprefix";
public static final String SRC_IP_PREFIX_LEN = "srcipprefixlen";
public static final String SRC_START_PORT = "srcstartport";
public static final String SRC_END_PORT = "srcendport";
public static final String DEST_NETWORK = "destnetwork";
public static final String DEST_IP_PREFIX = "destipprefix";
public static final String DEST_IP_PREFIX_LEN = "destipprefixlen";
public static final String DEST_START_PORT = "deststartport";
public static final String DEST_END_PORT = "destendport";
public static final String MAJOR_SEQUENCE = "majorsequence";
public static final String MINOR_SEQUENCE = "minorsequence";
public static final String POLICY_UUID = "policyuuid";
public static final String RULE_UUID = "ruleuuid";
public static final String DIRECTION = "direction";
public static final String TAG_UUID = "taguuid";
public static final String TAG_TYPE = "tagtype";
public static final String TAG_VALUE = "tagvalue";
public static final String TAG_TYPE_UUID = "tagtypeuuid";
public static final String NETWORK_UUID = "networkuuid";
public static final String NIC_UUID = "nicuuid";
public static final String VM_UUID = "vmuuid";
public static final String ONE_WAY = "oneway";
public static final String POLICY = "policy";
public static final String VM = "vm";
public static final String FIREWALL_POLICY = "firewallpolicy";
public static final String FIREWALL_RULE = "firewallrule";
public static final String TAG = "tag";
public static final String APPLICATION_POLICY_SET_UUID = "applicationpolicysetuuid";
public static final String FIREWALL_POLICY_UUID = "firewallpolicyuuid";
public static final String FIREWALL_RULE_UUID = "firewallruleuuid";
public static final String ADDRESS_GROUP_UUID = "addressgroupuuid";
public static final String SERVICE_GROUP_UUID = "servicegroupuuid";
public static final String SEQUENCE = "sequence";
public static final String SERVICE_GROUP = "servicegroup";
public static final String SRC_ADDRESS_GROUP = "srcaddressgroup";
public static final String DEST_ADDRESS_GROUP = "destaddressgroup";
public static final String SRC_TAG = "srctag";
public static final String DEST_TAG = "desttag";
public static final String IP_PREFIX = "ipprefix";
public static final String IP_PREFIX_LEN = "ipprefixlen";
public static final String SRC_ADDRESS_GROUP_UUID = "srcaddressgroupuuid";
public static final String DEST_ADDRESS_GROUP_UUID = "destaddressgroupuuid";
public static final String SRC_TAG_UUID = "srctaguuid";
public static final String DEST_TAG_UUID = "desttaguuid";
public static final String SRC_NETWORK_UUID = "srcnetworkuuid";
public static final String DEST_NETWORK_UUID = "destnetworkuuid";
public static final String LOGICAL_ROUTER_UUID = "logicalrouteruuid";
public static final String RETRY = "retry";
public static final String HTTP_METHOD = "httpmethodtype";
public static final String EXPECTED_CODE = "expectedcode";
public static final String URL_PATH = "urlpath";
// Ovs controller
public static final String OVS_DEVICE_ID = "ovsdeviceid";
public static final String OVS_DEVICE_NAME = "ovsdevicename";
@ -719,6 +780,7 @@ public class ApiConstants {
public static final String FORCE_ENCAP = "forceencap";
public static final String SPLIT_CONNECTIONS = "splitconnections";
public static final String FOR_VPC = "forvpc";
public static final String FOR_TUNGSTEN = "fortungsten";
public static final String SHRINK_OK = "shrinkok";
public static final String NICIRA_NVP_DEVICE_ID = "nvpdeviceid";
public static final String NICIRA_NVP_TRANSPORT_ZONE_UUID = "transportzoneuuid";

View File

@ -126,6 +126,11 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
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-Fabric, false otherwise.")
private Boolean forTungsten;
@Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP, since = "4.2.0", description = "Network offering details in key/value pairs."
+ " Supported keys are internallbprovider/publiclbprovider with service provider as a value, and"
+ " promiscuousmode/macaddresschanges/forgedtransmits with true/false as value to accept/reject the security settings if available for a nic/portgroup")
@ -235,6 +240,10 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
return forVpc;
}
public Boolean getForTungsten() {
return forTungsten;
}
public Boolean getEgressDefaultPolicy() {
if (egressDefaultPolicy == null) {
return true;

View File

@ -128,6 +128,9 @@ public class CreateNetworkCmd extends BaseCmd implements UserCmd {
@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-Fabric virtual router the network belongs to")
private String tungstenVirtualRouterUuid;
@Parameter(name = ApiConstants.START_IPV6, type = CommandType.STRING, description = "the beginning IPv6 address in the IPv6 network range")
private String startIpv6;
@ -257,6 +260,10 @@ public class CreateNetworkCmd extends BaseCmd implements UserCmd {
return associatedNetworkId;
}
public String getTungstenVirtualRouterUuid() {
return tungstenVirtualRouterUuid;
}
@Override
public boolean isDisplay() {
if(displayNetwork == null)

View File

@ -99,6 +99,10 @@ public class NetworkOfferingResponse extends BaseResponseWithAnnotations {
@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-Fabric networks only")
private Boolean forTungsten;
@SerializedName(ApiConstants.IS_PERSISTENT)
@Param(description = "true if network offering supports persistent networks, false otherwise")
private Boolean isPersistent;
@ -211,6 +215,10 @@ public class NetworkOfferingResponse extends BaseResponseWithAnnotations {
this.forVpc = forVpc;
}
public void setForTungsten(Boolean forTungsten) {
this.forTungsten = forTungsten;
}
public void setIsPersistent(Boolean isPersistent) {
this.isPersistent = isPersistent;
}

View File

@ -203,6 +203,10 @@ public class NetworkResponse extends BaseResponseWithAssociatedNetwork implement
@Param(description = "the name of the Network associated with this network")
private String associatedNetworkName;
@SerializedName(ApiConstants.TUNGSTEN_VIRTUAL_ROUTER_UUID)
@Param(description = "Tungsten-Fabric virtual router the network belongs to")
private String tungstenVirtualRouterUuid;
@SerializedName(ApiConstants.CAN_USE_FOR_DEPLOY)
@Param(description = "list networks available for vm deployment")
private Boolean canUseForDeploy;
@ -546,6 +550,10 @@ public class NetworkResponse extends BaseResponseWithAssociatedNetwork implement
this.redundantRouter = redundantRouter;
}
public String getTungstenVirtualRouterUuid() {
return tungstenVirtualRouterUuid;
}
public Boolean getSupportsVmAutoScaling() {
return supportsVmAutoScaling;
}
@ -554,6 +562,10 @@ public class NetworkResponse extends BaseResponseWithAssociatedNetwork implement
this.supportsVmAutoScaling = supportsVmAutoScaling;
}
public void setTungstenVirtualRouterUuid(String tungstenVirtualRouterUuid) {
this.tungstenVirtualRouterUuid = tungstenVirtualRouterUuid;
}
public String getVpcName() {
return vpcName;
}

View File

@ -32,8 +32,17 @@
<id>juniper-contrail</id>
<url>https://juniper.github.io/contrail-maven/snapshots</url>
</repository>
<repository>
<id>juniper-tungsten-api</id>
<url>https://github.com/radu-todirica/tungsten-api/raw/master</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.juniper.tungsten</groupId>
<artifactId>juniper-tungsten-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
@ -202,6 +211,11 @@
<artifactId>cloud-plugin-network-ovs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-network-tungsten</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-network-elb</artifactId>

View File

@ -53,6 +53,12 @@ import com.cloud.utils.net.NetUtils;
*
*/
public interface ConfigurationManager {
public static final String MESSAGE_CREATE_POD_IP_RANGE_EVENT = "Message.CreatePodIpRange.Event";
public static final String MESSAGE_DELETE_POD_IP_RANGE_EVENT = "Message.DeletePodIpRange.Event";
public static final String MESSAGE_CREATE_VLAN_IP_RANGE_EVENT = "Message.CreateVlanIpRange.Event";
public static final String MESSAGE_DELETE_VLAN_IP_RANGE_EVENT = "Message.DeleteVlanIpRange.Event";
/**
* @param offering
* @return
@ -219,7 +225,7 @@ public interface ConfigurationManager {
Integer networkRate, Map<Service, Set<Provider>> serviceProviderMap, boolean isDefault, Network.GuestType type, boolean systemOnly, Long serviceOfferingId,
boolean conserveMode, Map<Service, Map<Capability, String>> serviceCapabilityMap, boolean specifyIpRanges, boolean isPersistent,
Map<NetworkOffering.Detail, String> details, boolean egressDefaultPolicy, Integer maxconn, boolean enableKeepAlive, Boolean forVpc,
List<Long> domainIds, List<Long> zoneIds, boolean enableOffering, final NetUtils.InternetProtocol internetProtocol);
Boolean forTungsten, List<Long> domainIds, List<Long> zoneIds, boolean enableOffering, final NetUtils.InternetProtocol internetProtocol);
Vlan createVlanAndPublicIpRange(long zoneId, long networkId, long physicalNetworkId, boolean forVirtualNetwork, boolean forSystemVms, Long podId, String startIP, String endIP,
String vlanGateway, String vlanNetmask, String vlanId, boolean bypassVlanOverlapCheck, Domain domain, Account vlanOwner, String startIPv6, String endIPv6, String vlanIp6Gateway, String vlanIp6Cidr)

View File

@ -72,6 +72,9 @@ public interface IpAddressManager {
PublicIp assignPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId, String requestedIp, boolean isSystem, boolean forSystemVms)
throws InsufficientAddressCapacityException;
PublicIp assignSourceNatPublicIpAddress(long dcId, Long podId, Account owner, VlanType type, Long networkId, String requestedIp, boolean isSystem, boolean forSystemVms)
throws InsufficientAddressCapacityException;
/**
* Do all of the work of releasing public ip addresses. Note that if this method fails, there can be side effects.
*
@ -227,5 +230,8 @@ public interface IpAddressManager {
final boolean forSystemVms,
final boolean lockOneRow)
throws InsufficientAddressCapacityException;
public static final String MESSAGE_ASSIGN_IPADDR_EVENT = "Message.AssignIpAddr.Event";
public static final String MESSAGE_RELEASE_IPADDR_EVENT = "Message.ReleaseIpAddr.Event";
}

View File

@ -467,6 +467,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
// populate providers
final Map<Network.Service, Set<Network.Provider>> defaultSharedNetworkOfferingProviders = new HashMap<Network.Service, Set<Network.Provider>>();
final Set<Network.Provider> defaultProviders = new HashSet<Network.Provider>();
final Set<Network.Provider> tungstenProvider = new HashSet<>();
defaultProviders.add(Network.Provider.VirtualRouter);
defaultSharedNetworkOfferingProviders.put(Service.Dhcp, defaultProviders);
@ -492,6 +493,14 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
sgProviders.add(Provider.SecurityGroupProvider);
defaultSharedSGEnabledNetworkOfferingProviders.put(Service.SecurityGroup, sgProviders);
tungstenProvider.add(Provider.Tungsten);
final Map<Network.Service, Set<Network.Provider>> defaultTungstenSharedSGEnabledNetworkOfferingProviders = new HashMap<>();
defaultTungstenSharedSGEnabledNetworkOfferingProviders.put(Service.Connectivity, tungstenProvider);
defaultTungstenSharedSGEnabledNetworkOfferingProviders.put(Service.Dhcp, tungstenProvider);
defaultTungstenSharedSGEnabledNetworkOfferingProviders.put(Service.Dns, tungstenProvider);
defaultTungstenSharedSGEnabledNetworkOfferingProviders.put(Service.UserData, tungstenProvider);
defaultTungstenSharedSGEnabledNetworkOfferingProviders.put(Service.SecurityGroup, tungstenProvider);
final Map<Network.Service, Set<Network.Provider>> defaultIsolatedSourceNatEnabledNetworkOfferingProviders = new HashMap<Network.Service, Set<Network.Provider>>();
defaultProviders.clear();
defaultProviders.add(Network.Provider.VirtualRouter);
@ -528,21 +537,29 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
if (_networkOfferingDao.findByUniqueName(NetworkOffering.QuickCloudNoServices) == null) {
offering = _configMgr.createNetworkOffering(NetworkOffering.QuickCloudNoServices, "Offering for QuickCloud with no services", TrafficType.Guest, null, true,
Availability.Optional, null, new HashMap<Network.Service, Set<Network.Provider>>(), true, Network.GuestType.Shared, false, null, true, null, true,
false, null, false, null, true, false, null, null, true, null);
false, null, false, null, true, false, false, null, null, true, null);
}
//#2 - SG enabled network offering
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedNetworkOfferingWithSGService) == null) {
offering = _configMgr.createNetworkOffering(NetworkOffering.DefaultSharedNetworkOfferingWithSGService, "Offering for Shared Security group enabled networks",
TrafficType.Guest, null, true, Availability.Optional, null, defaultSharedNetworkOfferingProviders, true, Network.GuestType.Shared, false, null, true,
null, true, false, null, false, null, true, false, null, null, true, null);
null, true, false, null, false, null, true, false, false, null, null, true, null);
}
//#3 - shared network offering with no SG service
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedNetworkOffering) == null) {
offering = _configMgr.createNetworkOffering(NetworkOffering.DefaultSharedNetworkOffering, "Offering for Shared networks", TrafficType.Guest, null, true,
Availability.Optional, null, defaultSharedNetworkOfferingProviders, true, Network.GuestType.Shared, false, null, true, null, true, false, null, false,
null, true, false, null, null, true, null);
null, true, false, false, null, null, true, null);
}
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DEFAULT_TUNGSTEN_SHARED_NETWORK_OFFERING_WITH_SGSERVICE) == null) {
offering = _configMgr.createNetworkOffering(NetworkOffering.DEFAULT_TUNGSTEN_SHARED_NETWORK_OFFERING_WITH_SGSERVICE, "Offering for Tungsten Shared Security group enabled networks",
TrafficType.Guest, null, true, Availability.Optional, null, defaultTungstenSharedSGEnabledNetworkOfferingProviders, true, Network.GuestType.Shared, false, null, true,
null, true, false, null, false, null, true, false, true,null, null, true, null);
offering.setState(NetworkOffering.State.Enabled);
_networkOfferingDao.update(offering.getId(), offering);
}
//#4 - default isolated offering with Source nat service
@ -550,14 +567,14 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
offering = _configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingWithSourceNatService,
"Offering for Isolated networks with Source Nat service enabled", TrafficType.Guest, null, false, Availability.Required, null,
defaultIsolatedSourceNatEnabledNetworkOfferingProviders, true, Network.GuestType.Isolated, false, null, true, null, false, false, null, false, null,
true, false, null, null, true, null);
true, false, false, null, null, true, null);
}
//#5 - default vpc offering with LB service
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworks) == null) {
offering = _configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworks,
"Offering for Isolated VPC networks with Source Nat service enabled", TrafficType.Guest, null, false, Availability.Optional, null,
defaultVPCOffProviders, true, Network.GuestType.Isolated, false, null, false, null, false, false, null, false, null, true, true, null, null, true, null);
defaultVPCOffProviders, true, Network.GuestType.Isolated, false, null, false, null, false, false, null, false, null, true, true, false, null, null, true, null);
}
//#6 - default vpc offering with no LB service
@ -566,14 +583,14 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
defaultVPCOffProviders.remove(Service.Lb);
offering = _configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksNoLB,
"Offering for Isolated VPC networks with Source Nat service enabled and LB service disabled", TrafficType.Guest, null, false, Availability.Optional,
null, defaultVPCOffProviders, true, Network.GuestType.Isolated, false, null, false, null, false, false, null, false, null, true, true, null, null, true, null);
null, defaultVPCOffProviders, true, Network.GuestType.Isolated, false, null, false, null, false, false, null, false, null, true, true, false, null, null, true, null);
}
//#7 - isolated offering with source nat disabled
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOffering) == null) {
offering = _configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOffering, "Offering for Isolated networks with no Source Nat service",
TrafficType.Guest, null, true, Availability.Optional, null, defaultIsolatedNetworkOfferingProviders, true, Network.GuestType.Isolated, false, null,
true, null, true, false, null, false, null, true, false, null, null, true, null);
true, null, true, false, null, false, null, true, false, false, null, null, true, null);
}
//#8 - network offering with internal lb service
@ -595,7 +612,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksWithInternalLB) == null) {
offering = _configMgr.createNetworkOffering(NetworkOffering.DefaultIsolatedNetworkOfferingForVpcNetworksWithInternalLB,
"Offering for Isolated VPC networks with Internal Lb support", TrafficType.Guest, null, false, Availability.Optional, null, internalLbOffProviders,
true, Network.GuestType.Isolated, false, null, false, null, false, false, null, false, null, true, true, null, null, true, null);
true, Network.GuestType.Isolated, false, null, false, null, false, false, null, false, null, true, true, false, null, null, true, null);
offering.setInternalLb(true);
offering.setPublicLb(false);
_networkOfferingDao.update(offering.getId(), offering);
@ -626,7 +643,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
if (_networkOfferingDao.findByUniqueName(NetworkOffering.DefaultSharedEIPandELBNetworkOffering) == null) {
offering = _configMgr.createNetworkOffering(NetworkOffering.DefaultSharedEIPandELBNetworkOffering,
"Offering for Shared networks with Elastic IP and Elastic LB capabilities", TrafficType.Guest, null, true, Availability.Optional, null,
netscalerServiceProviders, true, Network.GuestType.Shared, false, null, true, serviceCapabilityMap, true, false, null, false, null, true, false, null, null, true, null);
netscalerServiceProviders, true, Network.GuestType.Shared, false, null, true, serviceCapabilityMap, true, false, null, false, null, true, false, false, null, null, true, null);
offering.setDedicatedLB(false);
_networkOfferingDao.update(offering.getId(), offering);
}

View File

@ -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 com.cloud.network;
import com.cloud.utils.net.Ip;
import org.apache.cloudstack.api.InternalIdentity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = ("tungsten_guest_network_ip_address"))
public class TungstenGuestNetworkIpAddressVO implements InternalIdentity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "network_id")
private long networkId;
@Column(name = "public_ip_address")
@Enumerated(value = EnumType.STRING)
private Ip publicIpAddress = null;
@Column(name = "guest_ip_address")
@Enumerated(value = EnumType.STRING)
private Ip guestIpAddress = null;
@Column(name = "logical_router_uuid")
private String logicalRouterUuid;
public TungstenGuestNetworkIpAddressVO() {
}
public TungstenGuestNetworkIpAddressVO(long networkId, Ip guestIpAddress) {
this.networkId = networkId;
this.guestIpAddress = guestIpAddress;
}
public TungstenGuestNetworkIpAddressVO(long networkId, Ip guestIpAddress, String logicalRouterUuid) {
this.networkId = networkId;
this.guestIpAddress = guestIpAddress;
this.logicalRouterUuid = logicalRouterUuid;
}
@Override
public long getId() {
return id;
}
public long getNetworkId() {
return networkId;
}
public void setNetworkId(final long networkId) {
this.networkId = networkId;
}
public Ip getPublicIpAddress() {
return publicIpAddress;
}
public void setPublicIpAddress(final Ip publicIpAddress) {
this.publicIpAddress = publicIpAddress;
}
public Ip getGuestIpAddress() {
return guestIpAddress;
}
public void setGuestIpAddress(final Ip guestIpAddress) {
this.guestIpAddress = guestIpAddress;
}
public String getLogicalRouterUuid() {
return logicalRouterUuid;
}
public void setLogicalRouterUuid(final String logicalRouterUuid) {
this.logicalRouterUuid = logicalRouterUuid;
}
}

View File

@ -67,6 +67,8 @@ public interface IPAddressDao extends GenericDao<IPAddressVO, Long> {
List<IPAddressVO> listByPhysicalNetworkId(long physicalNetworkId);
IPAddressVO findByIpAndNetworkIdAndDcId(long networkId, long dcId, String ipAddress);
List<IPAddressVO> listByAssociatedVpc(long vpcId, Boolean isSourceNat);
long countFreePublicIPs();
@ -95,5 +97,7 @@ public interface IPAddressDao extends GenericDao<IPAddressVO, Long> {
IPAddressVO findByAccountIdAndZoneIdAndStateAndIpAddress(long accountId, long dcId, State state, String ipAddress);
List<IPAddressVO> listByDcIdAndAssociatedNetwork(long dcId);
List<IPAddressVO> listByNetworkId(long networkId);
}

View File

@ -59,6 +59,7 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen
protected GenericSearchBuilder<IPAddressVO, Integer> AllIpCountForDashboard;
protected SearchBuilder<IPAddressVO> DeleteAllExceptGivenIp;
protected GenericSearchBuilder<IPAddressVO, Long> AllocatedIpCountForAccount;
protected SearchBuilder<IPAddressVO> tungstenFloatingIpSearch;
@Inject
protected VlanDao _vlanDao;
protected GenericSearchBuilder<IPAddressVO, Long> CountFreePublicIps;
@ -151,6 +152,13 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen
CountFreePublicIps.join("vlans", join, CountFreePublicIps.entity().getVlanId(), join.entity().getId(), JoinBuilder.JoinType.INNER);
CountFreePublicIps.done();
tungstenFloatingIpSearch = createSearchBuilder();
tungstenFloatingIpSearch.and("dc", tungstenFloatingIpSearch.entity().getDataCenterId(), Op.EQ);
tungstenFloatingIpSearch.and("state", tungstenFloatingIpSearch.entity().getState(), Op.EQ);
tungstenFloatingIpSearch.and("network", tungstenFloatingIpSearch.entity().getAssociatedWithNetworkId(), Op.NNULL);
tungstenFloatingIpSearch.and("sourceNat", tungstenFloatingIpSearch.entity().isSourceNat(), Op.EQ);
tungstenFloatingIpSearch.done();
DeleteAllExceptGivenIp = createSearchBuilder();
DeleteAllExceptGivenIp.and("vlanDbId", DeleteAllExceptGivenIp.entity().getVlanId(), Op.EQ);
DeleteAllExceptGivenIp.and("ip", DeleteAllExceptGivenIp.entity().getAddress(), Op.NEQ);
@ -218,6 +226,15 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen
return findOneBy(sc);
}
@Override
public IPAddressVO findByIpAndNetworkIdAndDcId(long networkId, long dcId, String ipAddress) {
SearchCriteria<IPAddressVO> sc = AllFieldsSearch.create();
sc.setParameters("network", networkId);
sc.setParameters("ipAddress", ipAddress);
sc.setParameters("dataCenterId", dcId);
return findOneBy(sc);
}
@Override
public IPAddressVO findByIpAndNetworkId(long networkId, String ipAddress) {
SearchCriteria<IPAddressVO> sc = AllFieldsSearch.create();
@ -501,6 +518,15 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen
return findOneBy(sc);
}
@Override
public List<IPAddressVO> listByDcIdAndAssociatedNetwork(final long dcId) {
SearchCriteria<IPAddressVO> sc = tungstenFloatingIpSearch.create();
sc.setParameters("dataCenterId", dcId);
sc.setParameters("sourceNat", false);
sc.setParameters("state", State.Allocated);
return listBy(sc);
}
@Override
public List<IPAddressVO> listByNetworkId(long networkId) {
SearchCriteria<IPAddressVO> sc = AllFieldsSearch.create();

View File

@ -0,0 +1,34 @@
// 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.dao;
import com.cloud.network.TungstenGuestNetworkIpAddressVO;
import com.cloud.utils.db.GenericDao;
import java.util.List;
public interface TungstenGuestNetworkIpAddressDao extends GenericDao<TungstenGuestNetworkIpAddressVO, Long> {
List<String> listGuestIpAddressByNetworkId(long networkId);
List<TungstenGuestNetworkIpAddressVO> listByNetworkId(long networkId);
TungstenGuestNetworkIpAddressVO findByNetworkIdAndPublicIp(long networkId, String publicIp);
TungstenGuestNetworkIpAddressVO findByNetworkAndGuestIpAddress(long networkId, String guestIp);
TungstenGuestNetworkIpAddressVO findByNetworkAndLogicalRouter(long networkId, String logicalRouterUuid);
}

View File

@ -0,0 +1,93 @@
// 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.dao;
import com.cloud.network.TungstenGuestNetworkIpAddressVO;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.GenericSearchBuilder;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@DB
public class TungstenGuestNetworkIpAddressDaoImpl extends GenericDaoBase<TungstenGuestNetworkIpAddressVO, Long>
implements TungstenGuestNetworkIpAddressDao {
private static final String ID = "id";
private static final String NETWORK_ID = "network_id";
private static final String GUEST_IP_ADDRESS = "guest_ip_address";
private static final String PUBLIC_IP_ADDRESS = "public_ip_address";
private static final String LOGICAL_ROUTER_UUID = "logical_router_uuid";
final SearchBuilder<TungstenGuestNetworkIpAddressVO> allFieldsSearch;
final GenericSearchBuilder<TungstenGuestNetworkIpAddressVO, String> networkSearch;
public TungstenGuestNetworkIpAddressDaoImpl() {
allFieldsSearch = createSearchBuilder();
allFieldsSearch.and(ID, allFieldsSearch.entity().getId(), SearchCriteria.Op.EQ);
allFieldsSearch.and(NETWORK_ID, allFieldsSearch.entity().getNetworkId(), SearchCriteria.Op.EQ);
allFieldsSearch.and(GUEST_IP_ADDRESS, allFieldsSearch.entity().getGuestIpAddress(), SearchCriteria.Op.EQ);
allFieldsSearch.and(PUBLIC_IP_ADDRESS, allFieldsSearch.entity().getPublicIpAddress(), SearchCriteria.Op.EQ);
allFieldsSearch.and(LOGICAL_ROUTER_UUID, allFieldsSearch.entity().getLogicalRouterUuid(), SearchCriteria.Op.EQ);
allFieldsSearch.done();
networkSearch = createSearchBuilder(String.class);
networkSearch.select(null, SearchCriteria.Func.DISTINCT, networkSearch.entity().getGuestIpAddress());
networkSearch.and(NETWORK_ID, networkSearch.entity().getNetworkId(), SearchCriteria.Op.EQ);
networkSearch.done();
}
@Override
public List<String> listGuestIpAddressByNetworkId(long networkId) {
SearchCriteria<String> searchCriteria = networkSearch.create();
searchCriteria.setParameters(NETWORK_ID, networkId);
return customSearch(searchCriteria, null);
}
@Override
public List<TungstenGuestNetworkIpAddressVO> listByNetworkId(final long networkId) {
SearchCriteria<TungstenGuestNetworkIpAddressVO> searchCriteria = allFieldsSearch.create();
searchCriteria.setParameters(NETWORK_ID, networkId);
return listBy(searchCriteria);
}
@Override
public TungstenGuestNetworkIpAddressVO findByNetworkIdAndPublicIp(final long networkId, final String publicIp) {
SearchCriteria<TungstenGuestNetworkIpAddressVO> searchCriteria = allFieldsSearch.create();
searchCriteria.setParameters(NETWORK_ID, networkId);
searchCriteria.setParameters(PUBLIC_IP_ADDRESS, publicIp);
return findOneBy(searchCriteria);
}
@Override
public TungstenGuestNetworkIpAddressVO findByNetworkAndGuestIpAddress(final long networkId, final String guestIp) {
SearchCriteria<TungstenGuestNetworkIpAddressVO> searchCriteria = allFieldsSearch.create();
searchCriteria.setParameters(NETWORK_ID, networkId);
searchCriteria.setParameters(GUEST_IP_ADDRESS, guestIp);
return findOneBy(searchCriteria);
}
@Override
public TungstenGuestNetworkIpAddressVO findByNetworkAndLogicalRouter(final long networkId,
final String logicalRouterUuid) {
SearchCriteria<TungstenGuestNetworkIpAddressVO> searchCriteria = allFieldsSearch.create();
searchCriteria.setParameters(NETWORK_ID, networkId);
searchCriteria.setParameters(LOGICAL_ROUTER_UUID, logicalRouterUuid);
return findOneBy(searchCriteria);
}
}

View File

@ -0,0 +1,32 @@
// 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.dao;
import com.cloud.network.element.TungstenProviderVO;
import com.cloud.utils.db.GenericDao;
import java.util.List;
public interface TungstenProviderDao extends GenericDao<TungstenProviderVO, Long> {
TungstenProviderVO findByZoneId(long zoneId);
TungstenProviderVO findByUuid(String uuid);
List<TungstenProviderVO> findAll();
void deleteProviderByUuid(String providerUuid);
}

View File

@ -0,0 +1,84 @@
// 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.dao;
import com.cloud.network.element.TungstenProviderVO;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@DB()
public class TungstenProviderDaoImpl extends GenericDaoBase<TungstenProviderVO, Long>
implements TungstenProviderDao {
final SearchBuilder<TungstenProviderVO> allFieldsSearch;
public TungstenProviderDaoImpl() {
super();
allFieldsSearch = createSearchBuilder();
allFieldsSearch.and("id", allFieldsSearch.entity().getId(),
SearchCriteria.Op.EQ);
allFieldsSearch.and("uuid", allFieldsSearch.entity().getUuid(),
SearchCriteria.Op.EQ);
allFieldsSearch.and("hostname", allFieldsSearch.entity().getHostname(),
SearchCriteria.Op.EQ);
allFieldsSearch.and("provider_name", allFieldsSearch.entity().getProviderName(),
SearchCriteria.Op.EQ);
allFieldsSearch.and("port", allFieldsSearch.entity().getPort(),
SearchCriteria.Op.EQ);
allFieldsSearch.and("zone_id", allFieldsSearch.entity().getZoneId(),
SearchCriteria.Op.EQ);
allFieldsSearch.and("gateway", allFieldsSearch.entity().getGateway(),
SearchCriteria.Op.EQ);
allFieldsSearch.and("vrouter_port", allFieldsSearch.entity().getVrouterPort(),
SearchCriteria.Op.EQ);
allFieldsSearch.and("introspect_port", allFieldsSearch.entity().getIntrospectPort(),
SearchCriteria.Op.EQ);
allFieldsSearch.done();
}
@Override
public TungstenProviderVO findByZoneId(long nspId) {
SearchCriteria<TungstenProviderVO> sc = allFieldsSearch.create();
sc.setParameters("zone_id", nspId);
return findOneBy(sc);
}
@Override
public TungstenProviderVO findByUuid(String uuid) {
SearchCriteria<TungstenProviderVO> sc = allFieldsSearch.create();
sc.setParameters("uuid", uuid);
return findOneBy(sc);
}
@Override
public void deleteProviderByUuid(String providerUuid) {
SearchCriteria<TungstenProviderVO> sc = allFieldsSearch.create();
sc.setParameters("uuid", providerUuid);
remove(sc);
}
@Override
public List<TungstenProviderVO> findAll() {
return listAll();
}
}

View File

@ -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 com.cloud.network.element;
import com.cloud.network.TungstenProvider;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.UUID;
@Entity
@Table(name = "tungsten_providers")
public class TungstenProviderVO implements TungstenProvider {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
long id;
@Column(name = "zone_id")
private long zoneId;
@Column(name = "uuid")
private String uuid;
@Column(name = "host_id")
private long hostId;
@Column(name = "provider_name")
private String providerName;
@Column(name = "port")
private String port;
@Column(name = "hostname")
private String hostname;
@Column(name = "gateway")
private String gateway;
@Column(name = "vrouter_port")
private String vrouterPort;
@Column(name = "introspect_port")
private String introspectPort;
public TungstenProviderVO() {
this.uuid = UUID.randomUUID().toString();
}
public TungstenProviderVO(long zoneId, String providerName, long hostId, String port, String hostname, String gateway, String vrouterPort, String introspectPort) {
this.zoneId = zoneId;
this.uuid = UUID.randomUUID().toString();
this.providerName = providerName;
this.port = port;
this.hostname = hostname;
this.gateway = gateway;
this.vrouterPort = vrouterPort;
this.introspectPort = introspectPort;
this.hostId = hostId;
}
@Override
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
@Override
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
@Override
public String getHostname() {
return hostname;
}
public void setHostname(String hostname) {
this.hostname = hostname;
}
public String getProviderName() {
return providerName;
}
public void setProviderName(String providerName) {
this.providerName = providerName;
}
@Override
public String getPort() {
return port;
}
public void setPort(String port) {
this.port = port;
}
@Override
public long getZoneId() {
return zoneId;
}
public void setZoneId(final long zoneId) {
this.zoneId = zoneId;
}
@Override
public String getGateway() {
return gateway;
}
public void setGateway(final String gateway) {
this.gateway = gateway;
}
@Override
public String getIntrospectPort() {
return introspectPort;
}
public void setIntrospectPort(final String introspectPort) {
this.introspectPort = introspectPort;
}
@Override
public String getVrouterPort() {
return vrouterPort;
}
public void setVrouterPort(final String vrouterPort) {
this.vrouterPort = vrouterPort;
}
@Override
public long getHostId() {
return hostId;
}
public void setHostId(long hostId) {
this.hostId = hostId;
}
}

View File

@ -0,0 +1,129 @@
// 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.security;
import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = ("tungsten_security_group_rule"))
public class TungstenSecurityGroupRuleVO implements TungstenSecurityGroupRule {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(name = "uuid")
private String uuid;
@Column(name = "zone_id")
private long zoneId;
@Column(name = "security_group_id")
private long securityGroupId;
@Column(name = "rule_type")
private String ruleType;
@Column(name = "rule_target")
private String ruleTarget;
@Column(name = "ether_type")
private String etherType;
@Column(name = "default_rule")
private boolean defaultRule;
public TungstenSecurityGroupRuleVO() {
this.uuid = UUID.randomUUID().toString();
}
public TungstenSecurityGroupRuleVO(final long zoneId, final long securityGroupId, final String ruleType,
final String ruleTarget, final String etherType, final boolean defaultRule) {
this.uuid = UUID.randomUUID().toString();
this.zoneId = zoneId;
this.securityGroupId = securityGroupId;
this.ruleType = ruleType;
this.ruleTarget = ruleTarget;
this.etherType = etherType;
this.defaultRule = defaultRule;
}
@Override
public String getUuid() {
return uuid;
}
@Override
public long getId() {
return id;
}
public long getZoneId() {
return zoneId;
}
public void setZoneId(final long zoneId) {
this.zoneId = zoneId;
}
public long getSecurityGroupId() {
return securityGroupId;
}
public void setSecurityGroupId(final long securityGroupId) {
this.securityGroupId = securityGroupId;
}
public String getRuleType() {
return ruleType;
}
public void setRuleType(final String ruleType) {
this.ruleType = ruleType;
}
public String getRuleTarget() {
return ruleTarget;
}
public void setRuleTarget(final String ruleTarget) {
this.ruleTarget = ruleTarget;
}
public String getEtherType() {
return etherType;
}
public void setEtherType(final String etherType) {
this.etherType = etherType;
}
public boolean isDefaultRule() {
return defaultRule;
}
public void setDefaultRule(final boolean defaultRule) {
this.defaultRule = defaultRule;
}
}

View File

@ -0,0 +1,31 @@
// 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.security.dao;
import com.cloud.network.security.TungstenSecurityGroupRuleVO;
import com.cloud.utils.db.GenericDao;
import java.util.List;
public interface TungstenSecurityGroupRuleDao extends GenericDao<TungstenSecurityGroupRuleVO, Long> {
TungstenSecurityGroupRuleVO findDefaultSecurityRule(long securityGroupId, String ruleType, String etherType);
TungstenSecurityGroupRuleVO findBySecurityGroupAndRuleTypeAndRuleTarget(long securityGroupId, String ruleType,
String ruleTarget);
List<TungstenSecurityGroupRuleVO> listByRuleTarget(String ruleTarget);
}

View File

@ -0,0 +1,78 @@
// 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.security.dao;
import com.cloud.network.security.TungstenSecurityGroupRuleVO;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class TungstenSecurityGroupRuleDaoImpl extends GenericDaoBase<TungstenSecurityGroupRuleVO, Long>
implements TungstenSecurityGroupRuleDao {
private static final String ID = "id";
private static final String UUID = "uuid";
private static final String SECURITY_GROUP_ID = "security_group_id";
private static final String RULE_TYPE = "rule_type";
private static final String RULE_TARGET = "rule_target";
private static final String ETHER_TYPE = "ether_type";
private static final String DEFAULT_RULE = "default_rule";
protected final SearchBuilder<TungstenSecurityGroupRuleVO> allFieldsSearch;
protected TungstenSecurityGroupRuleDaoImpl() {
allFieldsSearch = createSearchBuilder();
allFieldsSearch.and(ID, allFieldsSearch.entity().getId(), SearchCriteria.Op.EQ);
allFieldsSearch.and(UUID, allFieldsSearch.entity().getUuid(), SearchCriteria.Op.EQ);
allFieldsSearch.and(SECURITY_GROUP_ID, allFieldsSearch.entity().getSecurityGroupId(), SearchCriteria.Op.EQ);
allFieldsSearch.and(RULE_TYPE, allFieldsSearch.entity().getRuleType(), SearchCriteria.Op.EQ);
allFieldsSearch.and(RULE_TARGET, allFieldsSearch.entity().getRuleTarget(), SearchCriteria.Op.EQ);
allFieldsSearch.and(ETHER_TYPE, allFieldsSearch.entity().getEtherType(), SearchCriteria.Op.EQ);
allFieldsSearch.and(DEFAULT_RULE, allFieldsSearch.entity().isDefaultRule(), SearchCriteria.Op.EQ);
allFieldsSearch.done();
}
@Override
public TungstenSecurityGroupRuleVO findDefaultSecurityRule(final long securityGroupId, final String ruleType
, final String etherType) {
SearchCriteria<TungstenSecurityGroupRuleVO> searchCriteria = allFieldsSearch.create();
searchCriteria.setParameters(SECURITY_GROUP_ID, securityGroupId);
searchCriteria.setParameters(RULE_TYPE, ruleType);
searchCriteria.setParameters(ETHER_TYPE, etherType);
searchCriteria.setParameters(DEFAULT_RULE, true);
return findOneBy(searchCriteria);
}
@Override
public TungstenSecurityGroupRuleVO findBySecurityGroupAndRuleTypeAndRuleTarget(final long securityGroupId,
final String ruleType, final String ruleTarget) {
SearchCriteria<TungstenSecurityGroupRuleVO> searchCriteria = allFieldsSearch.create();
searchCriteria.setParameters(SECURITY_GROUP_ID, securityGroupId);
searchCriteria.setParameters(RULE_TYPE, ruleType);
searchCriteria.setParameters(RULE_TARGET, ruleTarget);
return findOneBy(searchCriteria);
}
@Override
public List<TungstenSecurityGroupRuleVO> listByRuleTarget(final String ruleTarget) {
SearchCriteria<TungstenSecurityGroupRuleVO> searchCriteria = allFieldsSearch.create();
searchCriteria.setParameters(RULE_TARGET, ruleTarget);
return listBy(searchCriteria);
}
}

View File

@ -133,6 +133,9 @@ public class NetworkOfferingVO implements NetworkOffering {
@Column(name = "for_vpc")
boolean forVpc;
@Column(name = "for_tungsten")
boolean forTungsten = false;
@Column(name = "egress_default_policy")
boolean egressdefaultpolicy;
@ -183,6 +186,15 @@ public class NetworkOfferingVO implements NetworkOffering {
this.forVpc = isForVpc;
}
@Override
public boolean isForTungsten() {
return forTungsten;
}
public void setForTungsten(boolean forTungsten) {
this.forTungsten = forTungsten;
}
@Override
public long getId() {
return id;

View File

@ -136,6 +136,7 @@
<bean id="nicIpAliasDaoImpl" class="com.cloud.vm.dao.NicIpAliasDaoImpl" />
<bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl" />
<bean id="ovsProviderDaoImpl" class="com.cloud.network.dao.OvsProviderDaoImpl" />
<bean id="tungstenControllerDaoImpl" class="com.cloud.network.dao.TungstenProviderDaoImpl"/>
<bean id="physicalNetworkDaoImpl" class="com.cloud.network.dao.PhysicalNetworkDaoImpl" />
<bean id="physicalNetworkIsolationMethodDaoImpl" class="com.cloud.network.dao.PhysicalNetworkIsolationMethodDaoImpl" />
<bean id="physicalNetworkServiceProviderDaoImpl" class="com.cloud.network.dao.PhysicalNetworkServiceProviderDaoImpl" />
@ -239,6 +240,8 @@
<bean id="applicationLbRuleDaoImpl" class="org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDaoImpl" />
<bean id="vpcOfferingDetailsDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingDetailsDaoImpl"/>
<bean id="networkDetailsDaoImpl" class="com.cloud.network.dao.NetworkDetailsDaoImpl" />
<bean id="tungstenGuestNetworkIpAddressDaoImpl" class="com.cloud.network.dao.TungstenGuestNetworkIpAddressDaoImpl"/>
<bean id="tungstenSecurityGroupRuleDaoImpl" class="com.cloud.network.security.dao.TungstenSecurityGroupRuleDaoImpl"/>
<bean id="vlanDetailsDaoImpl" class="com.cloud.dc.dao.VlanDetailsDaoImpl" />
<bean id="AffinityGroupDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupDaoImpl" />
<bean id="AffinityGroupVMMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDaoImpl" />

View File

@ -1049,6 +1049,132 @@ WHERE usage_unit = 'Policy-Month';
-- delete configuration task.cleanup.retry.interval #6910
DELETE FROM `cloud`.`configuration` WHERE name='task.cleanup.retry.interval';
-- Tungsten Fabric Plugin --
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.network_offerings','for_tungsten', 'int(1) unsigned DEFAULT "0" COMMENT "is tungsten enabled for the resource"');
-- Network offering with multi-domains and multi-zones
DROP VIEW IF EXISTS `cloud`.`network_offering_view`;
CREATE VIEW `cloud`.`network_offering_view` AS
SELECT
`network_offerings`.`id` AS `id`,
`network_offerings`.`uuid` AS `uuid`,
`network_offerings`.`name` AS `name`,
`network_offerings`.`unique_name` AS `unique_name`,
`network_offerings`.`display_text` AS `display_text`,
`network_offerings`.`nw_rate` AS `nw_rate`,
`network_offerings`.`mc_rate` AS `mc_rate`,
`network_offerings`.`traffic_type` AS `traffic_type`,
`network_offerings`.`tags` AS `tags`,
`network_offerings`.`system_only` AS `system_only`,
`network_offerings`.`specify_vlan` AS `specify_vlan`,
`network_offerings`.`service_offering_id` AS `service_offering_id`,
`network_offerings`.`conserve_mode` AS `conserve_mode`,
`network_offerings`.`created` AS `created`,
`network_offerings`.`removed` AS `removed`,
`network_offerings`.`default` AS `default`,
`network_offerings`.`availability` AS `availability`,
`network_offerings`.`dedicated_lb_service` AS `dedicated_lb_service`,
`network_offerings`.`shared_source_nat_service` AS `shared_source_nat_service`,
`network_offerings`.`sort_key` AS `sort_key`,
`network_offerings`.`redundant_router_service` AS `redundant_router_service`,
`network_offerings`.`state` AS `state`,
`network_offerings`.`guest_type` AS `guest_type`,
`network_offerings`.`elastic_ip_service` AS `elastic_ip_service`,
`network_offerings`.`eip_associate_public_ip` AS `eip_associate_public_ip`,
`network_offerings`.`elastic_lb_service` AS `elastic_lb_service`,
`network_offerings`.`specify_ip_ranges` AS `specify_ip_ranges`,
`network_offerings`.`inline` AS `inline`,
`network_offerings`.`is_persistent` AS `is_persistent`,
`network_offerings`.`internal_lb` AS `internal_lb`,
`network_offerings`.`public_lb` AS `public_lb`,
`network_offerings`.`egress_default_policy` AS `egress_default_policy`,
`network_offerings`.`concurrent_connections` AS `concurrent_connections`,
`network_offerings`.`keep_alive_enabled` AS `keep_alive_enabled`,
`network_offerings`.`supports_streched_l2` AS `supports_streched_l2`,
`network_offerings`.`supports_public_access` AS `supports_public_access`,
`network_offerings`.`supports_vm_autoscaling` AS `supports_vm_autoscaling`,
`network_offerings`.`for_vpc` AS `for_vpc`,
`network_offerings`.`for_tungsten` AS `for_tungsten`,
`network_offerings`.`service_package_id` AS `service_package_id`,
GROUP_CONCAT(DISTINCT(domain.id)) AS domain_id,
GROUP_CONCAT(DISTINCT(domain.uuid)) AS domain_uuid,
GROUP_CONCAT(DISTINCT(domain.name)) AS domain_name,
GROUP_CONCAT(DISTINCT(domain.path)) AS domain_path,
GROUP_CONCAT(DISTINCT(zone.id)) AS zone_id,
GROUP_CONCAT(DISTINCT(zone.uuid)) AS zone_uuid,
GROUP_CONCAT(DISTINCT(zone.name)) AS zone_name,
`offering_details`.value AS internet_protocol
FROM
`cloud`.`network_offerings`
LEFT JOIN
`cloud`.`network_offering_details` AS `domain_details` ON `domain_details`.`network_offering_id` = `network_offerings`.`id` AND `domain_details`.`name`='domainid'
LEFT JOIN
`cloud`.`domain` AS `domain` ON FIND_IN_SET(`domain`.`id`, `domain_details`.`value`)
LEFT JOIN
`cloud`.`network_offering_details` AS `zone_details` ON `zone_details`.`network_offering_id` = `network_offerings`.`id` AND `zone_details`.`name`='zoneid'
LEFT JOIN
`cloud`.`data_center` AS `zone` ON FIND_IN_SET(`zone`.`id`, `zone_details`.`value`)
LEFT JOIN
`cloud`.`network_offering_details` AS `offering_details` ON `offering_details`.`network_offering_id` = `network_offerings`.`id` AND `offering_details`.`name`='internetProtocol'
GROUP BY
`network_offerings`.`id`;
CREATE TABLE IF NOT EXISTS `cloud`.`tungsten_providers` (
`id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
`zone_id` bigint unsigned NOT NULL COMMENT 'Zone ID',
`uuid` varchar(40),
`host_id` bigint unsigned NOT NULL,
`provider_name` varchar(40),
`port` varchar(40),
`hostname` varchar(40),
`gateway` varchar(40),
`vrouter_port` varchar(40),
`introspect_port` varchar(40),
PRIMARY KEY (`id`),
CONSTRAINT `fk_tungsten_providers__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE,
CONSTRAINT `fk_tungsten_providers__zone_id` FOREIGN KEY (`zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE,
CONSTRAINT `uc_tungsten_providers__uuid` UNIQUE (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `cloud`.`tungsten_guest_network_ip_address` (
`id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
`network_id` bigint unsigned NOT NULL COMMENT 'network id',
`public_ip_address` varchar(15) COMMENT 'ip public_ip_address',
`guest_ip_address` varchar(15) NOT NULL COMMENT 'ip guest_ip_address',
`logical_router_uuid` varchar(40) COMMENT 'logical router uuid',
PRIMARY KEY (`id`),
CONSTRAINT `fk_tungsten_guest_network_ip_address__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `cloud`.`tungsten_security_group_rule` (
`id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
`uuid` varchar(40) NOT NULL COMMENT 'rule uuid',
`zone_id` bigint unsigned NOT NULL COMMENT 'Zone ID',
`security_group_id` bigint unsigned NOT NULL COMMENT 'security group id',
`rule_type` varchar(40) NOT NULL COMMENT 'rule type',
`rule_target` varchar(40) NOT NULL COMMENT 'rule target',
`ether_type` varchar(40) NOT NULL COMMENT 'ether type',
`default_rule` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if security group is default',
PRIMARY KEY (`id`),
CONSTRAINT `fk_tungsten_security_group_rule__security_group_id` FOREIGN KEY (`security_group_id`) REFERENCES `security_group`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `cloud`.`tungsten_lb_health_monitor` (
`id` bigint unsigned NOT NULL auto_increment,
`uuid` varchar(40),
`load_balancer_id` bigint unsigned NOT NULL,
`type` varchar(40) NOT NULL,
`retry` bigint unsigned NOT NULL,
`timeout` bigint unsigned NOT NULL,
`interval` bigint unsigned NOT NULL,
`http_method` varchar(40),
`expected_code` varchar(40),
`url_path` varchar(255),
PRIMARY KEY (`id`),
CONSTRAINT `fk_tungsten_lb_health_monitor__load_balancer_id` FOREIGN KEY(`load_balancer_id`) REFERENCES `load_balancing_rules`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--- #6888 add index to speed up querying IPs in the network-tab
DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_ADD_KEY`;

View File

@ -83,6 +83,11 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-network-tungsten</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@ -50,6 +50,7 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.cloudstack.api.ApiConstants.IoDriverPolicy;
import org.apache.cloudstack.network.tungsten.service.TungstenService;
import org.apache.cloudstack.storage.configdrive.ConfigDrive;
import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
import org.apache.cloudstack.storage.to.TemplateObjectTO;
@ -297,6 +298,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
public static final String RESIZE_NOTIFY_ONLY = "NOTIFYONLY";
public static final String BASEPATH = "/usr/share/cloudstack-common/vms/";
public static final String TUNGSTEN_PATH = "scripts/vm/network/tungsten";
private String _modifyVlanPath;
private String _versionstringpath;
private String _patchScriptPath;
@ -311,6 +314,12 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
private String _ovsPvlanVmPath;
private String _routerProxyPath;
private String _ovsTunnelPath;
private String setupTungstenVrouterPath;
private String updateTungstenLoadbalancerStatsPath;
private String updateTungstenLoadbalancerSslPath;
private String _host;
private String _dcId;
private String _clusterId;
private final Properties _uefiProperties = new Properties();
@ -341,10 +350,12 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
private KVMStoragePoolManager _storagePoolMgr;
private VifDriver _defaultVifDriver;
private VifDriver tungstenVifDriver;
private Map<TrafficType, VifDriver> _trafficTypeVifDrivers;
protected static final String DEFAULT_OVS_VIF_DRIVER_CLASS_NAME = "com.cloud.hypervisor.kvm.resource.OvsVifDriver";
protected static final String DEFAULT_BRIDGE_VIF_DRIVER_CLASS_NAME = "com.cloud.hypervisor.kvm.resource.BridgeVifDriver";
protected static final String DEFAULT_TUNGSTEN_VIF_DRIVER_CLASS_NAME = "com.cloud.hypervisor.kvm.resource.VRouterVifDriver";
private final static long HYPERVISOR_LIBVIRT_VERSION_SUPPORTS_IO_URING = 6003000;
private final static long HYPERVISOR_QEMU_VERSION_SUPPORTS_IO_URING = 5000000;
@ -702,7 +713,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
protected List<String> _cpuFeatures;
protected enum BridgeType {
NATIVE, OPENVSWITCH
NATIVE, OPENVSWITCH, TUNGSTEN
}
protected BridgeType _bridgeType;
@ -789,6 +800,10 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
return _publicNic;
}
protected String getDefaultTungstenScriptsDir() {
return TUNGSTEN_PATH;
}
@Override
public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
boolean success = super.configure(name, params);
@ -814,8 +829,17 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
String storageScriptsDir = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.STORAGE_SCRIPTS_DIR);
String tungstenScriptsDir = (String) params.get("tungsten.scripts.dir");
if (tungstenScriptsDir == null) {
tungstenScriptsDir = getDefaultTungstenScriptsDir();
}
final String bridgeType = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.NETWORK_BRIDGE_TYPE);
_bridgeType = BridgeType.valueOf(bridgeType.toUpperCase());
if (bridgeType == null) {
_bridgeType = BridgeType.NATIVE;
} else {
_bridgeType = BridgeType.valueOf(bridgeType.toUpperCase());
}
Boolean dpdk = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.OPENVSWITCH_DPDK_ENABLED);
if (_bridgeType == BridgeType.OPENVSWITCH && BooleanUtils.isTrue(dpdk)) {
@ -918,6 +942,21 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
throw new ConfigurationException("Unable to find the ovs-pvlan-kvm-vm.sh");
}
setupTungstenVrouterPath = Script.findScript(tungstenScriptsDir, "setup_tungsten_vrouter.sh");
if (setupTungstenVrouterPath == null) {
throw new ConfigurationException("Unable to find the setup_tungsten_vrouter.sh");
}
updateTungstenLoadbalancerStatsPath = Script.findScript(tungstenScriptsDir, "update_tungsten_loadbalancer_stats.sh");
if (updateTungstenLoadbalancerStatsPath == null) {
throw new ConfigurationException("Unable to find the update_tungsten_loadbalancer_stats.sh");
}
updateTungstenLoadbalancerSslPath = Script.findScript(tungstenScriptsDir, "update_tungsten_loadbalancer_ssl.sh");
if (updateTungstenLoadbalancerSslPath == null) {
throw new ConfigurationException("Unable to find the update_tungsten_loadbalancer_ssl.sh");
}
final boolean isDeveloper = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.DEVELOPER);
if (isDeveloper) {
params.putAll(getDeveloperProperties());
@ -1442,6 +1481,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
defaultVifDriverName = DEFAULT_BRIDGE_VIF_DRIVER_CLASS_NAME;
}
}
tungstenVifDriver = getVifDriverClass(DEFAULT_TUNGSTEN_VIF_DRIVER_CLASS_NAME, params);
_defaultVifDriver = getVifDriverClass(defaultVifDriverName, params);
// Load any per-traffic-type vif drivers
@ -1516,6 +1556,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
final Set<VifDriver> vifDrivers = new HashSet<VifDriver>();
vifDrivers.add(_defaultVifDriver);
if (TungstenService.isTungstenEnabled(Long.parseLong(_dcId))) {
vifDrivers.add(tungstenVifDriver);
}
vifDrivers.addAll(_trafficTypeVifDrivers.values());
final ArrayList<VifDriver> vifDriverList = new ArrayList<VifDriver>(vifDrivers);
@ -4545,6 +4588,61 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
return true;
}
public boolean setupTungstenVRouter(final String oper, final String inf, final String subnet, final String route,
final String vrf) {
final Script cmd = new Script(setupTungstenVrouterPath, _timeout, s_logger);
cmd.add(oper);
cmd.add(inf);
cmd.add(subnet);
cmd.add(route);
cmd.add(vrf);
final String result = cmd.execute();
return result == null;
}
public boolean updateTungstenLoadbalancerStats(final String lbUuid, final String lbStatsPort,
final String lbStatsUri, final String lbStatsAuth) {
final Script cmd = new Script(updateTungstenLoadbalancerStatsPath, _timeout, s_logger);
cmd.add(lbUuid);
cmd.add(lbStatsPort);
cmd.add(lbStatsUri);
cmd.add(lbStatsAuth);
final String result = cmd.execute();
return result == null;
}
public boolean updateTungstenLoadbalancerSsl(final String lbUuid, final String sslCertName,
final String certificateKey, final String privateKey, final String privateIp, final String port) {
final Script cmd = new Script(updateTungstenLoadbalancerSslPath, _timeout, s_logger);
cmd.add(lbUuid);
cmd.add(sslCertName);
cmd.add(certificateKey);
cmd.add(privateKey);
cmd.add(privateIp);
cmd.add(port);
final String result = cmd.execute();
return result == null;
}
public boolean setupTfRoute(final String privateIpAddress, final String fromNetwork, final String toNetwork) {
final Script setupTfRouteScript = new Script(_routerProxyPath, _timeout, s_logger);
setupTfRouteScript.add("setup_tf_route.py");
setupTfRouteScript.add(privateIpAddress);
setupTfRouteScript.add(fromNetwork);
setupTfRouteScript.add(toNetwork);
final OutputInterpreter.OneLineParser setupTfRouteParser = new OutputInterpreter.OneLineParser();
final String result = setupTfRouteScript.execute(setupTfRouteParser);
if (result != null) {
s_logger.debug("Failed to execute setup TF Route:" + result);
return false;
}
return true;
}
public boolean cleanupRules() {
if (!_canBridgeFirewall) {
return false;

View File

@ -0,0 +1,117 @@
// 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;
import com.cloud.agent.api.to.NicTO;
import com.cloud.exception.InternalErrorException;
import com.cloud.utils.TungstenUtils;
import com.cloud.utils.script.Script;
import org.apache.log4j.Logger;
import org.joda.time.Duration;
import org.libvirt.LibvirtException;
import java.io.File;
import java.util.Map;
import javax.naming.ConfigurationException;
public class VRouterVifDriver extends VifDriverBase {
private static final Logger s_logger = Logger.getLogger(VRouterVifDriver.class);
private String createTapDeviceScript;
private String deleteTapDeviceScript;
@Override
public void configure(final Map<String, Object> params) throws ConfigurationException {
super.configure(params);
String tungstenScriptsDir = (String) params.get("tungsten.scripts.dir");
tungstenScriptsDir = tungstenScriptsDir == null ? _libvirtComputingResource.getDefaultTungstenScriptsDir() : tungstenScriptsDir;
createTapDeviceScript = Script.findScript(tungstenScriptsDir, "create_tap_device.sh");
deleteTapDeviceScript = Script.findScript(tungstenScriptsDir, "delete_tap_device.sh");
if (createTapDeviceScript == null) {
throw new ConfigurationException("Unable to find create_tap_device.sh");
}
if (deleteTapDeviceScript == null) {
throw new ConfigurationException("Unable to find delete_tap_device.sh");
}
}
@Override
public LibvirtVMDef.InterfaceDef plug(final NicTO nic, final String guestOsType, final String nicAdapter,
final Map<String, String> extraConfig) throws InternalErrorException, LibvirtException {
final String tapDeviceName = TungstenUtils.getTapName(nic.getMac());
final String script = createTapDeviceScript;
final Script command = new Script(script, Duration.standardSeconds(300), s_logger);
command.add(tapDeviceName);
final String result = command.execute();
if (result != null) {
throw new InternalErrorException("Failed to create tap device " + tapDeviceName + ": " + result);
}
final LibvirtVMDef.InterfaceDef intf = new LibvirtVMDef.InterfaceDef();
intf.defEthernet(tapDeviceName, nic.getMac(), getGuestNicModel(guestOsType, nicAdapter));
return intf;
}
@Override
public void unplug(final LibvirtVMDef.InterfaceDef iface, boolean deleteBr) {
final String tapDeviceName = TungstenUtils.getTapName(iface.getMacAddress());
final String script = deleteTapDeviceScript;
final Script command = new Script(script, Duration.standardSeconds(300), s_logger);
command.add(tapDeviceName);
final String result = command.execute();
if (result != null) {
s_logger.error("Failed to delete tap device " + tapDeviceName + ": " + result);
}
}
@Override
public void attach(final LibvirtVMDef.InterfaceDef iface) {
// not use
}
@Override
public void detach(final LibvirtVMDef.InterfaceDef iface) {
// not use
}
@Override
public void createControlNetwork(final String privBrName) {
// not use
}
@Override
public boolean isExistingBridge(String bridgeName) {
File f = new File("/sys/devices/virtual/net/" + bridgeName);
return f.exists();
}
@Override
public void deleteBr(NicTO nic) {
// not use
}
}

View File

@ -0,0 +1,39 @@
// 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.wrapper;
import com.cloud.agent.api.Answer;
import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
import com.cloud.resource.CommandWrapper;
import com.cloud.resource.ResourceWrapper;
import org.apache.cloudstack.network.tungsten.agent.api.SetupTfRouteCommand;
import java.io.IOException;
@ResourceWrapper(handles = SetupTfRouteCommand.class)
public class LibvirtSetTfRouteCommandWrapper
extends CommandWrapper<SetupTfRouteCommand, Answer, LibvirtComputingResource> {
@Override
public Answer execute(final SetupTfRouteCommand command, final LibvirtComputingResource serverResource) {
boolean result = serverResource.setupTfRoute(command.getPrivateIp(), command.getPublicIp(), command.getSrcNetwork());
if (result) {
return new Answer(command, true, null);
} else {
return new Answer(command, new IOException());
}
}
}

View File

@ -0,0 +1,40 @@
// 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.wrapper;
import com.cloud.agent.api.Answer;
import org.apache.cloudstack.network.tungsten.agent.api.SetupTungstenVRouterCommand;
import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
import com.cloud.resource.CommandWrapper;
import com.cloud.resource.ResourceWrapper;
import java.io.IOException;
@ResourceWrapper(handles = SetupTungstenVRouterCommand.class)
public class LibvirtSetupTungstenVRouterCommandWrapper
extends CommandWrapper<SetupTungstenVRouterCommand, Answer, LibvirtComputingResource> {
@Override
public Answer execute(final SetupTungstenVRouterCommand command, final LibvirtComputingResource serverResource) {
boolean result = serverResource.setupTungstenVRouter(command.getOper(), command.getInf(), command.getSubnet(),
command.getRoute(), command.getVrf());
if (result) {
return new Answer(command, true, null);
} else {
return new Answer(command, new IOException());
}
}
}

View File

@ -0,0 +1,44 @@
//
// 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.wrapper;
import com.cloud.agent.api.Answer;
import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
import com.cloud.resource.CommandWrapper;
import com.cloud.resource.ResourceWrapper;
import org.apache.cloudstack.network.tungsten.agent.api.UpdateTungstenLoadbalancerSslCommand;
import java.io.IOException;
@ResourceWrapper(handles = UpdateTungstenLoadbalancerSslCommand.class)
public class LibvirtUpdateTungstenLoadbalancerSslCommandWrapper
extends CommandWrapper<UpdateTungstenLoadbalancerSslCommand, Answer, LibvirtComputingResource> {
@Override
public Answer execute(final UpdateTungstenLoadbalancerSslCommand command,
final LibvirtComputingResource serverResource) {
boolean result = serverResource.updateTungstenLoadbalancerSsl(command.getLbUuid(), command.getSslCertName(),
command.getCertificateKey(), command.getPrivateKey(), command.getPrivateIp(), command.getPort());
if (result) {
return new Answer(command, true, null);
} else {
return new Answer(command, new IOException());
}
}
}

View File

@ -0,0 +1,44 @@
//
// 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.wrapper;
import com.cloud.agent.api.Answer;
import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
import com.cloud.resource.CommandWrapper;
import com.cloud.resource.ResourceWrapper;
import org.apache.cloudstack.network.tungsten.agent.api.UpdateTungstenLoadbalancerStatsCommand;
import java.io.IOException;
@ResourceWrapper(handles = UpdateTungstenLoadbalancerStatsCommand.class)
public class LibvirtUpdateTungstenLoadbalancerStatsCommandWrapper
extends CommandWrapper<UpdateTungstenLoadbalancerStatsCommand, Answer, LibvirtComputingResource> {
@Override
public Answer execute(final UpdateTungstenLoadbalancerStatsCommand command,
final LibvirtComputingResource serverResource) {
boolean result = serverResource.updateTungstenLoadbalancerStats(command.getLbUuid(), command.getLbStatsPort(),
command.getLbStatsUri(), command.getLbStatsAuth());
if (result) {
return new Answer(command, true, null);
} else {
return new Answer(command, new IOException());
}
}
}

View File

@ -57,7 +57,7 @@ public class LibvirtVifDriverTest {
final String FakeVifDriverClassName = "com.cloud.hypervisor.kvm.resource.FakeVifDriver";
final String NonExistentVifDriverClassName = "com.cloud.hypervisor.kvm.resource.NonExistentVifDriver";
private VifDriver fakeVifDriver, bridgeVifDriver, ovsVifDriver;
private VifDriver fakeVifDriver, bridgeVifDriver, ovsVifDriver, tungstenVifDriver;
final String memInfo = "MemTotal: 5830236 kB\n" +
"MemFree: 156752 kB\n" +
@ -77,6 +77,7 @@ public class LibvirtVifDriverTest {
try {
bridgeVifDriver = (VifDriver)Class.forName(LibvirtComputingResource.DEFAULT_BRIDGE_VIF_DRIVER_CLASS_NAME).newInstance();
ovsVifDriver = (VifDriver)Class.forName(LibvirtComputingResource.DEFAULT_OVS_VIF_DRIVER_CLASS_NAME).newInstance();
tungstenVifDriver = (VifDriver)Class.forName(LibvirtComputingResource.DEFAULT_TUNGSTEN_VIF_DRIVER_CLASS_NAME).newInstance();
// Instantiating bridge vif driver again as the fake vif driver
// is good enough, as this is a separate instance
@ -84,6 +85,7 @@ public class LibvirtVifDriverTest {
doReturn(bridgeVifDriver).when(res).getVifDriverClass(eq(LibvirtComputingResource.DEFAULT_BRIDGE_VIF_DRIVER_CLASS_NAME), anyMap());
doReturn(ovsVifDriver).when(res).getVifDriverClass(eq(LibvirtComputingResource.DEFAULT_OVS_VIF_DRIVER_CLASS_NAME), anyMap());
doReturn(tungstenVifDriver).when(res).getVifDriverClass(eq(LibvirtComputingResource.DEFAULT_TUNGSTEN_VIF_DRIVER_CLASS_NAME), anyMap());
doReturn(fakeVifDriver).when(res).getVifDriverClass(eq(FakeVifDriverClassName), anyMap());
} catch (final ConfigurationException ex) {

View File

@ -219,7 +219,7 @@ public class ContrailManagerImpl extends ManagerBase implements ContrailManager
ConfigurationManager configMgr = (ConfigurationManager) _configService;
NetworkOfferingVO voffer = configMgr.createNetworkOffering(offeringName, offeringDisplayText,
TrafficType.Public, null, true, Availability.Optional, null, serviceProviderMap, true,
Network.GuestType.Shared, false, null, false, null, true, false, null, true, null, false, false, null, null, true, null);
Network.GuestType.Shared, false, null, false, null, true, false, null, true, null, false, false, false, null, null, true, null);
long id = voffer.getId();
_networkOfferingDao.update(id, voffer);
return _networkOfferingDao.findById(id);
@ -254,7 +254,7 @@ public class ContrailManagerImpl extends ManagerBase implements ContrailManager
ConfigurationManager configMgr = (ConfigurationManager)_configService;
NetworkOfferingVO voffer =
configMgr.createNetworkOffering(offeringName, offeringDisplayText, TrafficType.Guest, null, false, Availability.Optional, null, serviceProviderMap, true,
Network.GuestType.Isolated, false, null, false, null, false, true, null, true, null, false, offeringName.equals(vpcRouterOfferingName), null, null, true, null);
Network.GuestType.Isolated, false, null, false, null, false, true, null, true, null, false, offeringName.equals(vpcRouterOfferingName), false, null, null, true, null);
if (offeringName.equals(vpcRouterOfferingName)) {
voffer.setInternalLb(true);
}

View File

@ -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-Fabric Network</name>
<parent>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloudstack-plugins</artifactId>
<version>4.18.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<repositories>
<repository>
<id>juniper-tungsten-api</id>
<url>https://github.com/radu-todirica/tungsten-api/raw/master</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.juniper.tungsten</groupId>
<artifactId>juniper-tungsten-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,57 @@
// 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.agent.api;
import java.util.Objects;
public class AddTungstenNetworkGatewayToLogicalRouterCommand extends TungstenCommand {
private final String networkUuid;
private final String logicalRouterUuid;
private final String ipAddress;
public AddTungstenNetworkGatewayToLogicalRouterCommand(String networkUuid, String logicalRouterUuid, String ipAddress) {
this.networkUuid = networkUuid;
this.logicalRouterUuid = logicalRouterUuid;
this.ipAddress = ipAddress;
}
public String getNetworkUuid() {
return networkUuid;
}
public String getLogicalRouterUuid() {
return logicalRouterUuid;
}
public String getIpAddress() {
return ipAddress;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
AddTungstenNetworkGatewayToLogicalRouterCommand that = (AddTungstenNetworkGatewayToLogicalRouterCommand) o;
return Objects.equals(networkUuid, that.networkUuid) && Objects.equals(logicalRouterUuid, that.logicalRouterUuid) && Objects.equals(ipAddress, that.ipAddress);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), networkUuid, logicalRouterUuid, ipAddress);
}
}

View File

@ -0,0 +1,101 @@
// 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.agent.api;
import java.util.Objects;
public class AddTungstenNetworkSubnetCommand extends TungstenCommand {
private final String networkUuid;
private final String ipPrefix;
private final int ipPrefixLen;
private final String gateway;
private final boolean dhcpEnable;
private final String dnsServer;
private final String allocationStart;
private final String allocationEnd;
private final boolean ipFromStart;
private final String subnetName;
public AddTungstenNetworkSubnetCommand(final String networkUuid, final String ipPrefix, final int ipPrefixLen,
final String gateway, final boolean dhcpEnable, final String dnsServer, final String allocationStart,
final String allocationEnd, final boolean ipFromStart, final String subnetName) {
this.networkUuid = networkUuid;
this.ipPrefix = ipPrefix;
this.ipPrefixLen = ipPrefixLen;
this.gateway = gateway;
this.dhcpEnable = dhcpEnable;
this.dnsServer = dnsServer;
this.allocationStart = allocationStart;
this.allocationEnd = allocationEnd;
this.ipFromStart = ipFromStart;
this.subnetName = subnetName;
}
public String getNetworkUuid() {
return networkUuid;
}
public String getIpPrefix() {
return ipPrefix;
}
public int getIpPrefixLen() {
return ipPrefixLen;
}
public String getGateway() {
return gateway;
}
public boolean isDhcpEnable() {
return dhcpEnable;
}
public String getDnsServer() {
return dnsServer;
}
public String getAllocationStart() {
return allocationStart;
}
public String getAllocationEnd() {
return allocationEnd;
}
public boolean isIpFromStart() {
return ipFromStart;
}
public String getSubnetName() {
return subnetName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
AddTungstenNetworkSubnetCommand that = (AddTungstenNetworkSubnetCommand) o;
return ipPrefixLen == that.ipPrefixLen && dhcpEnable == that.dhcpEnable && ipFromStart == that.ipFromStart && Objects.equals(networkUuid, that.networkUuid) && Objects.equals(ipPrefix, that.ipPrefix) && Objects.equals(gateway, that.gateway) && Objects.equals(dnsServer, that.dnsServer) && Objects.equals(allocationStart, that.allocationStart) && Objects.equals(allocationEnd, that.allocationEnd) && Objects.equals(subnetName, that.subnetName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), networkUuid, ipPrefix, ipPrefixLen, gateway, dhcpEnable, dnsServer, allocationStart, allocationEnd, ipFromStart, subnetName);
}
}

View File

@ -0,0 +1,133 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class AddTungstenPolicyRuleCommand extends TungstenCommand {
private final String uuid;
private final String policyUuid;
private final String action;
private final String direction;
private final String protocol;
private final String srcNetwork;
private final String srcIpPrefix;
private final int srcIpPrefixLen;
private final int srcStartPort;
private final int srcEndPort;
private final String destNetwork;
private final String destIpPrefix;
private final int destIpPrefixLen;
private final int destStartPort;
private final int destEndPort;
public AddTungstenPolicyRuleCommand(final String policyUuid, final String action, final String direction,
final String protocol, final String srcNetwork, final String srcIpPrefix, final int srcIpPrefixLen,
final int srcStartPort, final int srcEndPort, final String destNetwork, final String destIpPrefix,
final int destIpPrefixLen, final int destStartPort, final int destEndPort) {
this.uuid = UUID.randomUUID().toString();
this.policyUuid = policyUuid;
this.action = action;
this.direction = direction;
this.protocol = protocol;
this.srcNetwork = srcNetwork;
this.srcIpPrefix = srcIpPrefix;
this.srcIpPrefixLen = srcIpPrefixLen;
this.srcStartPort = srcStartPort;
this.srcEndPort = srcEndPort;
this.destNetwork = destNetwork;
this.destIpPrefix = destIpPrefix;
this.destIpPrefixLen = destIpPrefixLen;
this.destStartPort = destStartPort;
this.destEndPort = destEndPort;
}
public String getUuid() {
return uuid;
}
public String getPolicyUuid() {
return policyUuid;
}
public String getAction() {
return action;
}
public String getDirection() {
return direction;
}
public String getProtocol() {
return protocol;
}
public String getSrcNetwork() {
return srcNetwork;
}
public String getSrcIpPrefix() {
return srcIpPrefix;
}
public int getSrcIpPrefixLen() {
return srcIpPrefixLen;
}
public int getSrcStartPort() {
return srcStartPort;
}
public int getSrcEndPort() {
return srcEndPort;
}
public String getDestNetwork() {
return destNetwork;
}
public String getDestIpPrefix() {
return destIpPrefix;
}
public int getDestIpPrefixLen() {
return destIpPrefixLen;
}
public int getDestStartPort() {
return destStartPort;
}
public int getDestEndPort() {
return destEndPort;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
AddTungstenPolicyRuleCommand that = (AddTungstenPolicyRuleCommand) o;
return srcIpPrefixLen == that.srcIpPrefixLen && srcStartPort == that.srcStartPort && srcEndPort == that.srcEndPort && destIpPrefixLen == that.destIpPrefixLen && destStartPort == that.destStartPort && destEndPort == that.destEndPort && Objects.equals(uuid, that.uuid) && Objects.equals(policyUuid, that.policyUuid) && Objects.equals(action, that.action) && Objects.equals(direction, that.direction) && Objects.equals(protocol, that.protocol) && Objects.equals(srcNetwork, that.srcNetwork) && Objects.equals(srcIpPrefix, that.srcIpPrefix) && Objects.equals(destNetwork, that.destNetwork) && Objects.equals(destIpPrefix, that.destIpPrefix);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, policyUuid, action, direction, protocol, srcNetwork, srcIpPrefix, srcIpPrefixLen, srcStartPort, srcEndPort, destNetwork, destIpPrefix, destIpPrefixLen, destStartPort, destEndPort);
}
}

View File

@ -0,0 +1,64 @@
// 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.agent.api;
import java.util.Objects;
public class AddTungstenSecondaryIpAddressCommand extends TungstenCommand {
private final String networkUuid;
private final String nicUuid;
private final String iiName;
private final String address;
public AddTungstenSecondaryIpAddressCommand(final String networkUuid, final String nicUuid, final String iiName,
final String address) {
this.networkUuid = networkUuid;
this.nicUuid = nicUuid;
this.iiName = iiName;
this.address = address;
}
public String getNetworkUuid() {
return networkUuid;
}
public String getNicUuid() {
return nicUuid;
}
public String getIiName() {
return iiName;
}
public String getAddress() {
return address;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
AddTungstenSecondaryIpAddressCommand that = (AddTungstenSecondaryIpAddressCommand) o;
return Objects.equals(networkUuid, that.networkUuid) && Objects.equals(nicUuid, that.nicUuid) && Objects.equals(iiName, that.iiName) && Objects.equals(address, that.address);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), networkUuid, nicUuid, iiName, address);
}
}

View File

@ -0,0 +1,89 @@
// 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.agent.api;
import java.util.Objects;
public class AddTungstenSecurityGroupRuleCommand extends TungstenCommand {
private final String tungstenSecurityGroupUuid;
private final String tungstenGroupRuleUuid;
private final String securityGroupRuleType;
private final int startPort;
private final int endPort;
private final String target;
private final String etherType;
private final String protocol;
public AddTungstenSecurityGroupRuleCommand(String tungstenSecurityGroupUuid, String tungstenGroupRuleUuid,
String securityGroupRuleType, int startPort, int endPort,
String target, String etherType, String protocol) {
this.tungstenSecurityGroupUuid = tungstenSecurityGroupUuid;
this.tungstenGroupRuleUuid = tungstenGroupRuleUuid;
this.securityGroupRuleType = securityGroupRuleType;
this.startPort = startPort;
this.endPort = endPort;
this.target = target;
this.etherType = etherType;
this.protocol = protocol;
}
public String getTungstenSecurityGroupUuid() {
return tungstenSecurityGroupUuid;
}
public String getTungstenGroupRuleUuid() {
return tungstenGroupRuleUuid;
}
public String getSecurityGroupRuleType() {
return securityGroupRuleType;
}
public int getStartPort() {
return startPort;
}
public int getEndPort() {
return endPort;
}
public String getTarget() {
return target;
}
public String getEtherType() {
return etherType;
}
public String getProtocol() {
return protocol;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
AddTungstenSecurityGroupRuleCommand that = (AddTungstenSecurityGroupRuleCommand) o;
return startPort == that.startPort && endPort == that.endPort && Objects.equals(tungstenSecurityGroupUuid, that.tungstenSecurityGroupUuid) && Objects.equals(tungstenGroupRuleUuid, that.tungstenGroupRuleUuid) && Objects.equals(securityGroupRuleType, that.securityGroupRuleType) && Objects.equals(target, that.target) && Objects.equals(etherType, that.etherType) && Objects.equals(protocol, that.protocol);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tungstenSecurityGroupUuid, tungstenGroupRuleUuid, securityGroupRuleType, startPort, endPort, target, etherType, protocol);
}
}

View File

@ -0,0 +1,52 @@
// 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.agent.api;
import java.util.List;
import java.util.Objects;
public class AddTungstenVmToSecurityGroupCommand extends TungstenCommand {
private final String nicUuid;
private final List<String> securityGroupUuidList;
public AddTungstenVmToSecurityGroupCommand(String nicUuid, List<String> securityGroupUuidList) {
this.nicUuid = nicUuid;
this.securityGroupUuidList = securityGroupUuidList;
}
public String getNicUuid() {
return nicUuid;
}
public List<String> getSecurityGroupUuidList() {
return securityGroupUuidList;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
AddTungstenVmToSecurityGroupCommand that = (AddTungstenVmToSecurityGroupCommand) o;
return Objects.equals(nicUuid, that.nicUuid) && Objects.equals(securityGroupUuidList, that.securityGroupUuidList);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), nicUuid, securityGroupUuidList);
}
}

View File

@ -0,0 +1,86 @@
// 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.agent.api;
import java.util.Objects;
public class ApplyTungstenNetworkPolicyCommand extends TungstenCommand {
private final String projectFqn;
private final String networkPolicyName;
private final String networkUuid;
private final String policyUuid;
private final int majorSequence;
private final int minorSequence;
public ApplyTungstenNetworkPolicyCommand(final String networkUuid, final String policyUuid, final int majorSequence,
final int minorSequence) {
this.projectFqn = null;
this.networkPolicyName = null;
this.networkUuid = networkUuid;
this.policyUuid = policyUuid;
this.majorSequence = majorSequence;
this.minorSequence = minorSequence;
}
public ApplyTungstenNetworkPolicyCommand(final String projectFqn, final String networkPolicyName,
final String networkUuid, final int majorSequence, final int minorSequence) {
this.projectFqn = projectFqn;
this.networkPolicyName = networkPolicyName;
this.networkUuid = networkUuid;
this.policyUuid = null;
this.majorSequence = majorSequence;
this.minorSequence = minorSequence;
}
public String getProjectFqn() {
return projectFqn;
}
public String getNetworkPolicyName() {
return networkPolicyName;
}
public String getNetworkUuid() {
return networkUuid;
}
public String getPolicyUuid() {
return policyUuid;
}
public int getMajorSequence() {
return majorSequence;
}
public int getMinorSequence() {
return minorSequence;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ApplyTungstenNetworkPolicyCommand that = (ApplyTungstenNetworkPolicyCommand) o;
return majorSequence == that.majorSequence && minorSequence == that.minorSequence && Objects.equals(projectFqn, that.projectFqn) && Objects.equals(networkPolicyName, that.networkPolicyName) && Objects.equals(networkUuid, that.networkUuid) && Objects.equals(policyUuid, that.policyUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, networkPolicyName, networkUuid, policyUuid, majorSequence, minorSequence);
}
}

View File

@ -0,0 +1,89 @@
// 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.agent.api;
import java.util.Objects;
public class ApplyTungstenPortForwardingCommand extends TungstenCommand {
private final boolean isAdd;
private final String publicNetworkUuid;
private final String floatingIpPoolName;
private final String floatingIpName;
private final String vmiUuid;
private final String protocol;
private final int publicPort;
private final int privatePort;
public ApplyTungstenPortForwardingCommand(final boolean isAdd, final String publicNetworkUuid,
final String floatingIpPoolName, final String floatingIpName, final String vmiUuid, final String protocol,
final int publicPort, final int privatePort) {
this.isAdd = isAdd;
this.publicNetworkUuid = publicNetworkUuid;
this.floatingIpPoolName = floatingIpPoolName;
this.floatingIpName = floatingIpName;
this.vmiUuid = vmiUuid;
this.protocol = protocol;
this.publicPort = publicPort;
this.privatePort = privatePort;
}
public boolean isAdd() {
return isAdd;
}
public String getPublicNetworkUuid() {
return publicNetworkUuid;
}
public String getFloatingIpPoolName() {
return floatingIpPoolName;
}
public String getFloatingIpName() {
return floatingIpName;
}
public String getVmiUuid() {
return vmiUuid;
}
public String getProtocol() {
return protocol;
}
public int getPublicPort() {
return publicPort;
}
public int getPrivatePort() {
return privatePort;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ApplyTungstenPortForwardingCommand that = (ApplyTungstenPortForwardingCommand) o;
return isAdd == that.isAdd && publicPort == that.publicPort && privatePort == that.privatePort && Objects.equals(publicNetworkUuid, that.publicNetworkUuid) && Objects.equals(floatingIpPoolName, that.floatingIpPoolName) && Objects.equals(floatingIpName, that.floatingIpName) && Objects.equals(vmiUuid, that.vmiUuid) && Objects.equals(protocol, that.protocol);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), isAdd, publicNetworkUuid, floatingIpPoolName, floatingIpName, vmiUuid, protocol, publicPort, privatePort);
}
}

View File

@ -0,0 +1,77 @@
// 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.agent.api;
import java.util.List;
import java.util.Objects;
public class ApplyTungstenTagCommand extends TungstenCommand {
private final List<String> networkUuids;
private final List<String> vmUuids;
private final List<String> nicUuids;
private final String policyUuid;
private final String applicationPolicySetUuid;
private final String tagUuid;
public ApplyTungstenTagCommand(final List<String> networkUuids, final List<String> vmUuids,
final List<String> nicUuids, final String policyUuid, final String applicationPolicySetUuid, final String tagUuid) {
this.networkUuids = networkUuids;
this.vmUuids = vmUuids;
this.nicUuids = nicUuids;
this.policyUuid = policyUuid;
this.applicationPolicySetUuid = applicationPolicySetUuid;
this.tagUuid = tagUuid;
}
public List<String> getNetworkUuids() {
return networkUuids;
}
public List<String> getVmUuids() {
return vmUuids;
}
public List<String> getNicUuids() {
return nicUuids;
}
public String getPolicyUuid() {
return policyUuid;
}
public String getApplicationPolicySetUuid() {
return applicationPolicySetUuid;
}
public String getTagUuid() {
return tagUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ApplyTungstenTagCommand that = (ApplyTungstenTagCommand) o;
return Objects.equals(networkUuids, that.networkUuids) && Objects.equals(vmUuids, that.vmUuids) && Objects.equals(nicUuids, that.nicUuids) && Objects.equals(policyUuid, that.policyUuid) && Objects.equals(applicationPolicySetUuid, that.applicationPolicySetUuid) && Objects.equals(tagUuid, that.tagUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), networkUuids, vmUuids, nicUuids, policyUuid, applicationPolicySetUuid, tagUuid);
}
}

View File

@ -0,0 +1,70 @@
// 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.agent.api;
import java.util.Objects;
public class AssignTungstenFloatingIpCommand extends TungstenCommand {
private final String networkUuid;
private final String vmiUuid;
private final String fipName;
private final String name;
private final String privateIp;
public AssignTungstenFloatingIpCommand(final String networkUuid, final String vmiUuid, final String fipName,
final String name, final String privateIp) {
this.networkUuid = networkUuid;
this.vmiUuid = vmiUuid;
this.fipName = fipName;
this.name = name;
this.privateIp = privateIp;
}
public String getNetworkUuid() {
return networkUuid;
}
public String getVmiUuid() {
return vmiUuid;
}
public String getFipName() {
return fipName;
}
public String getName() {
return name;
}
public String getPrivateIp() {
return privateIp;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
AssignTungstenFloatingIpCommand that = (AssignTungstenFloatingIpCommand) o;
return Objects.equals(networkUuid, that.networkUuid) && Objects.equals(vmiUuid, that.vmiUuid) && Objects.equals(fipName, that.fipName) && Objects.equals(name, that.name) && Objects.equals(privateIp, that.privateIp);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), networkUuid, vmiUuid, fipName, name, privateIp);
}
}

View File

@ -0,0 +1,57 @@
// 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.agent.api;
import java.util.Objects;
public class ClearTungstenNetworkGatewayCommand extends TungstenCommand {
private final String projectFqn;
private final String routerName;
private final long vnId;
public ClearTungstenNetworkGatewayCommand(final String projectFqn, final String routerName, final long vnId) {
this.projectFqn = projectFqn;
this.routerName = routerName;
this.vnId = vnId;
}
public String getProjectFqn() {
return projectFqn;
}
public String getRouterName() {
return routerName;
}
public long getVnId() {
return vnId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ClearTungstenNetworkGatewayCommand that = (ClearTungstenNetworkGatewayCommand) o;
return vnId == that.vnId && Objects.equals(projectFqn, that.projectFqn) && Objects.equals(routerName, that.routerName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, routerName, vnId);
}
}

View File

@ -0,0 +1,64 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class CreateTungstenAddressGroupCommand extends TungstenCommand {
private final String uuid;
private final String name;
private final String ipPrefix;
private final int ipPrefixLen;
public CreateTungstenAddressGroupCommand(final String name, final String ipPrefix, final int ipPrefixLen) {
this.uuid = UUID.randomUUID().toString();
this.name = name;
this.ipPrefix = ipPrefix;
this.ipPrefixLen = ipPrefixLen;
}
public String getUuid() {
return uuid;
}
public String getName() {
return name;
}
public String getIpPrefix() {
return ipPrefix;
}
public int getIpPrefixLen() {
return ipPrefixLen;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenAddressGroupCommand that = (CreateTungstenAddressGroupCommand) o;
return ipPrefixLen == that.ipPrefixLen && Objects.equals(uuid, that.uuid) && Objects.equals(name, that.name) && Objects.equals(ipPrefix, that.ipPrefix);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, name, ipPrefix, ipPrefixLen);
}
}

View File

@ -0,0 +1,52 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class CreateTungstenApplicationPolicySetCommand extends TungstenCommand {
private final String uuid;
private final String name;
public CreateTungstenApplicationPolicySetCommand(final String name) {
this.uuid = UUID.randomUUID().toString();
this.name = name;
}
public String getUuid() {
return uuid;
}
public String getName() {
return name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenApplicationPolicySetCommand that = (CreateTungstenApplicationPolicySetCommand) o;
return Objects.equals(uuid, that.uuid) && Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, name);
}
}

View File

@ -0,0 +1,20 @@
// 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.agent.api;
public class CreateTungstenDefaultProjectCommand extends TungstenCommand {
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class CreateTungstenDomainCommand extends TungstenCommand {
private final String tungstenDomainName;
private final String tungstenDomainUuid;
public CreateTungstenDomainCommand(String tungstenDomainName, String tungstenDomainUuid) {
this.tungstenDomainName = tungstenDomainName;
this.tungstenDomainUuid = tungstenDomainUuid;
}
public String getTungstenDomainName() {
return tungstenDomainName;
}
public String getTungstenDomainUuid() {
return tungstenDomainUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenDomainCommand that = (CreateTungstenDomainCommand) o;
return Objects.equals(tungstenDomainName, that.tungstenDomainName) && Objects.equals(tungstenDomainUuid, that.tungstenDomainUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tungstenDomainName, tungstenDomainUuid);
}
}

View File

@ -0,0 +1,64 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class CreateTungstenFirewallPolicyCommand extends TungstenCommand {
private final String uuid;
private final String applicationPolicySetUuid;
private final String name;
private final int sequence;
public CreateTungstenFirewallPolicyCommand(final String name, final String applicationPolicySetUuid, final int sequence) {
this.uuid = UUID.randomUUID().toString();
this.applicationPolicySetUuid = applicationPolicySetUuid;
this.name = name;
this.sequence = sequence;
}
public String getUuid() {
return uuid;
}
public String getApplicationPolicySetUuid() {
return applicationPolicySetUuid;
}
public String getName() {
return name;
}
public int getSequence() {
return sequence;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenFirewallPolicyCommand that = (CreateTungstenFirewallPolicyCommand) o;
return sequence == that.sequence && Objects.equals(uuid, that.uuid) && Objects.equals(applicationPolicySetUuid, that.applicationPolicySetUuid) && Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, applicationPolicySetUuid, name, sequence);
}
}

View File

@ -0,0 +1,126 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class CreateTungstenFirewallRuleCommand extends TungstenCommand {
private final String uuid;
private final String firewallPolicyUuid;
private final String name;
private final String action;
private final String serviceGroupUuid;
private final String srcTagUuid;
private final String srcAddressGroupUuid;
private final String srcNetworkUuid;
private final String direction;
private final String destTagUuid;
private final String destAddressGroupUuid;
private final String destNetworkUuid;
private final String tagTypeUuid;
private final int sequence;
public CreateTungstenFirewallRuleCommand(final String firewallPolicyUuid, final String name, final String action, final String serviceGroupUuid,
final String srcTagUuid, final String srcAddressGroupUuid, final String srcNetworkUuid, final String direction, final String destTagUuid,
final String destAddressGroupUuid, final String destNetworkUuid, final String tagTypeUuid, final int sequence) {
this.uuid = UUID.randomUUID().toString();
this.firewallPolicyUuid = firewallPolicyUuid;
this.name = name;
this.action = action;
this.serviceGroupUuid = serviceGroupUuid;
this.srcTagUuid = srcTagUuid;
this.srcAddressGroupUuid = srcAddressGroupUuid;
this.srcNetworkUuid = srcNetworkUuid;
this.direction = direction;
this.destTagUuid = destTagUuid;
this.destAddressGroupUuid = destAddressGroupUuid;
this.destNetworkUuid = destNetworkUuid;
this.tagTypeUuid = tagTypeUuid;
this.sequence = sequence;
}
public String getUuid() {
return uuid;
}
public String getFirewallPolicyUuid() {
return firewallPolicyUuid;
}
public String getName() {
return name;
}
public String getAction() {
return action;
}
public String getServiceGroupUuid() {
return serviceGroupUuid;
}
public String getSrcAddressGroupUuid() {
return srcAddressGroupUuid;
}
public String getSrcNetworkUuid() {
return srcNetworkUuid;
}
public String getDirection() {
return direction;
}
public String getDestAddressGroupUuid() {
return destAddressGroupUuid;
}
public String getDestNetworkUuid() {
return destNetworkUuid;
}
public String getTagTypeUuid() {
return tagTypeUuid;
}
public String getSrcTagUuid() {
return srcTagUuid;
}
public String getDestTagUuid() {
return destTagUuid;
}
public int getSequence() {
return sequence;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenFirewallRuleCommand that = (CreateTungstenFirewallRuleCommand) o;
return sequence == that.sequence && Objects.equals(uuid, that.uuid) && Objects.equals(firewallPolicyUuid, that.firewallPolicyUuid) && Objects.equals(name, that.name) && Objects.equals(action, that.action) && Objects.equals(serviceGroupUuid, that.serviceGroupUuid) && Objects.equals(srcTagUuid, that.srcTagUuid) && Objects.equals(srcAddressGroupUuid, that.srcAddressGroupUuid) && Objects.equals(srcNetworkUuid, that.srcNetworkUuid) && Objects.equals(direction, that.direction) && Objects.equals(destTagUuid, that.destTagUuid) && Objects.equals(destAddressGroupUuid, that.destAddressGroupUuid) && Objects.equals(destNetworkUuid, that.destNetworkUuid) && Objects.equals(tagTypeUuid, that.tagTypeUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, firewallPolicyUuid, name, action, serviceGroupUuid, srcTagUuid, srcAddressGroupUuid, srcNetworkUuid, direction, destTagUuid, destAddressGroupUuid, destNetworkUuid, tagTypeUuid, sequence);
}
}

View File

@ -0,0 +1,70 @@
// 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.agent.api;
import java.util.Objects;
public class CreateTungstenFloatingIpCommand extends TungstenCommand {
private final String projectFqn;
private final String networkUuid;
private final String fipName;
private final String name;
private final String publicIp;
public CreateTungstenFloatingIpCommand(final String projectFqn, final String networkUuid, final String fipName,
final String name, final String publicIp) {
this.projectFqn = projectFqn;
this.networkUuid = networkUuid;
this.fipName = fipName;
this.name = name;
this.publicIp = publicIp;
}
public String getProjectFqn() {
return projectFqn;
}
public String getNetworkUuid() {
return networkUuid;
}
public String getFipName() {
return fipName;
}
public String getName() {
return name;
}
public String getPublicIp() {
return publicIp;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenFloatingIpCommand that = (CreateTungstenFloatingIpCommand) o;
return Objects.equals(projectFqn, that.projectFqn) && Objects.equals(networkUuid, that.networkUuid) && Objects.equals(fipName, that.fipName) && Objects.equals(name, that.name) && Objects.equals(publicIp, that.publicIp);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, networkUuid, fipName, name, publicIp);
}
}

View File

@ -0,0 +1,59 @@
// 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.agent.api;
import java.util.Objects;
public class CreateTungstenFloatingIpPoolCommand extends TungstenCommand {
private String networkUuid;
private String fipName;
public CreateTungstenFloatingIpPoolCommand(final String networkUuid, final String fipName) {
this.networkUuid = networkUuid;
this.fipName = fipName;
}
public String getNetworkUuid() {
return networkUuid;
}
public void setNetworkUuid(final String networkUuid) {
this.networkUuid = networkUuid;
}
public String getFipName() {
return fipName;
}
public void setFipName(final String fipName) {
this.fipName = fipName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenFloatingIpPoolCommand that = (CreateTungstenFloatingIpPoolCommand) o;
return Objects.equals(networkUuid, that.networkUuid) && Objects.equals(fipName, that.fipName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), networkUuid, fipName);
}
}

View File

@ -0,0 +1,57 @@
// 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.agent.api;
import java.util.Objects;
public class CreateTungstenLogicalRouterCommand extends TungstenCommand {
private final String name;
private final String projectFqn;
private final String pubNetworkUuid;
public CreateTungstenLogicalRouterCommand(final String name, final String projectFqn, final String pubNetworkUuid) {
this.name = name;
this.projectFqn = projectFqn;
this.pubNetworkUuid = pubNetworkUuid;
}
public String getName() {
return name;
}
public String getProjectFqn() {
return projectFqn;
}
public String getPubNetworkUuid() {
return pubNetworkUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenLogicalRouterCommand that = (CreateTungstenLogicalRouterCommand) o;
return Objects.equals(name, that.name) && Objects.equals(projectFqn, that.projectFqn) && Objects.equals(pubNetworkUuid, that.pubNetworkUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), name, projectFqn, pubNetworkUuid);
}
}

View File

@ -0,0 +1,139 @@
// 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.agent.api;
import java.util.Objects;
public class CreateTungstenNetworkCommand extends TungstenCommand {
private final String uuid;
private final String name;
private final String displayName;
private final String projectFqn;
private final boolean routerExternal;
private final boolean shared;
private final String ipPrefix;
private final int ipPrefixLen;
private final String gateway;
private final boolean dhcpEnable;
private final String dnsServer;
private final String allocationStart;
private final String allocationEnd;
private final boolean ipFromStart;
private final boolean isManagementNetwork;
private final String subnetName;
public CreateTungstenNetworkCommand(final String uuid, final String name, final String displayName,
final String projectFqn, final boolean routerExternal, final boolean shared, final String ipPrefix,
final int ipPrefixLen, final String gateway, final boolean dhcpEnable, final String dnsServer,
final String allocationStart, final String allocationEnd, final boolean ipFromStart,
final boolean isManagementNetwork, final String subnetName) {
this.uuid = uuid;
this.name = name;
this.displayName = displayName;
this.projectFqn = projectFqn;
this.routerExternal = routerExternal;
this.shared = shared;
this.ipPrefix = ipPrefix;
this.ipPrefixLen = ipPrefixLen;
this.gateway = gateway;
this.dhcpEnable = dhcpEnable;
this.dnsServer = dnsServer;
this.allocationStart = allocationStart;
this.allocationEnd = allocationEnd;
this.ipFromStart = ipFromStart;
this.isManagementNetwork = isManagementNetwork;
this.subnetName = subnetName;
}
public String getUuid() {
return uuid;
}
public String getName() {
return name;
}
public String getDisplayName() {
return displayName;
}
public String getProjectFqn() {
return projectFqn;
}
public boolean isRouterExternal() {
return routerExternal;
}
public boolean isShared() {
return shared;
}
public String getIpPrefix() {
return ipPrefix;
}
public int getIpPrefixLen() {
return ipPrefixLen;
}
public String getGateway() {
return gateway;
}
public boolean isDhcpEnable() {
return dhcpEnable;
}
public String getDnsServer() {
return dnsServer;
}
public String getAllocationStart() {
return allocationStart;
}
public String getAllocationEnd() {
return allocationEnd;
}
public boolean isIpFromStart() {
return ipFromStart;
}
public boolean isManagementNetwork() {
return isManagementNetwork;
}
public String getSubnetName() {
return subnetName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenNetworkCommand that = (CreateTungstenNetworkCommand) o;
return routerExternal == that.routerExternal && shared == that.shared && ipPrefixLen == that.ipPrefixLen && dhcpEnable == that.dhcpEnable && ipFromStart == that.ipFromStart && isManagementNetwork == that.isManagementNetwork && Objects.equals(uuid, that.uuid) && Objects.equals(name, that.name) && Objects.equals(displayName, that.displayName) && Objects.equals(projectFqn, that.projectFqn) && Objects.equals(ipPrefix, that.ipPrefix) && Objects.equals(gateway, that.gateway) && Objects.equals(dnsServer, that.dnsServer) && Objects.equals(allocationStart, that.allocationStart) && Objects.equals(allocationEnd, that.allocationEnd) && Objects.equals(subnetName, that.subnetName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, name, displayName, projectFqn, routerExternal, shared, ipPrefix, ipPrefixLen, gateway, dhcpEnable, dnsServer, allocationStart, allocationEnd, ipFromStart, isManagementNetwork, subnetName);
}
}

View File

@ -0,0 +1,200 @@
// 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.agent.api;
import org.apache.cloudstack.network.tungsten.model.TungstenLoadBalancerMember;
import java.util.List;
import java.util.Objects;
public class CreateTungstenNetworkLoadbalancerCommand extends TungstenCommand {
private final String projectFqn;
private final String networkUuid;
private final String publicNetworkUuid;
private final String loadBalancerMethod;
private final String loadBalancerName;
private final String loadBalancerListenerName;
private final String loadBalancerPoolName;
private final String loadBalancerHealthMonitorName;
private final String loadBalancerVmiName;
private final String loadBalancerIiName;
private final long ruleId;
private final List<TungstenLoadBalancerMember> listMember;
private final String protocol;
private final int srcPort;
private final int dstPort;
private final String privateIp;
private final String fipName;
private final String fiName;
private final String monitorType;
private final int maxRetries;
private final int delay;
private final int timeout;
private final String httpMethod;
private final String urlPath;
private final String expectedCodes;
public CreateTungstenNetworkLoadbalancerCommand(final String projectFqn, final String networkUuid,
final String publicNetworkUuid, final String loadBalancerMethod, final String loadBalancerName,
final String loadBalancerListenerName, final String loadBalancerPoolName,
final String loadBalancerHealthMonitorName, final String loadBalancerVmiName, final String loadBalancerIiName,
final long ruleId, final List<TungstenLoadBalancerMember> listMember, final String protocol, final int srcPort,
final int dstPort, final String privateIp, final String fipName, final String fiName, final String monitorType,
final int maxRetries, final int delay, final int timeout, final String httpMethod, final String urlPath,
final String expectedCodes) {
this.projectFqn = projectFqn;
this.networkUuid = networkUuid;
this.publicNetworkUuid = publicNetworkUuid;
this.loadBalancerMethod = loadBalancerMethod;
this.loadBalancerName = loadBalancerName;
this.loadBalancerListenerName = loadBalancerListenerName;
this.loadBalancerPoolName = loadBalancerPoolName;
this.loadBalancerHealthMonitorName = loadBalancerHealthMonitorName;
this.loadBalancerVmiName = loadBalancerVmiName;
this.loadBalancerIiName = loadBalancerIiName;
this.ruleId = ruleId;
this.listMember = listMember;
this.protocol = protocol;
this.srcPort = srcPort;
this.dstPort = dstPort;
this.privateIp = privateIp;
this.fipName = fipName;
this.fiName = fiName;
this.monitorType = monitorType;
this.maxRetries = maxRetries;
this.delay = delay;
this.timeout = timeout;
this.httpMethod = httpMethod;
this.urlPath = urlPath;
this.expectedCodes = expectedCodes;
}
public String getProjectFqn() {
return projectFqn;
}
public String getNetworkUuid() {
return networkUuid;
}
public String getPublicNetworkUuid() {
return publicNetworkUuid;
}
public String getLoadBalancerMethod() {
return loadBalancerMethod;
}
public String getLoadBalancerName() {
return loadBalancerName;
}
public String getLoadBalancerListenerName() {
return loadBalancerListenerName;
}
public String getLoadBalancerPoolName() {
return loadBalancerPoolName;
}
public String getLoadBalancerHealthMonitorName() {
return loadBalancerHealthMonitorName;
}
public String getLoadBalancerVmiName() {
return loadBalancerVmiName;
}
public String getLoadBalancerIiName() {
return loadBalancerIiName;
}
public long getRuleId() {
return ruleId;
}
public List<TungstenLoadBalancerMember> getListMember() {
return listMember;
}
public String getProtocol() {
return protocol;
}
public int getSrcPort() {
return srcPort;
}
public int getDstPort() {
return dstPort;
}
public String getPrivateIp() {
return privateIp;
}
public String getFipName() {
return fipName;
}
public String getFiName() {
return fiName;
}
public String getMonitorType() {
return monitorType;
}
public int getMaxRetries() {
return maxRetries;
}
public int getDelay() {
return delay;
}
public int getTimeout() {
return timeout;
}
public String getHttpMethod() {
return httpMethod;
}
public String getUrlPath() {
return urlPath;
}
public String getExpectedCodes() {
return expectedCodes;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenNetworkLoadbalancerCommand that = (CreateTungstenNetworkLoadbalancerCommand) o;
return ruleId == that.ruleId && srcPort == that.srcPort && dstPort == that.dstPort && maxRetries == that.maxRetries && delay == that.delay && timeout == that.timeout && Objects.equals(projectFqn, that.projectFqn) && Objects.equals(networkUuid, that.networkUuid) && Objects.equals(publicNetworkUuid, that.publicNetworkUuid) && Objects.equals(loadBalancerMethod, that.loadBalancerMethod) && Objects.equals(loadBalancerName, that.loadBalancerName) && Objects.equals(loadBalancerListenerName, that.loadBalancerListenerName) && Objects.equals(loadBalancerPoolName, that.loadBalancerPoolName)
&& Objects.equals(loadBalancerHealthMonitorName, that.loadBalancerHealthMonitorName) && Objects.equals(loadBalancerVmiName, that.loadBalancerVmiName) && Objects.equals(loadBalancerIiName, that.loadBalancerIiName) && Objects.equals(listMember, that.listMember) && Objects.equals(protocol, that.protocol) && Objects.equals(privateIp, that.privateIp) && Objects.equals(fipName, that.fipName) && Objects.equals(fiName, that.fiName) && Objects.equals(monitorType, that.monitorType) && Objects.equals(httpMethod, that.httpMethod) && Objects.equals(urlPath, that.urlPath) && Objects.equals(expectedCodes, that.expectedCodes);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, networkUuid, publicNetworkUuid, loadBalancerMethod, loadBalancerName, loadBalancerListenerName, loadBalancerPoolName, loadBalancerHealthMonitorName, loadBalancerVmiName, loadBalancerIiName, ruleId, listMember, protocol, srcPort, dstPort, privateIp, fipName, fiName, monitorType, maxRetries, delay, timeout, httpMethod, urlPath, expectedCodes);
}
}

View File

@ -0,0 +1,61 @@
// 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.agent.api;
import org.apache.cloudstack.network.tungsten.model.TungstenRule;
import java.util.List;
import java.util.Objects;
public class CreateTungstenNetworkPolicyCommand extends TungstenCommand {
private final String name;
private final String projectFqn;
private final List<TungstenRule> tungstenRuleList;
public CreateTungstenNetworkPolicyCommand(final String name, final String projectFqn,
final List<TungstenRule> tungstenRuleList) {
this.name = name;
this.projectFqn = projectFqn;
this.tungstenRuleList = tungstenRuleList;
}
public String getName() {
return name;
}
public String getProjectFqn() {
return projectFqn;
}
public List<TungstenRule> getTungstenRuleList() {
return tungstenRuleList;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenNetworkPolicyCommand that = (CreateTungstenNetworkPolicyCommand) o;
return Objects.equals(name, that.name) && Objects.equals(projectFqn, that.projectFqn) && Objects.equals(tungstenRuleList, that.tungstenRuleList);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), name, projectFqn, tungstenRuleList);
}
}

View File

@ -0,0 +1,58 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class CreateTungstenPolicyCommand extends TungstenCommand {
private final String uuid;
private final String name;
private final String projectFqn;
public CreateTungstenPolicyCommand(final String name, final String projectFqn) {
this.uuid = UUID.randomUUID().toString();
this.name = name;
this.projectFqn = projectFqn;
}
public String getUuid() {
return uuid;
}
public String getName() {
return name;
}
public String getProjectFqn() {
return projectFqn;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenPolicyCommand that = (CreateTungstenPolicyCommand) o;
return Objects.equals(uuid, that.uuid) && Objects.equals(name, that.name) && Objects.equals(projectFqn, that.projectFqn);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, name, projectFqn);
}
}

View File

@ -0,0 +1,64 @@
// 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.agent.api;
import java.util.Objects;
public class CreateTungstenProjectCommand extends TungstenCommand {
private final String tungstenProjectName;
private final String tungstenProjectUuid;
private final String tungstenDomainUuid;
private final String tungstenDomainName;
public CreateTungstenProjectCommand(String tungstenProjectName, String tungstenProjectUuid,
String tungstenDomainUuid, String tungstenDomainName) {
this.tungstenProjectName = tungstenProjectName;
this.tungstenProjectUuid = tungstenProjectUuid;
this.tungstenDomainUuid = tungstenDomainUuid;
this.tungstenDomainName = tungstenDomainName;
}
public String getTungstenProjectName() {
return tungstenProjectName;
}
public String getTungstenProjectUuid() {
return tungstenProjectUuid;
}
public String getTungstenDomainUuid() {
return tungstenDomainUuid;
}
public String getTungstenDomainName() {
return tungstenDomainName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenProjectCommand that = (CreateTungstenProjectCommand) o;
return Objects.equals(tungstenProjectName, that.tungstenProjectName) && Objects.equals(tungstenProjectUuid, that.tungstenProjectUuid) && Objects.equals(tungstenDomainUuid, that.tungstenDomainUuid) && Objects.equals(tungstenDomainName, that.tungstenDomainName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tungstenProjectName, tungstenProjectUuid, tungstenDomainUuid, tungstenDomainName);
}
}

View File

@ -0,0 +1,58 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class CreateTungstenRoutingLogicalRouterCommand extends TungstenCommand {
private final String projectFqn;
private final String uuid;
private final String name;
public CreateTungstenRoutingLogicalRouterCommand(final String projectFqn, final String name) {
this.uuid = UUID.randomUUID().toString();
this.projectFqn = projectFqn;
this.name = name;
}
public String getUuid() {
return uuid;
}
public String getProjectFqn() {
return projectFqn;
}
public String getName() {
return name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenRoutingLogicalRouterCommand that = (CreateTungstenRoutingLogicalRouterCommand) o;
return Objects.equals(projectFqn, that.projectFqn) && Objects.equals(uuid, that.uuid) && Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, uuid, name);
}
}

View File

@ -0,0 +1,64 @@
// 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.agent.api;
import java.util.Objects;
public class CreateTungstenSecurityGroupCommand extends TungstenCommand {
private final String securityGroupUuid;
private final String securityGroupName;
private final String securityGroupDescription;
private final String projectFqn;
public CreateTungstenSecurityGroupCommand(String securityGroupUuid, String securityGroupName,
String securityGroupDescription, String projectFqn) {
this.securityGroupUuid = securityGroupUuid;
this.securityGroupName = securityGroupName;
this.securityGroupDescription = securityGroupDescription;
this.projectFqn = projectFqn;
}
public String getSecurityGroupUuid() {
return securityGroupUuid;
}
public String getSecurityGroupName() {
return securityGroupName;
}
public String getSecurityGroupDescription() {
return securityGroupDescription;
}
public String getProjectFqn() {
return projectFqn;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenSecurityGroupCommand that = (CreateTungstenSecurityGroupCommand) o;
return Objects.equals(securityGroupUuid, that.securityGroupUuid) && Objects.equals(securityGroupName, that.securityGroupName) && Objects.equals(securityGroupDescription, that.securityGroupDescription) && Objects.equals(projectFqn, that.projectFqn);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), securityGroupUuid, securityGroupName, securityGroupDescription, projectFqn);
}
}

View File

@ -0,0 +1,71 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class CreateTungstenServiceGroupCommand extends TungstenCommand {
private final String uuid;
private final String name;
private final String protocol;
private final int startPort;
private final int endPort;
public CreateTungstenServiceGroupCommand(final String name, final String protocol, final int startPort,
final int endPort) {
this.uuid = UUID.randomUUID().toString();
this.name = name;
this.protocol = protocol;
this.startPort = startPort;
this.endPort = endPort;
}
public String getUuid() {
return uuid;
}
public String getName() {
return name;
}
public String getProtocol() {
return protocol;
}
public int getStartPort() {
return startPort;
}
public int getEndPort() {
return endPort;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenServiceGroupCommand that = (CreateTungstenServiceGroupCommand) o;
return startPort == that.startPort && endPort == that.endPort && Objects.equals(uuid, that.uuid) && Objects.equals(name, that.name) && Objects.equals(protocol, that.protocol);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, name, protocol, startPort, endPort);
}
}

View File

@ -0,0 +1,58 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class CreateTungstenTagCommand extends TungstenCommand {
private final String uuid;
private final String tagType;
private final String tagValue;
public CreateTungstenTagCommand(final String tagType, final String tagValue) {
this.uuid = UUID.randomUUID().toString();
this.tagType = tagType;
this.tagValue = tagValue;
}
public String getUuid() {
return uuid;
}
public String getTagType() {
return tagType;
}
public String getTagValue() {
return tagValue;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenTagCommand that = (CreateTungstenTagCommand) o;
return Objects.equals(uuid, that.uuid) && Objects.equals(tagType, that.tagType) && Objects.equals(tagValue, that.tagValue);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, tagType, tagValue);
}
}

View File

@ -0,0 +1,52 @@
// 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.agent.api;
import java.util.Objects;
import java.util.UUID;
public class CreateTungstenTagTypeCommand extends TungstenCommand {
private final String uuid;
private final String name;
public CreateTungstenTagTypeCommand(final String name) {
this.uuid = UUID.randomUUID().toString();
this.name = name;
}
public String getUuid() {
return uuid;
}
public String getName() {
return name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenTagTypeCommand that = (CreateTungstenTagTypeCommand) o;
return Objects.equals(uuid, that.uuid) && Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, name);
}
}

View File

@ -0,0 +1,125 @@
// 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.agent.api;
import java.util.Objects;
public class CreateTungstenVirtualMachineCommand extends TungstenCommand {
private final String projectFqn;
private final String vnUuid;
private final String vmUuid;
private final String vmName;
private final String nicUuid;
private final long nicId;
private final String ip;
private final String ipv6;
private final String mac;
private final String vmType;
private final String trafficType;
private final String host;
private final String gateway;
private final boolean isDefaultNic;
public CreateTungstenVirtualMachineCommand(final String projectFqn, final String vnUuid, final String vmUuid,
final String vmName, final String nicUuid, final long nicId, final String ip, final String ipv6, final String mac,
final String vmType, final String trafficType, final String host, final String gateway, final boolean isDefaultNic) {
this.projectFqn = projectFqn;
this.vnUuid = vnUuid;
this.vmUuid = vmUuid;
this.vmName = vmName;
this.nicUuid = nicUuid;
this.nicId = nicId;
this.ip = ip;
this.ipv6 = ipv6;
this.mac = mac;
this.vmType = vmType;
this.trafficType = trafficType;
this.host = host;
this.gateway = gateway;
this.isDefaultNic = isDefaultNic;
}
public String getProjectFqn() {
return projectFqn;
}
public String getVnUuid() {
return vnUuid;
}
public String getVmUuid() {
return vmUuid;
}
public String getVmName() {
return vmName;
}
public String getNicUuid() {
return nicUuid;
}
public long getNicId() {
return nicId;
}
public String getIp() {
return ip;
}
public String getIpv6() {
return ipv6;
}
public String getMac() {
return mac;
}
public String getVmType() {
return vmType;
}
public String getTrafficType() {
return trafficType;
}
public String getHost() {
return host;
}
public String getGateway() {
return gateway;
}
public boolean isDefaultNic() {
return isDefaultNic;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
CreateTungstenVirtualMachineCommand that = (CreateTungstenVirtualMachineCommand) o;
return nicId == that.nicId && isDefaultNic == that.isDefaultNic && Objects.equals(projectFqn, that.projectFqn) && Objects.equals(vnUuid, that.vnUuid) && Objects.equals(vmUuid, that.vmUuid) && Objects.equals(vmName, that.vmName) && Objects.equals(nicUuid, that.nicUuid) && Objects.equals(ip, that.ip) && Objects.equals(ipv6, that.ipv6) && Objects.equals(mac, that.mac) && Objects.equals(vmType, that.vmType) && Objects.equals(trafficType, that.trafficType) && Objects.equals(host, that.host) && Objects.equals(gateway, that.gateway);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, vnUuid, vmUuid, vmName, nicUuid, nicId, ip, ipv6, mac, vmType, trafficType, host, gateway, isDefaultNic);
}
}

View File

@ -0,0 +1,45 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenAddressGroupCommand extends TungstenCommand {
private final String addressGroupUuid;
public DeleteTungstenAddressGroupCommand(final String addressGroupUuid) {
this.addressGroupUuid = addressGroupUuid;
}
public String getAddressGroupUuid() {
return addressGroupUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenAddressGroupCommand that = (DeleteTungstenAddressGroupCommand) o;
return Objects.equals(addressGroupUuid, that.addressGroupUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), addressGroupUuid);
}
}

View File

@ -0,0 +1,45 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenApplicationPolicySetCommand extends TungstenCommand {
private final String applicationPolicySetUuid;
public DeleteTungstenApplicationPolicySetCommand(final String applicationPolicySetUuid) {
this.applicationPolicySetUuid = applicationPolicySetUuid;
}
public String getApplicationPolicySetUuid() {
return applicationPolicySetUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenApplicationPolicySetCommand that = (DeleteTungstenApplicationPolicySetCommand) o;
return Objects.equals(applicationPolicySetUuid, that.applicationPolicySetUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), applicationPolicySetUuid);
}
}

View File

@ -0,0 +1,45 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenDomainCommand extends TungstenCommand {
private final String tungstenDomainUuid;
public DeleteTungstenDomainCommand(String tungstenDomainUuid) {
this.tungstenDomainUuid = tungstenDomainUuid;
}
public String getTungstenDomainUuid() {
return tungstenDomainUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenDomainCommand that = (DeleteTungstenDomainCommand) o;
return Objects.equals(tungstenDomainUuid, that.tungstenDomainUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tungstenDomainUuid);
}
}

View File

@ -0,0 +1,45 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenFirewallPolicyCommand extends TungstenCommand {
private final String firewallPolicyUuid;
public DeleteTungstenFirewallPolicyCommand(final String firewallPolicyUuid) {
this.firewallPolicyUuid = firewallPolicyUuid;
}
public String getFirewallPolicyUuid() {
return firewallPolicyUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenFirewallPolicyCommand that = (DeleteTungstenFirewallPolicyCommand) o;
return Objects.equals(firewallPolicyUuid, that.firewallPolicyUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), firewallPolicyUuid);
}
}

View File

@ -0,0 +1,45 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenFirewallRuleCommand extends TungstenCommand {
private final String firewallRuleUuid;
public DeleteTungstenFirewallRuleCommand(final String firewallRuleUuid) {
this.firewallRuleUuid = firewallRuleUuid;
}
public String getFirewallRuleUuid() {
return firewallRuleUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenFirewallRuleCommand that = (DeleteTungstenFirewallRuleCommand) o;
return Objects.equals(firewallRuleUuid, that.firewallRuleUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), firewallRuleUuid);
}
}

View File

@ -0,0 +1,57 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenFloatingIpCommand extends TungstenCommand {
private final String vnUuid;
private final String fipName;
private final String name;
public DeleteTungstenFloatingIpCommand(String vnUuid, final String fipName, final String name) {
this.vnUuid = vnUuid;
this.fipName = fipName;
this.name = name;
}
public String getVnUuid() {
return vnUuid;
}
public String getFipName() {
return fipName;
}
public String getName() {
return name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenFloatingIpCommand that = (DeleteTungstenFloatingIpCommand) o;
return Objects.equals(vnUuid, that.vnUuid) && Objects.equals(fipName, that.fipName) && Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), vnUuid, fipName, name);
}
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenFloatingIpPoolCommand extends TungstenCommand {
private final String vnUuid;
private final String fipName;
public DeleteTungstenFloatingIpPoolCommand(final String vnUuid, final String fipName) {
this.vnUuid = vnUuid;
this.fipName = fipName;
}
public String getVnUuid() {
return vnUuid;
}
public String getFipName() {
return fipName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenFloatingIpPoolCommand that = (DeleteTungstenFloatingIpPoolCommand) o;
return Objects.equals(vnUuid, that.vnUuid) && Objects.equals(fipName, that.fipName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), vnUuid, fipName);
}
}

View File

@ -0,0 +1,83 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenLoadBalancerCommand extends TungstenCommand {
private final String projectFqn;
private final String publicNetworkUuid;
private final String loadBalancerName;
private final String loadBalancerHealthMonitorName;
private final String loadBalancerVmiName;
private final String fipName;
private final String fiName;
public DeleteTungstenLoadBalancerCommand(final String projectFqn, final String publicNetworkUuid,
final String loadBalancerName, final String loadBalancerHealthMonitorName, final String loadBalancerVmiName,
final String fipName, final String fiName) {
this.projectFqn = projectFqn;
this.publicNetworkUuid = publicNetworkUuid;
this.loadBalancerName = loadBalancerName;
this.loadBalancerHealthMonitorName = loadBalancerHealthMonitorName;
this.loadBalancerVmiName = loadBalancerVmiName;
this.fipName = fipName;
this.fiName = fiName;
}
public String getProjectFqn() {
return projectFqn;
}
public String getPublicNetworkUuid() {
return publicNetworkUuid;
}
public String getLoadBalancerName() {
return loadBalancerName;
}
public String getLoadBalancerHealthMonitorName() {
return loadBalancerHealthMonitorName;
}
public String getLoadBalancerVmiName() {
return loadBalancerVmiName;
}
public String getFipName() {
return fipName;
}
public String getFiName() {
return fiName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenLoadBalancerCommand that = (DeleteTungstenLoadBalancerCommand) o;
return Objects.equals(projectFqn, that.projectFqn) && Objects.equals(publicNetworkUuid, that.publicNetworkUuid) && Objects.equals(loadBalancerName, that.loadBalancerName) && Objects.equals(loadBalancerHealthMonitorName, that.loadBalancerHealthMonitorName) && Objects.equals(loadBalancerVmiName, that.loadBalancerVmiName) && Objects.equals(fipName, that.fipName) && Objects.equals(fiName, that.fiName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, publicNetworkUuid, loadBalancerName, loadBalancerHealthMonitorName, loadBalancerVmiName, fipName, fiName);
}
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenLoadBalancerListenerCommand extends TungstenCommand {
private final String projectFqn;
private final String loadBalancerListenerName;
public DeleteTungstenLoadBalancerListenerCommand(final String projectFqn, final String loadBalancerListenerName) {
this.projectFqn = projectFqn;
this.loadBalancerListenerName = loadBalancerListenerName;
}
public String getProjectFqn() {
return projectFqn;
}
public String getLoadBalancerListenerName() {
return loadBalancerListenerName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenLoadBalancerListenerCommand that = (DeleteTungstenLoadBalancerListenerCommand) o;
return Objects.equals(projectFqn, that.projectFqn) && Objects.equals(loadBalancerListenerName, that.loadBalancerListenerName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, loadBalancerListenerName);
}
}

View File

@ -0,0 +1,46 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenNetworkCommand extends TungstenCommand {
private final String networkUuid;
public DeleteTungstenNetworkCommand(String networkUuid) {
this.networkUuid = networkUuid;
}
public String getNetworkUuid() {
return networkUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenNetworkCommand that = (DeleteTungstenNetworkCommand) o;
return Objects.equals(networkUuid, that.networkUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), networkUuid);
}
}

View File

@ -0,0 +1,57 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenNetworkPolicyCommand extends TungstenCommand {
private final String name;
private final String projectFqn;
private final String networkUuid;
public DeleteTungstenNetworkPolicyCommand(final String name, final String projectFqn, final String networkUuid) {
this.name = name;
this.projectFqn = projectFqn;
this.networkUuid = networkUuid;
}
public String getName() {
return name;
}
public String getProjectFqn() {
return projectFqn;
}
public String getNetworkUuid() {
return networkUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenNetworkPolicyCommand that = (DeleteTungstenNetworkPolicyCommand) o;
return Objects.equals(name, that.name) && Objects.equals(projectFqn, that.projectFqn) && Objects.equals(networkUuid, that.networkUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), name, projectFqn, networkUuid);
}
}

View File

@ -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.
package org.apache.cloudstack.network.tungsten.agent.api;
import net.juniper.tungsten.api.ApiObjectBase;
import java.util.Objects;
public class DeleteTungstenObjectCommand extends TungstenCommand {
private final ApiObjectBase apiObjectBase;
public DeleteTungstenObjectCommand(final ApiObjectBase apiObjectBase) {
this.apiObjectBase = apiObjectBase;
}
public ApiObjectBase getApiObjectBase() {
return apiObjectBase;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenObjectCommand that = (DeleteTungstenObjectCommand) o;
return Objects.equals(apiObjectBase, that.apiObjectBase);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), apiObjectBase);
}
}

View File

@ -0,0 +1,46 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenPolicyCommand extends TungstenCommand {
private final String policyUuid;
public DeleteTungstenPolicyCommand(final String policyUuid) {
this.policyUuid = policyUuid;
}
public String getPolicyUuid() {
return policyUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenPolicyCommand that = (DeleteTungstenPolicyCommand) o;
return Objects.equals(policyUuid, that.policyUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), policyUuid);
}
}

View File

@ -0,0 +1,45 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenProjectCommand extends TungstenCommand {
private final String tungstenProjectUuid;
public DeleteTungstenProjectCommand(String tungstenProjectUuid) {
this.tungstenProjectUuid = tungstenProjectUuid;
}
public String getTungstenProjectUuid() {
return tungstenProjectUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenProjectCommand that = (DeleteTungstenProjectCommand) o;
return Objects.equals(tungstenProjectUuid, that.tungstenProjectUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tungstenProjectUuid);
}
}

View File

@ -0,0 +1,46 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenRoutingLogicalRouterCommand extends TungstenCommand {
private final String logicalRouterUuid;
public DeleteTungstenRoutingLogicalRouterCommand(String logicalRouterUuid) {
this.logicalRouterUuid = logicalRouterUuid;
}
public String getLogicalRouterUuid() {
return logicalRouterUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenRoutingLogicalRouterCommand that = (DeleteTungstenRoutingLogicalRouterCommand) o;
return Objects.equals(logicalRouterUuid, that.logicalRouterUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), logicalRouterUuid);
}
}

View File

@ -0,0 +1,45 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenSecurityGroupCommand extends TungstenCommand {
private final String tungstenSecurityGroupUuid;
public DeleteTungstenSecurityGroupCommand(String tungstenSecurityGroupUuid) {
this.tungstenSecurityGroupUuid = tungstenSecurityGroupUuid;
}
public String getTungstenSecurityGroupUuid() {
return tungstenSecurityGroupUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenSecurityGroupCommand that = (DeleteTungstenSecurityGroupCommand) o;
return Objects.equals(tungstenSecurityGroupUuid, that.tungstenSecurityGroupUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tungstenSecurityGroupUuid);
}
}

View File

@ -0,0 +1,45 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenServiceGroupCommand extends TungstenCommand {
private final String serviceGroupUuid;
public DeleteTungstenServiceGroupCommand(final String serviceGroupUuid) {
this.serviceGroupUuid = serviceGroupUuid;
}
public String getServiceGroupUuid() {
return serviceGroupUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenServiceGroupCommand that = (DeleteTungstenServiceGroupCommand) o;
return Objects.equals(serviceGroupUuid, that.serviceGroupUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), serviceGroupUuid);
}
}

View File

@ -0,0 +1,46 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenTagCommand extends TungstenCommand {
private final String tagUuid;
public DeleteTungstenTagCommand(String tagUuid) {
this.tagUuid = tagUuid;
}
public String getTagUuid() {
return tagUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenTagCommand that = (DeleteTungstenTagCommand) o;
return Objects.equals(tagUuid, that.tagUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tagUuid);
}
}

View File

@ -0,0 +1,46 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenTagTypeCommand extends TungstenCommand {
private final String tagTypeUuid;
public DeleteTungstenTagTypeCommand(String tagTypeUuid) {
this.tagTypeUuid = tagTypeUuid;
}
public String getTagTypeUuid() {
return tagTypeUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenTagTypeCommand that = (DeleteTungstenTagTypeCommand) o;
return Objects.equals(tagTypeUuid, that.tagTypeUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tagTypeUuid);
}
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenVRouterPortCommand extends TungstenCommand {
private final String host;
private final String portId;
public DeleteTungstenVRouterPortCommand(final String host, final String portId) {
this.host = host;
this.portId = portId;
}
public String getPortId() {
return portId;
}
public String getHost() {
return host;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenVRouterPortCommand that = (DeleteTungstenVRouterPortCommand) o;
return Objects.equals(host, that.host) && Objects.equals(portId, that.portId);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), host, portId);
}
}

View File

@ -0,0 +1,46 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenVmCommand extends TungstenCommand {
private final String virtualMachineUuid;
public DeleteTungstenVmCommand(String virtualMachineUuid) {
this.virtualMachineUuid = virtualMachineUuid;
}
public String getVirtualMachineUuid() {
return virtualMachineUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenVmCommand that = (DeleteTungstenVmCommand) o;
return Objects.equals(virtualMachineUuid, that.virtualMachineUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), virtualMachineUuid);
}
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class DeleteTungstenVmInterfaceCommand extends TungstenCommand {
private final String projectFqn;
private final String name;
public DeleteTungstenVmInterfaceCommand(final String projectFqn, String name) {
this.projectFqn = projectFqn;
this.name = name;
}
public String getName() {
return name;
}
public String getProjectFqn() {
return projectFqn;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
DeleteTungstenVmInterfaceCommand that = (DeleteTungstenVmInterfaceCommand) o;
return Objects.equals(projectFqn, that.projectFqn) && Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, name);
}
}

View File

@ -0,0 +1,21 @@
// 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.agent.api;
public class GetTungstenFabricNetworkCommand extends TungstenCommand {
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class GetTungstenFloatingIpsCommand extends TungstenCommand {
private final String vnUuid;
private final String fipName;
public GetTungstenFloatingIpsCommand(final String vnUuid, final String fipName) {
this.vnUuid = vnUuid;
this.fipName = fipName;
}
public String getVnUuid() {
return vnUuid;
}
public String getFipName() {
return fipName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
GetTungstenFloatingIpsCommand that = (GetTungstenFloatingIpsCommand) o;
return Objects.equals(vnUuid, that.vnUuid) && Objects.equals(fipName, that.fipName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), vnUuid, fipName);
}
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class GetTungstenLoadBalancerCommand extends TungstenCommand {
private final String projectFqn;
private final String lbName;
public GetTungstenLoadBalancerCommand(final String projectFqn, final String lbName) {
this.projectFqn = projectFqn;
this.lbName = lbName;
}
public String getProjectFqn() {
return projectFqn;
}
public String getLbName() {
return lbName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
GetTungstenLoadBalancerCommand that = (GetTungstenLoadBalancerCommand) o;
return Objects.equals(projectFqn, that.projectFqn) && Objects.equals(lbName, that.lbName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, lbName);
}
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class GetTungstenNatIpCommand extends TungstenCommand {
private final String projectFqn;
private final String logicalRouterUuid;
public GetTungstenNatIpCommand(final String projectFqn, final String logicalRouterUuid) {
this.projectFqn = projectFqn;
this.logicalRouterUuid = logicalRouterUuid;
}
public String getProjectFqn() {
return projectFqn;
}
public String getLogicalRouterUuid() {
return logicalRouterUuid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
GetTungstenNatIpCommand that = (GetTungstenNatIpCommand) o;
return Objects.equals(projectFqn, that.projectFqn) && Objects.equals(logicalRouterUuid, that.logicalRouterUuid);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, logicalRouterUuid);
}
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class GetTungstenNetworkDnsCommand extends TungstenCommand {
private final String uuid;
private final String subnetName;
public GetTungstenNetworkDnsCommand(final String uuid, final String subnetName) {
this.uuid = uuid;
this.subnetName = subnetName;
}
public String getUuid() {
return uuid;
}
public String getSubnetName() {
return subnetName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
GetTungstenNetworkDnsCommand that = (GetTungstenNetworkDnsCommand) o;
return Objects.equals(uuid, that.uuid) && Objects.equals(subnetName, that.subnetName);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), uuid, subnetName);
}
}

View File

@ -0,0 +1,51 @@
// 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.agent.api;
import java.util.Objects;
public class GetTungstenPolicyCommand extends TungstenCommand {
private final String projectFqn;
private final String name;
public GetTungstenPolicyCommand(final String projectFqn, final String name) {
this.projectFqn = projectFqn;
this.name = name;
}
public String getProjectFqn() {
return projectFqn;
}
public String getName() {
return name;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
GetTungstenPolicyCommand that = (GetTungstenPolicyCommand) o;
return Objects.equals(projectFqn, that.projectFqn) && Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), projectFqn, name);
}
}

Some files were not shown because too many files have changed in this diff Show More