incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [9/40] Merge branch 'master' into regions
Date Fri, 01 Feb 2013 06:32:04 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/api/src/com/cloud/api/ApiConstants.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/api/ApiConstants.java
index 16c33c5,067ddf7..e311fcc
--- a/api/src/com/cloud/api/ApiConstants.java
+++ b/api/src/com/cloud/api/ApiConstants.java
@@@ -357,9 -360,10 +360,13 @@@ public class ApiConstants 
      public static final String VSM_CONFIG_STATE = "vsmconfigstate";
      public static final String VSM_DEVICE_STATE = "vsmdevicestate";
      public static final String ADD_VSM_FLAG = "addvsmflag";
 +	public static final String END_POINT = "endpoint";
 +	public static final String REGION_ID = "regionid";
 +	public static final String IS_PROPAGATE = "ispropagate";
+     public static final String VPC_OFF_ID = "vpcofferingid";
+     public static final String NETWORK = "network";
+     public static final String VPC_ID = "vpcid";
+     public static final String GATEWAY_ID = "gatewayid";
      public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy";
      public static final String RESOURCE_IDS = "resourceids";
      public static final String RESOURCE_ID = "resourceid";

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/api/src/com/cloud/api/BaseCmd.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/api/BaseCmd.java
index de9af9b,91c2035..0fb0e7b
--- a/api/src/com/cloud/api/BaseCmd.java
+++ b/api/src/com/cloud/api/BaseCmd.java
@@@ -44,10 -47,11 +47,12 @@@ import com.cloud.network.firewall.Netwo
  import com.cloud.network.lb.LoadBalancingRulesService;
  import com.cloud.network.rules.RulesService;
  import com.cloud.network.security.SecurityGroupService;
+ import com.cloud.network.vpc.VpcService;
  import com.cloud.network.vpn.RemoteAccessVpnService;
+ import com.cloud.network.vpn.Site2SiteVpnService;
  import com.cloud.projects.Project;
  import com.cloud.projects.ProjectService;
 +import com.cloud.region.RegionService;
  import com.cloud.resource.ResourceService;
  import com.cloud.server.ManagementService;
  import com.cloud.server.TaggedResourceService;
@@@ -130,8 -134,10 +135,11 @@@ public abstract class BaseCmd 
      public static ResourceLimitService _resourceLimitService;
      public static IdentityService _identityService;
      public static StorageNetworkService _storageNetworkService;
 +    public static RegionService _regionService;
      public static TaggedResourceService _taggedResourceService;
+     public static VpcService _vpcService;
+     public static NetworkACLService _networkACLService;
+     public static Site2SiteVpnService _s2sVpnService;
  
      static void setComponents(ResponseGenerator generator) {
          ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
@@@ -159,8 -165,10 +167,11 @@@
          _resourceLimitService = locator.getManager(ResourceLimitService.class);
          _identityService = locator.getManager(IdentityService.class);
          _storageNetworkService = locator.getManager(StorageNetworkService.class);
 +        _regionService = locator.getManager(RegionService.class);
          _taggedResourceService = locator.getManager(TaggedResourceService.class);
+         _vpcService = locator.getManager(VpcService.class);
+         _networkACLService = locator.getManager(NetworkACLService.class);
+         _s2sVpnService = locator.getManager(Site2SiteVpnService.class);
      }
  
      public abstract void execute() throws ResourceUnavailableException, InsufficientCapacityException,
ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/api/src/com/cloud/api/ResponseGenerator.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/api/src/com/cloud/user/AccountService.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --cc client/tomcatconf/commands.properties.in
index cb96b1e,e233694..5ee333c
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@@ -333,13 -351,53 +351,62 @@@ addNetworkDevice=com.cloud.api.commands
  listNetworkDevice=com.cloud.api.commands.ListNetworkDeviceCmd;1
  deleteNetworkDevice=com.cloud.api.commands.DeleteNetworkDeviceCmd;1
  
 +#### Region commands
 +addRegion=com.cloud.api.commands.AddRegionCmd;1
 +updateRegion=com.cloud.api.commands.UpdateRegionCmd;1
 +removeRegion=com.cloud.api.commands.RemoveRegionCmd;1
 +listRegions=com.cloud.api.commands.ListRegionsCmd;7
 +
