incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject [3/50] [abbrv] updated regions branch with changes from master
Date Fri, 01 Feb 2013 19:38:12 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/api/src/com/cloud/api/ApiConstants.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/api/ApiConstants.java
index b5e6002,00ec392..16c33c5
--- a/api/src/com/cloud/api/ApiConstants.java
+++ b/api/src/com/cloud/api/ApiConstants.java
@@@ -357,11 -357,11 +357,14 @@@ 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_DETAILS = "regiondetails";
 +	public static final String REGION_ID = "regionid";
 +	public static final String IS_PROPAGATE = "ispropagate";
- 	
+     public static final String CAN_USE_FOR_DEPLOY = "canusefordeploy";
+     public static final String RESOURCE_IDS = "resourceids";
+     public static final String RESOURCE_ID = "resourceid";
+     public static final String CUSTOMER = "customer";
+     
      public enum HostDetails {
          all, capacity, events, stats, min;
      }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/api/src/com/cloud/api/BaseCmd.java
----------------------------------------------------------------------
diff --cc api/src/com/cloud/api/BaseCmd.java
index afebf2b,0924796..de9af9b
--- a/api/src/com/cloud/api/BaseCmd.java
+++ b/api/src/com/cloud/api/BaseCmd.java
@@@ -47,9 -47,9 +47,10 @@@ import com.cloud.network.security.Secur
  import com.cloud.network.vpn.RemoteAccessVpnService;
  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;
  import com.cloud.storage.StorageService;
  import com.cloud.storage.snapshot.SnapshotService;
  import com.cloud.template.TemplateService;
@@@ -129,8 -129,8 +130,9 @@@ public abstract class BaseCmd 
      public static ResourceLimitService _resourceLimitService;
      public static IdentityService _identityService;
      public static StorageNetworkService _storageNetworkService;
 +    public static RegionService _regionService;
-     
+     public static TaggedResourceService _taggedResourceService;
+ 
      static void setComponents(ResponseGenerator generator) {
          ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
          _mgr = (ManagementService) ComponentLocator.getComponent(ManagementService.Name);
@@@ -157,7 -157,7 +159,8 @@@
          _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);
      }
  
      public abstract void execute() throws ResourceUnavailableException, InsufficientCapacityException,
ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException;

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

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --cc client/tomcatconf/commands.properties.in
index 6ef0961,08c175b..cb96b1e
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@@ -331,10 -331,9 +331,15 @@@ updateStorageNetworkIpRange=com.cloud.a
  ### Network Devices commands
  addNetworkDevice=com.cloud.api.commands.AddNetworkDeviceCmd;1
  listNetworkDevice=com.cloud.api.commands.ListNetworkDeviceCmd;1
 -deleteNetworkDevice=com.cloud.api.commands.DeleteNetworkDeviceCmd;1
 -
 -#### Tags commands
 -createTags=com.cloud.api.commands.CreateTagsCmd;15
 -deleteTags=com.cloud.api.commands.DeleteTagsCmd;15
 -listTags=com.cloud.api.commands.ListTagsCmd;15
 +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
++listRegions=com.cloud.api.commands.ListRegionsCmd;7
++
++#### Tags commands
++createTags=com.cloud.api.commands.CreateTagsCmd;15
++deleteTags=com.cloud.api.commands.DeleteTagsCmd;15
++listTags=com.cloud.api.commands.ListTagsCmd;15

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/core/src/com/cloud/user/AccountVO.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/core/src/com/cloud/user/UserVO.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/api/ApiResponseHelper.java
index accdbab,8c8d53b..6ced205
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@@ -151,8 -155,8 +156,9 @@@ 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.storage.DiskOfferingVO;
  import com.cloud.storage.GuestOS;
  import com.cloud.storage.GuestOSCategoryVO;
@@@ -3400,15 -3406,40 +3408,48 @@@ 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) {
+         ResourceTagResponse response = new ResourceTagResponse();
+         response.setKey(resourceTag.getKey());
+         response.setValue(resourceTag.getValue());
+         response.setResourceType(resourceTag.getResourceType().toString());        
+         response.setId(ApiDBUtils.getUuid(String.valueOf(resourceTag.getResourceId()),resourceTag.getResourceType()));
+         Long accountId = resourceTag.getAccountId();
+         Long domainId = resourceTag.getDomainId();
+         if (accountId != null) {
+             Account account = ApiDBUtils.findAccountByIdIncludingRemoved(resourceTag.getAccountId());
+ 
+             if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
+                 // find the project
+                 Project project = ApiDBUtils.findProjectByProjectAccountId(account.getId());
+                 response.setProjectId(project.getId());
+                 response.setProjectName(project.getName());
+             } else {
+                 response.setAccountName(account.getAccountName());
+             }
+         }
+         
+         if (domainId != null) {
+             response.setDomainId(domainId);
+             response.setDomainName(ApiDBUtils.findDomainById(domainId).getName());
+         }
+         
+         response.setCustomer(resourceTag.getCustomer());
+         
+         response.setObjectName("tag");
+   
+         return response;
+     }
 -    
 -    
  }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/server/src/com/cloud/configuration/DefaultComponentLibrary.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/configuration/DefaultComponentLibrary.java
index a27ae17,f6db30b..61fdef3
--- a/server/src/com/cloud/configuration/DefaultComponentLibrary.java
+++ b/server/src/com/cloud/configuration/DefaultComponentLibrary.java
@@@ -331,7 -315,7 +317,8 @@@ public class DefaultComponentLibrary ex
          addDao("NetworkServiceMapDao", NetworkServiceMapDaoImpl.class);
          addDao("StorageNetworkIpAddressDao", StorageNetworkIpAddressDaoImpl.class);
          addDao("StorageNetworkIpRangeDao", StorageNetworkIpRangeDaoImpl.class);
 +        addDao("RegionDao", RegionDaoImpl.class);
+         addDao("TagsDao", ResourceTagsDaoImpl.class);
      }
  
      @Override
@@@ -388,7 -370,7 +373,8 @@@
          addManager("StorageNetworkManager", StorageNetworkManagerImpl.class);
          addManager("ExternalLoadBalancerUsageManager", ExternalLoadBalancerUsageManagerImpl.class);
          addManager("HA Manager", HighAvailabilityManagerImpl.class);
 +        addManager("Region Manager", RegionManagerImpl.class);
+         addManager("TaggedResourcesManager", TaggedResourceManagerImpl.class);
      }
  
      @Override

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/server/src/com/cloud/domain/DomainVO.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/server/src/com/cloud/domain/dao/DomainDaoImpl.java
----------------------------------------------------------------------

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

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/server/src/com/cloud/user/AccountManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/server/src/com/cloud/user/DomainManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/server/src/com/cloud/user/DomainManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/server/src/com/cloud/user/dao/AccountDaoImpl.java
----------------------------------------------------------------------

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

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4fcf64dd/setup/db/create-schema.sql
----------------------------------------------------------------------
diff --cc setup/db/create-schema.sql
index ff092eb,afcee3f..f5f7387
--- a/setup/db/create-schema.sql
+++ b/setup/db/create-schema.sql
@@@ -2137,14 -2133,21 +2137,30 @@@ 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`.`resource_tags` (
+   `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
+   `uuid` varchar(40),
+   `key` varchar(255),
+   `value` varchar(255),
+   `resource_id` bigint unsigned NOT NULL,
+   `resource_type` varchar(255),
+   `customer` varchar(255),
+   `domain_id` bigint unsigned NOT NULL COMMENT 'foreign key to domain id',
+   `account_id` bigint unsigned NOT NULL COMMENT 'owner of this network',
+   PRIMARY KEY (`id`),
+   CONSTRAINT `fk_tags__account_id` FOREIGN KEY(`account_id`) REFERENCES `account`(`id`),
+   CONSTRAINT `fk_tags__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `domain`(`id`),
+   UNIQUE `i_tags__resource_id__resource_type__key`(`resource_id`, `resource_type`, `key`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ 
  
  SET foreign_key_checks = 1;


Mime
View raw message