+ ### Network Devices commands
+ addNetworkDevice=com.cloud.api.commands.AddNetworkDeviceCmd;1
+ listNetworkDevice=com.cloud.api.commands.ListNetworkDeviceCmd;1
+ deleteNetworkDevice=com.cloud.api.commands.DeleteNetworkDeviceCmd;1
+ 
+ ### VPC commands
+ createVPC=com.cloud.api.commands.CreateVPCCmd;15
+ listVPCs=com.cloud.api.commands.ListVPCsCmd;15
+ deleteVPC=com.cloud.api.commands.DeleteVPCCmd;15
+ updateVPC=com.cloud.api.commands.UpdateVPCCmd;15
+ restartVPC=com.cloud.api.commands.RestartVPCCmd;15
+ 
+ #### VPC offering commands
+ createVPCOffering=com.cloud.api.commands.CreateVPCOfferingCmd;1
+ updateVPCOffering=com.cloud.api.commands.UpdateVPCOfferingCmd;1
+ deleteVPCOffering=com.cloud.api.commands.DeleteVPCOfferingCmd;1
+ listVPCOfferings=com.cloud.api.commands.ListVPCOfferingsCmd;15
+ 
+ #### Private gateway commands
+ createPrivateGateway=com.cloud.api.commands.CreatePrivateGatewayCmd;1
+ listPrivateGateways=com.cloud.api.commands.ListPrivateGatewaysCmd;15
+ deletePrivateGateway=com.cloud.api.commands.DeletePrivateGatewayCmd;1
+ 
+ #### Network ACL commands
+ createNetworkACL=com.cloud.api.commands.CreateNetworkACLCmd;15
+ deleteNetworkACL=com.cloud.api.commands.DeleteNetworkACLCmd;15
+ listNetworkACLs=com.cloud.api.commands.ListNetworkACLsCmd;15
+ 
+ #### Static route commands
+ createStaticRoute=com.cloud.api.commands.CreateStaticRouteCmd;15
+ deleteStaticRoute=com.cloud.api.commands.DeleteStaticRouteCmd;15
+ listStaticRoutes=com.cloud.api.commands.ListStaticRoutesCmd;15
+ 
  #### Tags commands
  createTags=com.cloud.api.commands.CreateTagsCmd;15
  deleteTags=com.cloud.api.commands.DeleteTagsCmd;15
  listTags=com.cloud.api.commands.ListTagsCmd;15
++<<<<<<< HEAD
++=======
+ 
+ ### Site-to-site VPN commands
+ createVpnCustomerGateway=com.cloud.api.commands.CreateVpnCustomerGatewayCmd;15
+ createVpnGateway=com.cloud.api.commands.CreateVpnGatewayCmd;15
+ createVpnConnection=com.cloud.api.commands.CreateVpnConnectionCmd;15
+ deleteVpnCustomerGateway=com.cloud.api.commands.DeleteVpnCustomerGatewayCmd;15
+ deleteVpnGateway=com.cloud.api.commands.DeleteVpnGatewayCmd;15
+ deleteVpnConnection=com.cloud.api.commands.DeleteVpnConnectionCmd;15
+ updateVpnCustomerGateway=com.cloud.api.commands.UpdateVpnCustomerGatewayCmd;15
+ resetVpnConnection=com.cloud.api.commands.ResetVpnConnectionCmd;15
+ listVpnCustomerGateways=com.cloud.api.commands.ListVpnCustomerGatewaysCmd;15
+ listVpnGateways=com.cloud.api.commands.ListVpnGatewaysCmd;15
+ listVpnConnections=com.cloud.api.commands.ListVpnConnectionsCmd;15
++>>>>>>> master

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/core/src/com/cloud/user/UserVO.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/user/UserVO.java
index 99a89b5,f5fd5da..f227f31
--- a/core/src/com/cloud/user/UserVO.java
+++ b/core/src/com/cloud/user/UserVO.java
@@@ -93,19 -92,16 +92,19 @@@ public class UserVO implements User, Id
      @Column(name="uuid")
      private String uuid;
  
 +    @Column(name="region_id")
 +    private long regionId;
 +    
      public UserVO() {
-     	this.uuid = UUID.randomUUID().toString();
+         this.uuid = UUID.randomUUID().toString();
      }
-     
+ 
      public UserVO(long id) {
          this.id = id;
-     	this.uuid = UUID.randomUUID().toString();
+         this.uuid = UUID.randomUUID().toString();
      }
 -
 -    public UserVO(long accountId, String username, String password, String firstName, String
lastName, String email, String timezone) {
 +    
 +    public UserVO(long accountId, String username, String password, String firstName, String
lastName, String email, String timezone, String uuid, long regionId) {
          this.accountId = accountId;
          this.username = username;
          this.password = password;
@@@ -256,21 -251,13 +255,21 @@@
      public String toString() {
          return new StringBuilder("User[").append(id).append("-").append(username).append("]").toString();
      }
-     
+ 
      @Override
      public String getUuid() {
-     	return this.uuid;
+         return this.uuid;
      }
-     
+ 
      public void setUuid(String uuid) {
-     	this.uuid = uuid;
+         this.uuid = uuid;
      }
 +    
 +	public long getRegionId() {
 +		return regionId;
 +	}
 +
 +	public void setRegionId(long regionId) {
 +		this.regionId = regionId;
 +	}
  }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/api/ApiResponseHelper.java
index 6ced205,b20aede..f66480e
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@@ -156,9 -172,9 +173,10 @@@ import com.cloud.org.Cluster
  import com.cloud.projects.Project;
  import com.cloud.projects.ProjectAccount;
  import com.cloud.projects.ProjectInvitation;
 +import com.cloud.region.Region;
  import com.cloud.server.Criteria;
  import com.cloud.server.ResourceTag;
+ import com.cloud.server.ResourceTag.TaggedResourceType;
  import com.cloud.storage.DiskOfferingVO;
  import com.cloud.storage.GuestOS;
  import com.cloud.storage.GuestOSCategoryVO;
@@@ -3408,19 -3653,9 +3655,19 @@@ public class ApiResponseHelper implemen
      public Long getIdentiyId(String tableName, String token) {
          return ApiDispatcher.getIdentiyId(tableName, token);
      }
 -    
 +
 +	@Override
 +	public RegionResponse createRegionResponse(Region region) {
 +		RegionResponse response = new RegionResponse();
 +		response.setId(region.getId());
 +		response.setName(region.getName());
 +		response.setEndPoint(region.getEndPoint());
 +		response.setObjectName("region");
 +		return response;
 +	}
 +
      @Override
-     public ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag) {
+     public ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag, boolean
keyValueOnly) {
          ResourceTagResponse response = new ResourceTagResponse();
          response.setKey(resourceTag.getKey());
          response.setValue(resourceTag.getValue());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/server/src/com/cloud/configuration/DefaultComponentLibrary.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/configuration/DefaultComponentLibrary.java
index 61fdef3,4edd402..2e39c13
--- a/server/src/com/cloud/configuration/DefaultComponentLibrary.java
+++ b/server/src/com/cloud/configuration/DefaultComponentLibrary.java
@@@ -317,8 -327,16 +329,17 @@@ public class DefaultComponentLibrary ex
          addDao("NetworkServiceMapDao", NetworkServiceMapDaoImpl.class);
          addDao("StorageNetworkIpAddressDao", StorageNetworkIpAddressDaoImpl.class);
          addDao("StorageNetworkIpRangeDao", StorageNetworkIpRangeDaoImpl.class);
 +        addDao("RegionDao", RegionDaoImpl.class);
+         addDao("VpcDao", VpcDaoImpl.class);
+         addDao("VpcOfferingDao", VpcOfferingDaoImpl.class);
+         addDao("VpcOfferingServiceMapDao", VpcOfferingServiceMapDaoImpl.class);
+         addDao("PrivateIpDao", PrivateIpDaoImpl.class);
+         addDao("VpcGatewayDao", VpcGatewayDaoImpl.class);
+         addDao("StaticRouteDao", StaticRouteDaoImpl.class);
          addDao("TagsDao", ResourceTagsDaoImpl.class);
+         addDao("Site2SiteVpnGatewayDao", Site2SiteVpnGatewayDaoImpl.class);
+         addDao("Site2SiteCustomerGatewayDao", Site2SiteCustomerGatewayDaoImpl.class);
+         addDao("Site2SiteVpnConnnectionDao", Site2SiteVpnConnectionDaoImpl.class);
      }
  
      @Override
@@@ -373,8 -390,11 +393,12 @@@
          addManager("StorageNetworkManager", StorageNetworkManagerImpl.class);
          addManager("ExternalLoadBalancerUsageManager", ExternalLoadBalancerUsageManagerImpl.class);
          addManager("HA Manager", HighAvailabilityManagerImpl.class);
 +        addManager("Region Manager", RegionManagerImpl.class);
+         addManager("VPC Manager", VpcManagerImpl.class);
+         addManager("VpcVirtualRouterManager", VpcVirtualNetworkApplianceManagerImpl.class);
+         addManager("NetworkACLManager", NetworkACLManagerImpl.class);
          addManager("TaggedResourcesManager", TaggedResourceManagerImpl.class);
+         addManager("Site2SiteVpnManager", Site2SiteVpnManagerImpl.class);
      }
  
      @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/server/src/com/cloud/projects/ProjectManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/user/AccountManagerImpl.java
index 0d085f5,a79251b..b58c417
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@@ -206,8 -214,12 +216,14 @@@ public class AccountManagerImpl impleme
      @Inject
      private IPAddressDao _ipAddressDao;
      @Inject
 +    private RegionManager _regionMgr;
 +    
+     private VpcManager _vpcMgr;
+     @Inject
+     private DomainRouterDao _routerDao;
+     @Inject
+     Site2SiteVpnManager _vpnMgr;
+ 
      private Adapters<UserAuthenticator> _userAuthenticators;
  
      private final ScheduledExecutorService _executor = Executors.newScheduledThreadPool(1,
new NamedThreadFactory("AccountChecker"));

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/server/src/com/cloud/user/dao/UserDaoImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/89779cce/setup/db/create-schema.sql
----------------------------------------------------------------------
diff --cc setup/db/create-schema.sql
index f5f7387,5b6dc04..bdaecb0
--- a/setup/db/create-schema.sql
+++ b/setup/db/create-schema.sql
@@@ -137,7 -141,11 +141,12 @@@ DROP TABLE IF EXISTS `cloud`.`op_dc_sto
  DROP TABLE IF EXISTS `cloud`.`cluster_vsm_map`;
  DROP TABLE IF EXISTS `cloud`.`virtual_supervisor_module`;
  DROP TABLE IF EXISTS `cloud`.`port_profile`;
 +DROP TABLE IF EXISTS `cloud`.`region`;
+ DROP TABLE IF EXISTS `cloud`.`s2s_customer_gateway`;
+ DROP TABLE IF EXISTS `cloud`.`s2s_vpn_gateway`;
+ DROP TABLE IF EXISTS `cloud`.`s2s_vpn_connection`;
+ DROP TABLE IF EXISTS `cloud`,`external_nicira_nvp_devices`;
+ DROP TABLE IF EXISTS `cloud`,`nicira_nvp_nic_map`;
  
  CREATE TABLE `cloud`.`version` (
    `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
@@@ -875,7 -890,7 +891,8 @@@ CREATE TABLE  `cloud`.`user` 
    `timezone` varchar(30) default NULL,
    `registration_token` varchar(255) default NULL,
    `is_registered` tinyint NOT NULL DEFAULT 0 COMMENT '1: yes, 0: no',
 +  `region_id` bigint unsigned,
+   `incorrect_login_attempts` integer unsigned NOT NULL DEFAULT 0,
    PRIMARY KEY  (`id`),
    INDEX `i_user__removed`(`removed`),
    INDEX `i_user__secret_key_removed`(`secret_key`, `removed`),
@@@ -2137,15 -2209,128 +2213,137 @@@ CREATE TABLE  `cloud`.`netscaler_pod_re
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  
 +CREATE TABLE  `cloud`.`region` (
 +  `id` bigint unsigned NOT NULL UNIQUE,
 +  `name` varchar(255),
 +  `end_point` varchar(255),
 +  `status` varchar(32) NOT NULL,
 +  `removed` datetime COMMENT 'date removed if not null',
 +  PRIMARY KEY  (`id`)
 +) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 +
+ CREATE TABLE `cloud`.`vpc` (
+   `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
+   `uuid` varchar(40) NOT NULL,
+   `name` varchar(255) COMMENT 'vpc name',
+   `display_text` varchar(255) COMMENT 'vpc display text',
+   `cidr` varchar(18) COMMENT 'vpc cidr',
+   `vpc_offering_id` bigint unsigned NOT NULL COMMENT 'vpc offering id that this vpc is created
from',
+   `zone_id` bigint unsigned NOT NULL COMMENT 'the id of the zone this Vpc belongs to',
+   `state` varchar(32) NOT NULL COMMENT 'state of the VP (can be Enabled and Disabled)',
+   `domain_id` bigint unsigned NOT NULL COMMENT 'domain the vpc belongs to',
+   `account_id` bigint unsigned NOT NULL COMMENT 'owner of this vpc',
+   `network_domain` varchar(255) COMMENT 'network domain',
+   `removed` datetime COMMENT 'date removed if not null',
+   `created` datetime NOT NULL COMMENT 'date created',
+   `restart_required` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if restart is required
for the VPC',
+   PRIMARY KEY  (`id`),
+   INDEX `i_vpc__removed`(`removed`),
+   CONSTRAINT `fk_vpc__zone_id` FOREIGN KEY `fk_vpc__zone_id` (`zone_id`) REFERENCES `data_center`
(`id`) ON DELETE CASCADE,
+   CONSTRAINT `fk_vpc__vpc_offering_id` FOREIGN KEY (`vpc_offering_id`) REFERENCES `vpc_offerings`(`id`),

+   CONSTRAINT `fk_vpc__account_id` FOREIGN KEY `fk_vpc__account_id` (`account_id`) REFERENCES
`account`(`id`) ON DELETE CASCADE,
+   CONSTRAINT `fk_vpc__domain_id` FOREIGN KEY `fk_vpc__domain_id` (`domain_id`) REFERENCES
`domain`(`id`) ON DELETE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ 
+ 
+ CREATE TABLE `cloud`.`vpc_offerings` (
+   `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
+   `uuid` varchar(40) NOT NULL,
+   `unique_name` varchar(64) UNIQUE COMMENT 'unique name of the vpc offering',
+   `name` varchar(255) COMMENT 'vpc name',
+   `display_text` varchar(255) COMMENT 'display text',
+   `state` char(32) COMMENT 'state of the vpc offering that has Disabled value by default',
+   `default` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if vpc offering is default',
+   `removed` datetime COMMENT 'date removed if not null',
+   `created` datetime NOT NULL COMMENT 'date created',
+   `service_offering_id` bigint unsigned COMMENT 'service offering id that virtual router
is tied to',
+   PRIMARY KEY  (`id`),
+   INDEX `i_vpc__removed`(`removed`),
+   CONSTRAINT `fk_vpc_offerings__service_offering_id` FOREIGN KEY `fk_vpc_offerings__service_offering_id`
(`service_offering_id`) REFERENCES `service_offering`(`id`) ON DELETE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ 
+ CREATE TABLE  `cloud`.`vpc_offering_service_map` (
+   `id` bigint unsigned NOT NULL auto_increment,
+   `vpc_offering_id` bigint unsigned NOT NULL COMMENT 'vpc_offering_id',
+   `service` varchar(255) NOT NULL COMMENT 'service',
+   `provider` varchar(255) COMMENT 'service provider',
+   `created` datetime COMMENT 'date created',
+   PRIMARY KEY (`id`),
+   CONSTRAINT `fk_vpc_offering_service_map__vpc_offering_id` FOREIGN KEY(`vpc_offering_id`)
REFERENCES `vpc_offerings`(`id`) ON DELETE CASCADE,
+   UNIQUE (`vpc_offering_id`, `service`, `provider`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ 
+ 
+ CREATE TABLE `cloud`.`router_network_ref` (
+   `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+   `router_id` bigint unsigned NOT NULL COMMENT 'router id',
+   `network_id` bigint unsigned NOT NULL COMMENT 'network id',
+   `guest_type` char(32) COMMENT 'type of guest network that can be shared or isolated',
+   PRIMARY KEY (`id`),
+   CONSTRAINT `fk_router_network_ref__router_id` FOREIGN KEY (`router_id`) REFERENCES `domain_router`(`id`)
ON DELETE CASCADE,
+   CONSTRAINT `fk_router_network_ref__networks_id` FOREIGN KEY (`network_id`) REFERENCES
`networks`(`id`) ON DELETE CASCADE,
+   UNIQUE `i_router_network_ref__router_id__network_id`(`router_id`, `network_id`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ 
+ 
+ CREATE TABLE `cloud`.`vpc_gateways` (
+   `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
+   `uuid` varchar(40),
+   `ip4_address` char(40) COMMENT 'ip4 address of the gateway',
+   `netmask` varchar(15) COMMENT 'netmask of the gateway',
+   `gateway` varchar(15) COMMENT 'gateway',
+   `vlan_tag` varchar(255),
+   `type` varchar(32) COMMENT 'type of gateway; can be Public/Private/Vpn',
+   `network_id` bigint unsigned NOT NULL COMMENT 'network id vpc gateway belongs to',
+   `vpc_id` bigint unsigned NOT NULL COMMENT 'id of the vpc the gateway belongs to',
+   `zone_id` bigint unsigned NOT NULL COMMENT 'id of the zone the gateway belongs to',
+   `created` datetime COMMENT 'date created',
+   `account_id` bigint unsigned NOT NULL COMMENT 'owner id',
+   `domain_id` bigint unsigned NOT NULL COMMENT 'domain id',
+   `state` varchar(32) NOT NULL COMMENT 'what state the vpc gateway in',
+   `removed` datetime COMMENT 'date removed if not null',
+   PRIMARY KEY (`id`),
+   CONSTRAINT `fk_vpc_gateways__network_id` FOREIGN KEY `fk_vpc_gateways__network_id`(`network_id`)
REFERENCES `networks`(`id`),
+   CONSTRAINT `fk_vpc_gateways__vpc_id` FOREIGN KEY `fk_vpc_gateways__vpc_id`(`vpc_id`) REFERENCES
`vpc`(`id`),
+   CONSTRAINT `fk_vpc_gateways__zone_id` FOREIGN KEY `fk_vpc_gateways__zone_id`(`zone_id`)
REFERENCES `data_center`(`id`),
+   CONSTRAINT `fk_vpc_gateways__account_id` FOREIGN KEY(`account_id`) REFERENCES `account`(`id`)
ON DELETE CASCADE,
+   CONSTRAINT `fk_vpc_gateways__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `domain`(`id`)
ON DELETE CASCADE,
+   CONSTRAINT `uc_vpc_gateways__uuid` UNIQUE (`uuid`),
+   INDEX `i_vpc_gateways__removed`(`removed`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ 
+ CREATE TABLE `cloud`.`private_ip_address` (
+   `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'primary key',
+   `ip_address` char(40) NOT NULL COMMENT 'ip address',
+   `network_id` bigint unsigned NOT NULL COMMENT 'id of the network ip belongs to',
+   `reservation_id` char(40) COMMENT 'reservation id',
+   `mac_address` varchar(17) COMMENT 'mac address',
+   `vpc_id` bigint unsigned COMMENT 'vpc this ip belongs to',
+   `taken` datetime COMMENT 'Date taken',
+   PRIMARY KEY (`id`),
+   CONSTRAINT `fk_private_ip_address__vpc_id` FOREIGN KEY `fk_private_ip_address__vpc_id`(`vpc_id`)
REFERENCES `vpc`(`id`),
+   CONSTRAINT `fk_private_ip_address__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`
(`id`) ON DELETE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ 
+ 
+ CREATE TABLE `cloud`.`static_routes` (
+   `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
+   `uuid` varchar(40),
+   `vpc_gateway_id` bigint unsigned COMMENT 'id of the corresponding ip address',
+   `cidr` varchar(18) COMMENT 'cidr for the static route', 
+   `state` char(32) NOT NULL COMMENT 'current state of this rule',
+   `vpc_id` bigint unsigned COMMENT 'vpc the firewall rule is associated with',
+   `account_id` bigint unsigned NOT NULL COMMENT 'owner id',
+   `domain_id` bigint unsigned NOT NULL COMMENT 'domain id',
+   `created` datetime COMMENT 'Date created',
+   PRIMARY KEY  (`id`),
+   CONSTRAINT `fk_static_routes__vpc_gateway_id` FOREIGN KEY(`vpc_gateway_id`) REFERENCES
`vpc_gateways`(`id`) ON DELETE CASCADE,
+   CONSTRAINT `fk_static_routes__vpc_id` FOREIGN KEY (`vpc_id`) REFERENCES `vpc`(`id`) ON
DELETE CASCADE,
+   CONSTRAINT `fk_static_routes__account_id` FOREIGN KEY(`account_id`) REFERENCES `account`(`id`)
ON DELETE CASCADE,
+   CONSTRAINT `fk_static_routes__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `domain`(`id`)
ON DELETE CASCADE,
+   CONSTRAINT `uc_static_routes__uuid` UNIQUE (`uuid`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ 
  CREATE TABLE `cloud`.`resource_tags` (
    `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
    `uuid` varchar(40),


Mime
View raw message