cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From likit...@apache.org
Subject [53/71] [abbrv] git commit: updated refs/heads/master to 26af71b
Date Thu, 04 Jul 2013 06:29:02 GMT
CLOUDSTACK-1444. Updated EC2SoapService and EC2SoapServiceImpl to be compatible with the java stubs generated from EC2 WSDL 2012-08-15.
  - by adding stubs for the new EC2 APIs (unsupported by CS AWSAPI)
  - by setting the new EC2 API response elements
  - by adding support for the new EC2 API request elements
[Support for EC2 API version 2012-08-15]


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/135b688a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/135b688a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/135b688a

Branch: refs/heads/master
Commit: 135b688a00bdf69b0a02345385ba7dd7d99188c3
Parents: 2570b66
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Thu Jul 4 10:06:51 2013 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Thu Jul 4 10:06:51 2013 +0530

----------------------------------------------------------------------
 .../cloud/bridge/service/EC2RestServlet.java    |   8 +-
 .../cloud/bridge/service/EC2SoapService.java    | 344 +++++++++++++++++-
 .../bridge/service/EC2SoapServiceImpl.java      | 362 ++++++++++++++++++-
 .../bridge/service/core/ec2/EC2Engine.java      | 239 ++++++------
 .../service/core/ec2/EC2RunInstances.java       |  24 +-
 5 files changed, 839 insertions(+), 138 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/135b688a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
index faa293b..e75713f 100644
--- a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
+++ b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
@@ -1255,8 +1255,12 @@ public class EC2RestServlet extends HttpServlet {
             String key = (String)names.nextElement();
             if ( key.startsWith("SecurityGroup")) {
                 String[] value = request.getParameterValues(key);
-                if (null != value && 0 < value.length)
-                    EC2request.addGroupName( value[0]);
+                if (null != value && 0 < value.length) {
+                    if ( key.startsWith("SecurityGroupId"))
+                        EC2request.addSecuritGroupId( value[0]);
+                    else
+                        EC2request.addSecuritGroupName( value[0]);
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/135b688a/awsapi/src/com/cloud/bridge/service/EC2SoapService.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/service/EC2SoapService.java b/awsapi/src/com/cloud/bridge/service/EC2SoapService.java
index 1f7f612..0202c33 100644
--- a/awsapi/src/com/cloud/bridge/service/EC2SoapService.java
+++ b/awsapi/src/com/cloud/bridge/service/EC2SoapService.java
@@ -568,4 +568,346 @@ public class EC2SoapService implements AmazonEC2SkeletonInterface {
 			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
 			return ec2Service.importVolume(importVolume);
 		}
-}
+		
+
+		@Override
+		public ResetNetworkInterfaceAttributeResponse resetNetworkInterfaceAttribute(
+				ResetNetworkInterfaceAttribute resetNetworkInterfaceAttribute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.resetNetworkInterfaceAttribute(resetNetworkInterfaceAttribute);
+		}
+
+		@Override
+		public CreateRouteTableResponse createRouteTable(
+				CreateRouteTable createRouteTable) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.createRouteTable(createRouteTable);
+		}
+
+		@Override
+		public CreateNetworkAclEntryResponse createNetworkAclEntry(
+				CreateNetworkAclEntry createNetworkAclEntry) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.createNetworkAclEntry(createNetworkAclEntry);
+		}
+
+		@Override
+		public DescribeVolumeAttributeResponse describeVolumeAttribute(
+				DescribeVolumeAttribute describeVolumeAttribute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeVolumeAttribute(describeVolumeAttribute);
+		}
+
+		@Override
+		public DeleteNetworkInterfaceResponse deleteNetworkInterface(
+				DeleteNetworkInterface deleteNetworkInterface) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.deleteNetworkInterface(deleteNetworkInterface);
+		}
+
+		@Override
+		public CreateInternetGatewayResponse createInternetGateway(
+				CreateInternetGateway createInternetGateway) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.createInternetGateway(createInternetGateway);
+		}
+
+		@Override
+		public DisassociateRouteTableResponse disassociateRouteTable(
+				DisassociateRouteTable disassociateRouteTable) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.disassociateRouteTable(disassociateRouteTable);
+		}
+
+		@Override
+		public ReplaceNetworkAclEntryResponse replaceNetworkAclEntry(
+				ReplaceNetworkAclEntry replaceNetworkAclEntry) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.replaceNetworkAclEntry(replaceNetworkAclEntry);
+		}
+
+		@Override
+		public AuthorizeSecurityGroupEgressResponse authorizeSecurityGroupEgress(
+				AuthorizeSecurityGroupEgress authorizeSecurityGroupEgress) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.authorizeSecurityGroupEgress(authorizeSecurityGroupEgress);
+		}
+
+		@Override
+		public DeleteNetworkAclEntryResponse deleteNetworkAclEntry(
+				DeleteNetworkAclEntry deleteNetworkAclEntry) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.deleteNetworkAclEntry(deleteNetworkAclEntry);
+		}
+
+		@Override
+		public DeleteRouteTableResponse deleteRouteTable(
+				DeleteRouteTable deleteRouteTable) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.deleteRouteTable(deleteRouteTable);
+		}
+
+		@Override
+		public DescribeNetworkInterfaceAttributeResponse describeNetworkInterfaceAttribute(
+				DescribeNetworkInterfaceAttribute describeNetworkInterfaceAttribute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeNetworkInterfaceAttribute(describeNetworkInterfaceAttribute);
+		}
+
+		@Override
+		public CreateReservedInstancesListingResponse createReservedInstancesListing(
+				CreateReservedInstancesListing createReservedInstancesListing) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.createReservedInstancesListing(createReservedInstancesListing);
+		}
+
+		@Override
+		public CreateNetworkAclResponse createNetworkAcl(
+				CreateNetworkAcl createNetworkAcl) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.createNetworkAcl(createNetworkAcl);
+		}
+
+		@Override
+		public ModifyVolumeAttributeResponse modifyVolumeAttribute(
+				ModifyVolumeAttribute modifyVolumeAttribute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.modifyVolumeAttribute(modifyVolumeAttribute);
+		}
+
+		@Override
+		public ReplaceNetworkAclAssociationResponse replaceNetworkAclAssociation(
+				ReplaceNetworkAclAssociation replaceNetworkAclAssociation) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.replaceNetworkAclAssociation(replaceNetworkAclAssociation);
+		}
+
+		@Override
+		public EnableVgwRoutePropagationResponse enableVgwRoutePropagation(
+				EnableVgwRoutePropagation enableVgwRoutePropagation) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.enableVgwRoutePropagation(enableVgwRoutePropagation);
+		}
+
+		@Override
+		public UnassignPrivateIpAddressesResponse unassignPrivateIpAddresses(
+				UnassignPrivateIpAddresses unassignPrivateIpAddresses) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.unassignPrivateIpAddresses(unassignPrivateIpAddresses);
+		}
+
+		@Override
+		public DeleteVpnConnectionRouteResponse deleteVpnConnectionRoute(
+				DeleteVpnConnectionRoute deleteVpnConnectionRoute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.deleteVpnConnectionRoute(deleteVpnConnectionRoute);
+		}
+
+		@Override
+		public CancelReservedInstancesListingResponse cancelReservedInstancesListing(
+				CancelReservedInstancesListing cancelReservedInstancesListing) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.cancelReservedInstancesListing(cancelReservedInstancesListing);
+		}
+
+		@Override
+		public DescribeNetworkAclsResponse describeNetworkAcls(
+				DescribeNetworkAcls describeNetworkAcls) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeNetworkAcls(describeNetworkAcls);
+		}
+
+		@Override
+		public EnableVolumeIOResponse enableVolumeIO(
+				EnableVolumeIO enableVolumeIO) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.enableVolumeIO(enableVolumeIO);
+		}
+
+		@Override
+		public DescribeInternetGatewaysResponse describeInternetGateways(
+				DescribeInternetGateways describeInternetGateways) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeInternetGateways(describeInternetGateways);
+		}
+
+		@Override
+		public DescribeReservedInstancesListingsResponse describeReservedInstancesListings(
+				DescribeReservedInstancesListings describeReservedInstancesListings) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeReservedInstancesListings(describeReservedInstancesListings);
+		}
+
+		@Override
+		public DescribeInstanceStatusResponse describeInstanceStatus(
+				DescribeInstanceStatus describeInstanceStatus) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeInstanceStatus(describeInstanceStatus);
+		}
+
+		@Override
+		public ModifyNetworkInterfaceAttributeResponse modifyNetworkInterfaceAttribute(
+				ModifyNetworkInterfaceAttribute modifyNetworkInterfaceAttribute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.modifyNetworkInterfaceAttribute(modifyNetworkInterfaceAttribute);
+		}
+
+		@Override
+		public DisableVgwRoutePropagationResponse disableVgwRoutePropagation(
+				DisableVgwRoutePropagation disableVgwRoutePropagation) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.disableVgwRoutePropagation(disableVgwRoutePropagation);
+		}
+
+		@Override
+		public DescribeVolumeStatusResponse describeVolumeStatus(
+				DescribeVolumeStatus describeVolumeStatus) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeVolumeStatus(describeVolumeStatus);
+		}
+
+		@Override
+		public DetachNetworkInterfaceResponse detachNetworkInterface(
+				DetachNetworkInterface detachNetworkInterface) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.detachNetworkInterface(detachNetworkInterface);
+		}
+
+		@Override
+		public DescribeNetworkInterfacesResponse describeNetworkInterfaces(
+				DescribeNetworkInterfaces describeNetworkInterfaces) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeNetworkInterfaces(describeNetworkInterfaces);
+		}
+
+		@Override
+		public CancelExportTaskResponse cancelExportTask(
+				CancelExportTask cancelExportTask) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.cancelExportTask(cancelExportTask);
+		}
+
+		@Override
+		public CreateRouteResponse createRoute(CreateRoute createRoute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.createRoute(createRoute);
+		}
+
+		@Override
+		public DescribeRouteTablesResponse describeRouteTables(
+				DescribeRouteTables describeRouteTables) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeRouteTables(describeRouteTables);
+		}
+
+		@Override
+		public DeleteNetworkAclResponse deleteNetworkAcl(
+				DeleteNetworkAcl deleteNetworkAcl) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.deleteNetworkAcl(deleteNetworkAcl);
+		}
+
+		@Override
+		public DeleteRouteResponse deleteRoute(DeleteRoute deleteRoute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.deleteRoute(deleteRoute);
+		}
+
+		@Override
+		public CreateVpnConnectionRouteResponse createVpnConnectionRoute(
+				CreateVpnConnectionRoute createVpnConnectionRoute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.createVpnConnectionRoute(createVpnConnectionRoute);
+		}
+
+		@Override
+		public AttachInternetGatewayResponse attachInternetGateway(
+				AttachInternetGateway attachInternetGateway) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.attachInternetGateway(attachInternetGateway);
+		}
+
+		@Override
+		public ReplaceRouteTableAssociationResponse replaceRouteTableAssociation(
+				ReplaceRouteTableAssociation replaceRouteTableAssociation) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.replaceRouteTableAssociation(replaceRouteTableAssociation);
+		}
+
+		@Override
+		public AssociateRouteTableResponse associateRouteTable(
+				AssociateRouteTable associateRouteTable) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.associateRouteTable(associateRouteTable);
+		}
+
+		@Override
+		public DetachInternetGatewayResponse detachInternetGateway(
+				DetachInternetGateway detachInternetGateway) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.detachInternetGateway(detachInternetGateway);
+		}
+
+		@Override
+		public DescribeExportTasksResponse describeExportTasks(
+				DescribeExportTasks describeExportTasks) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.describeExportTasks(describeExportTasks);
+		}
+
+		@Override
+		public CreateInstanceExportTaskResponse createInstanceExportTask(
+				CreateInstanceExportTask createInstanceExportTask) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.createInstanceExportTask(createInstanceExportTask);
+		}
+
+		@Override
+		public AssignPrivateIpAddressesResponse assignPrivateIpAddresses(
+				AssignPrivateIpAddresses assignPrivateIpAddresses) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.assignPrivateIpAddresses(assignPrivateIpAddresses);
+		}
+
+		@Override
+		public ReportInstanceStatusResponse reportInstanceStatus(
+				ReportInstanceStatus reportInstanceStatus) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.reportInstanceStatus(reportInstanceStatus);
+		}
+
+		@Override
+		public DeleteInternetGatewayResponse deleteInternetGateway(
+				DeleteInternetGateway deleteInternetGateway) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.deleteInternetGateway(deleteInternetGateway);
+		}
+
+		@Override
+		public AttachNetworkInterfaceResponse attachNetworkInterface(
+				AttachNetworkInterface attachNetworkInterface) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.attachNetworkInterface(attachNetworkInterface);
+		}
+
+		@Override
+		public CreateNetworkInterfaceResponse createNetworkInterface(
+				CreateNetworkInterface createNetworkInterface) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.createNetworkInterface(createNetworkInterface);
+		}
+
+		@Override
+		public RevokeSecurityGroupEgressResponse revokeSecurityGroupEgress(
+				RevokeSecurityGroupEgress revokeSecurityGroupEgress) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.revokeSecurityGroupEgress(revokeSecurityGroupEgress);
+		}
+
+		@Override
+		public ReplaceRouteResponse replaceRoute(ReplaceRoute replaceRoute) {
+			AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
+			return ec2Service.replaceRoute(replaceRoute);
+	
+		}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/135b688a/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java b/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java
index f6ac971..3e3f578 100644
--- a/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java
+++ b/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java
@@ -122,8 +122,9 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 	public AuthorizeSecurityGroupIngressResponse authorizeSecurityGroupIngress(AuthorizeSecurityGroupIngress authorizeSecurityGroupIngress) {
         AuthorizeSecurityGroupIngressType sgit = authorizeSecurityGroupIngress.getAuthorizeSecurityGroupIngress();        
         IpPermissionSetType ipPerms = sgit.getIpPermissions();
-        
-        EC2AuthorizeRevokeSecurityGroup request = toSecurityGroup( sgit.getGroupName(), ipPerms.getItem());
+
+        EC2AuthorizeRevokeSecurityGroup request = toSecurityGroup(
+                sgit.getAuthorizeSecurityGroupIngressTypeChoice_type0().getGroupName(), ipPerms.getItem());
 		return toAuthorizeSecurityGroupIngressResponse( engine.authorizeSecurityGroup( request ));
 	}
 
@@ -132,8 +133,9 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 	{
         RevokeSecurityGroupIngressType sgit = revokeSecurityGroupIngress.getRevokeSecurityGroupIngress();        
         IpPermissionSetType ipPerms = sgit.getIpPermissions();
-        
-        EC2AuthorizeRevokeSecurityGroup request = toSecurityGroup( sgit.getGroupName(), ipPerms.getItem());
+
+        EC2AuthorizeRevokeSecurityGroup request = toSecurityGroup(
+                sgit.getRevokeSecurityGroupIngressTypeChoice_type0().getGroupName(), ipPerms.getItem());
 		return toRevokeSecurityGroupIngressResponse( engine.revokeSecurityGroup( request ));
 	}
 
@@ -478,8 +480,8 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
     @Override
     public ReleaseAddressResponse releaseAddress(ReleaseAddress releaseAddress) {
     	EC2ReleaseAddress request = new EC2ReleaseAddress();
-    	
-    	request.setPublicIp(releaseAddress.getReleaseAddress().getPublicIp());
+
+        request.setPublicIp(releaseAddress.getReleaseAddress().getReleaseAddressTypeChoice_type0().getPublicIp());
     	
         return toReleaseAddressResponse( engine.releaseAddress( request ) );
     }
@@ -487,10 +489,12 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
     @Override
     public AssociateAddressResponse associateAddress(AssociateAddress associateAddress) {
     	EC2AssociateAddress request = new EC2AssociateAddress();
-    	
-    	request.setPublicIp(associateAddress.getAssociateAddress().getPublicIp());
-    	request.setInstanceId(associateAddress.getAssociateAddress().getInstanceId());
-    	
+	
+        request.setPublicIp( associateAddress.getAssociateAddress().
+                getAssociateAddressTypeChoice_type0().getPublicIp());
+        request.setInstanceId(associateAddress.getAssociateAddress().
+                getAssociateAddressTypeChoice_type1().getInstanceId());
+
         return toAssociateAddressResponse( engine.associateAddress( request ) );
     }
 
@@ -794,7 +798,12 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 		if (null != gst) {
 			GroupItemType[] items = gst.getItem();
 			if (null != items) {
-				for( int i=0; i < items.length; i++ ) request.addGroupName(items[i].getGroupId());
+                for( int i=0; i < items.length; i++ ) {
+                    if ( items[i].getGroupName() != null) // either SG-name or SG-id can be provided
+                        request.addSecuritGroupName( items[i].getGroupName());
+                    else
+                        request.addSecuritGroupId( items[i].getGroupId());
+                }
 		    }
 		}
 		return toRunInstancesResponse( engine.runInstances( request ), engine);
@@ -973,6 +982,7 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 		    ProductCodesSetType param4 = new ProductCodesSetType();
 	        ProductCodesSetItemType param5 = new ProductCodesSetItemType();
 	        param5.setProductCode( "" );
+            param5.setType("");
             param4.addItem( param5 );		    
 		    param3.setProductCodes( param4 );
 		    
@@ -1342,6 +1352,7 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 	        param3.setSnapshotId(snapId);
 	        param3.setAvailabilityZone( vol.getZoneName());
 	        param3.setStatus( vol.getState());
+	        param3.setVolumeType("standard");
 	        
         	// -> CloudStack seems to have issues with timestamp formats so just in case
 	        Calendar cal = EC2RestAuth.parseDateString(vol.getCreated());
@@ -1427,11 +1438,13 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
             if (null == groups || 0 == groups.length) {
                 GroupItemType param5 = new GroupItemType();
                 param5.setGroupId("");
+                param5.setGroupName("");
                 param4.addItem( param5 );
             } else {
                 for (EC2SecurityGroup group : groups) {
                     GroupItemType param5 = new GroupItemType();
                     param5.setGroupId(group.getId());
+                    param5.setGroupName("");
                     param4.addItem( param5 );
                 }
             }
@@ -1458,6 +1471,7 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 	        ProductCodesSetType param9 = new ProductCodesSetType();
 	        ProductCodesSetItemType param10 = new ProductCodesSetItemType();
 	        param10.setProductCode( "" );
+            param10.setType("");
             param9.addItem( param10 );
 	        param7.setProductCodes( param9 );
 	        
@@ -1494,7 +1508,13 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
             param7.setRootDeviceType( "" );
         	String devicePath = engine.cloudDeviceIdToDevicePath( inst.getHypervisor(), inst.getRootDeviceId());
             param7.setRootDeviceName( devicePath );
-            
+
+            GroupSetType param14 = new GroupSetType();
+            GroupItemType param15 = new GroupItemType(); // VPC security group
+            param15.setGroupName("");
+            param15.setGroupName("");
+            param14.addItem(param15);
+            param7.setGroupSet(param14);
 
             param7.setInstanceLifecycle( "" );
             param7.setSpotInstanceRequestId( "" );
@@ -1542,6 +1562,8 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
     	AllocateAddressResponseType param1 = new AllocateAddressResponseType();
     	
     	param1.setPublicIp(ec2Address.getIpAddress());
+        param1.setDomain("standard");
+        param1.setAllocationId("");
     	param1.setRequestId(UUID.randomUUID().toString());
     	response.setAllocateAddressResponse(param1);
     	return response;
@@ -1561,7 +1583,8 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
     public static AssociateAddressResponse toAssociateAddressResponse(final boolean result) {
     	AssociateAddressResponse response = new AssociateAddressResponse();
     	AssociateAddressResponseType param1 = new AssociateAddressResponseType();
-    	
+
+        param1.setAssociationId("");
     	param1.setRequestId(UUID.randomUUID().toString());
     	param1.set_return(result);
     	
@@ -1761,6 +1784,7 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 	        ProductCodesSetType param9 = new ProductCodesSetType();
 	        ProductCodesSetItemType param10 = new ProductCodesSetItemType();
 	        param10.setProductCode( "" );
+            param10.setType("");
             param9.addItem( param10 );
 	        param7.setProductCodes( param9 );
 	        
@@ -1809,7 +1833,14 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
             param19.setValue("");
             param18.addItem( param19 );
             param7.setTagSet( param18 );          
-            
+
+            GroupSetType param14 = new GroupSetType();
+            GroupItemType param15 = new GroupItemType();
+            param15.setGroupId("");
+            param15.setGroupName("");
+            param14.addItem(param15);
+            param7.setGroupSet(param14);
+
             String hypervisor = inst.getHypervisor();
             param7.setHypervisor((null != hypervisor ? hypervisor : ""));
 	        param6.addItem( param7 );
@@ -1907,6 +1938,7 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
         }
 		param1.setCreateTime( cal );
 
+        param1.setVolumeType("standard");
 		param1.setRequestId( UUID.randomUUID().toString());
         response.setCreateVolumeResponse( param1 );
 		return response;
@@ -2040,6 +2072,8 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 			param3.setGroupName(group.getName());
 			String desc = group.getDescription();
 			param3.setGroupDescription((null != desc ? desc : ""));
+            param3.setGroupId(group.getId());
+            param3.setVpcId("");
 
 			IpPermissionSetType param4 = new IpPermissionSetType();
 			EC2IpPermission[] perms = group.getIpPermissionSet();
@@ -2101,11 +2135,16 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 		return response;
 	}
 	
-	public static CreateSecurityGroupResponse toCreateSecurityGroupResponse( boolean success ) {
+
+    public static CreateSecurityGroupResponse toCreateSecurityGroupResponse( EC2SecurityGroup sg ) {
 		CreateSecurityGroupResponse response = new CreateSecurityGroupResponse();
 		CreateSecurityGroupResponseType param1 = new CreateSecurityGroupResponseType();
 
-		param1.set_return(success);
+        param1.setGroupId( sg.getId() );
+        if ( sg.getId() != null )
+            param1.set_return(true);
+        else
+            param1.set_return(false);
 		param1.setRequestId( UUID.randomUUID().toString());
 		response.setCreateSecurityGroupResponse( param1 );
 		return response;
@@ -2540,4 +2579,295 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface  {
 	public ResetSnapshotAttributeResponse resetSnapshotAttribute(ResetSnapshotAttribute resetSnapshotAttribute) {
 		throw new EC2ServiceException(ClientError.Unsupported, "This operation is not available");
 	}
+	
+
+	public ResetNetworkInterfaceAttributeResponse resetNetworkInterfaceAttribute(
+			ResetNetworkInterfaceAttribute resetNetworkInterfaceAttribute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CreateRouteTableResponse createRouteTable(
+			CreateRouteTable createRouteTable) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CreateNetworkAclEntryResponse createNetworkAclEntry(
+			CreateNetworkAclEntry createNetworkAclEntry) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeVolumeAttributeResponse describeVolumeAttribute(
+			DescribeVolumeAttribute describeVolumeAttribute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DeleteNetworkInterfaceResponse deleteNetworkInterface(
+			DeleteNetworkInterface deleteNetworkInterface) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CreateInternetGatewayResponse createInternetGateway(
+			CreateInternetGateway createInternetGateway) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DisassociateRouteTableResponse disassociateRouteTable(
+			DisassociateRouteTable disassociateRouteTable) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public ReplaceNetworkAclEntryResponse replaceNetworkAclEntry(
+			ReplaceNetworkAclEntry replaceNetworkAclEntry) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public AuthorizeSecurityGroupEgressResponse authorizeSecurityGroupEgress(
+			AuthorizeSecurityGroupEgress authorizeSecurityGroupEgress) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DeleteNetworkAclEntryResponse deleteNetworkAclEntry(
+			DeleteNetworkAclEntry deleteNetworkAclEntry) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DeleteRouteTableResponse deleteRouteTable(
+			DeleteRouteTable deleteRouteTable) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeNetworkInterfaceAttributeResponse describeNetworkInterfaceAttribute(
+			DescribeNetworkInterfaceAttribute describeNetworkInterfaceAttribute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CreateReservedInstancesListingResponse createReservedInstancesListing(
+			CreateReservedInstancesListing createReservedInstancesListing) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CreateNetworkAclResponse createNetworkAcl(
+			CreateNetworkAcl createNetworkAcl) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public ModifyVolumeAttributeResponse modifyVolumeAttribute(
+			ModifyVolumeAttribute modifyVolumeAttribute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public ReplaceNetworkAclAssociationResponse replaceNetworkAclAssociation(
+			ReplaceNetworkAclAssociation replaceNetworkAclAssociation) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public EnableVgwRoutePropagationResponse enableVgwRoutePropagation(
+			EnableVgwRoutePropagation enableVgwRoutePropagation) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public UnassignPrivateIpAddressesResponse unassignPrivateIpAddresses(
+			UnassignPrivateIpAddresses unassignPrivateIpAddresses) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DeleteVpnConnectionRouteResponse deleteVpnConnectionRoute(
+			DeleteVpnConnectionRoute deleteVpnConnectionRoute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CancelReservedInstancesListingResponse cancelReservedInstancesListing(
+			CancelReservedInstancesListing cancelReservedInstancesListing) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeNetworkAclsResponse describeNetworkAcls(
+			DescribeNetworkAcls describeNetworkAcls) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public EnableVolumeIOResponse enableVolumeIO(EnableVolumeIO enableVolumeIO) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeInternetGatewaysResponse describeInternetGateways(
+			DescribeInternetGateways describeInternetGateways) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeReservedInstancesListingsResponse describeReservedInstancesListings(
+			DescribeReservedInstancesListings describeReservedInstancesListings) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeInstanceStatusResponse describeInstanceStatus(
+			DescribeInstanceStatus describeInstanceStatus) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public ModifyNetworkInterfaceAttributeResponse modifyNetworkInterfaceAttribute(
+			ModifyNetworkInterfaceAttribute modifyNetworkInterfaceAttribute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DisableVgwRoutePropagationResponse disableVgwRoutePropagation(
+			DisableVgwRoutePropagation disableVgwRoutePropagation) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeVolumeStatusResponse describeVolumeStatus(
+			DescribeVolumeStatus describeVolumeStatus) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DetachNetworkInterfaceResponse detachNetworkInterface(
+			DetachNetworkInterface detachNetworkInterface) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeNetworkInterfacesResponse describeNetworkInterfaces(
+			DescribeNetworkInterfaces describeNetworkInterfaces) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CancelExportTaskResponse cancelExportTask(
+			CancelExportTask cancelExportTask) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CreateRouteResponse createRoute(CreateRoute createRoute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeRouteTablesResponse describeRouteTables(
+			DescribeRouteTables describeRouteTables) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DeleteNetworkAclResponse deleteNetworkAcl(
+			DeleteNetworkAcl deleteNetworkAcl) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DeleteRouteResponse deleteRoute(DeleteRoute deleteRoute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CreateVpnConnectionRouteResponse createVpnConnectionRoute(
+			CreateVpnConnectionRoute createVpnConnectionRoute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public AttachInternetGatewayResponse attachInternetGateway(
+			AttachInternetGateway attachInternetGateway) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public ReplaceRouteTableAssociationResponse replaceRouteTableAssociation(
+			ReplaceRouteTableAssociation replaceRouteTableAssociation) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public AssociateRouteTableResponse associateRouteTable(
+			AssociateRouteTable associateRouteTable) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DetachInternetGatewayResponse detachInternetGateway(
+			DetachInternetGateway detachInternetGateway) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DescribeExportTasksResponse describeExportTasks(
+			DescribeExportTasks describeExportTasks) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CreateInstanceExportTaskResponse createInstanceExportTask(
+			CreateInstanceExportTask createInstanceExportTask) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public AssignPrivateIpAddressesResponse assignPrivateIpAddresses(
+			AssignPrivateIpAddresses assignPrivateIpAddresses) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public ReportInstanceStatusResponse reportInstanceStatus(
+			ReportInstanceStatus reportInstanceStatus) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public DeleteInternetGatewayResponse deleteInternetGateway(
+			DeleteInternetGateway deleteInternetGateway) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public AttachNetworkInterfaceResponse attachNetworkInterface(
+			AttachNetworkInterface attachNetworkInterface) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public CreateNetworkInterfaceResponse createNetworkInterface(
+			CreateNetworkInterface createNetworkInterface) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public RevokeSecurityGroupEgressResponse revokeSecurityGroupEgress(
+			RevokeSecurityGroupEgress revokeSecurityGroupEgress) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
+
+	public ReplaceRouteResponse replaceRoute(ReplaceRoute replaceRoute) {
+		throw new EC2ServiceException(ClientError.Unsupported,
+				"This operation is not available");
+	}
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/135b688a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java
index 715c83e..9d569d4 100644
--- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java
+++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java
@@ -25,7 +25,6 @@ import java.security.SignatureException;
 import java.sql.SQLException;
 import java.text.ParseException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -111,7 +110,7 @@ public class EC2Engine extends ManagerBase {
 
 
     /**
-     * Which management server to we talk to?  
+     * Which management server to we talk to?
      * Load a mapping form Amazon values for 'instanceType' to cloud defined
      * diskOfferingId and serviceOfferingId.
      * 
@@ -176,7 +175,7 @@ public class EC2Engine extends ManagerBase {
         if (_eng == null) {
             _eng = new CloudStackApi(managementServer, cloudAPIPort, false);
         }
-        // regardless of whether _eng is initialized, we must make sure 
+        // regardless of whether _eng is initialized, we must make sure
         // access/secret keys are current with what's in the UserCredentials
         _eng.setApiKey(UserContext.current().getAccessKey());
         _eng.setSecretKey(UserContext.current().getSecretKey());
@@ -206,7 +205,7 @@ public class EC2Engine extends ManagerBase {
         }
 
         try {
-            oldApiKey = _eng.getApiKey(); 
+            oldApiKey = _eng.getApiKey();
             oldSecretKey = _eng.getSecretKey();
         } catch(Exception e) {
             // we really don't care, and expect this
@@ -236,18 +235,18 @@ public class EC2Engine extends ManagerBase {
      * @param groupDesc
      * @return
      */
-    public Boolean createSecurityGroup(String groupName, String groupDesc) {
+    public EC2SecurityGroup createSecurityGroup(String groupName, String groupDesc) {
+        EC2SecurityGroup sg = new EC2SecurityGroup();
         try {
             CloudStackSecurityGroup grp = getApi().createSecurityGroup(groupName, null, groupDesc, null);
             if (grp != null && grp.getId() != null) {
-                return true;
+            	sg.setId(grp.getId());
             }
-            return false;
         } catch( Exception e ) {
             logger.error( "EC2 CreateSecurityGroup - ", e);
             handleException(e);
         }
-        return false;
+        return sg;
     }
 
     /**
@@ -292,15 +291,15 @@ public class EC2Engine extends ManagerBase {
     }
 
     /**
-     * CloudStack supports revoke only by using the ruleid of the ingress rule.   
+     * CloudStack supports revoke only by using the ruleid of the ingress rule.
      * We list all security groups and find the matching group and use the first ruleId we find.
      * 
      * @param request
      * @return
      */
-    public boolean revokeSecurityGroup( EC2AuthorizeRevokeSecurityGroup request ) 
+    public boolean revokeSecurityGroup( EC2AuthorizeRevokeSecurityGroup request )
     {
-        try {   
+        try {
             String[] groupSet = new String[1];
             groupSet[0] = request.getName();
             String ruleId = null;
@@ -346,7 +345,7 @@ public class EC2Engine extends ManagerBase {
             for (EC2IpPermission ipPerm : items) {
                 EC2SecurityGroup[] groups = ipPerm.getUserSet();
 
-                List<CloudStackKeyValue> secGroupList = new ArrayList<CloudStackKeyValue>(); 
+                List<CloudStackKeyValue> secGroupList = new ArrayList<CloudStackKeyValue>();
                 for (EC2SecurityGroup group : groups) {
                     CloudStackKeyValue pair = new CloudStackKeyValue();
                     pair.setKeyValue(group.getAccount(), group.getName());
@@ -354,12 +353,12 @@ public class EC2Engine extends ManagerBase {
                 }
                 CloudStackSecurityGroup resp = null;
                 if (ipPerm.getProtocol().equalsIgnoreCase("icmp")) {
-                    resp = getApi().authorizeSecurityGroupIngress(null, constructList(ipPerm.getIpRangeSet()), null, null, 
-                            ipPerm.getIcmpCode(), ipPerm.getIcmpType(), ipPerm.getProtocol(), null, 
+                    resp = getApi().authorizeSecurityGroupIngress(null, constructList(ipPerm.getIpRangeSet()), null, null,
+                            ipPerm.getIcmpCode(), ipPerm.getIcmpType(), ipPerm.getProtocol(), null,
                             request.getName(), null, secGroupList);
                 } else {
-                    resp = getApi().authorizeSecurityGroupIngress(null, constructList(ipPerm.getIpRangeSet()), null, 
-                            ipPerm.getToPort().longValue(), null, null, ipPerm.getProtocol(), null, request.getName(), 
+                    resp = getApi().authorizeSecurityGroupIngress(null, constructList(ipPerm.getIpRangeSet()), null,
+                            ipPerm.getToPort().longValue(), null, null, ipPerm.getProtocol(), null, request.getName(),
                             ipPerm.getFromPort().longValue(), secGroupList);
                 }
                 if (resp != null ){
@@ -418,12 +417,12 @@ public class EC2Engine extends ManagerBase {
             matches++;
         }
 
-        // -> is the port(s) from the request (left) a match of the rule's port(s) 
+        // -> is the port(s) from the request (left) a match of the rule's port(s)
         if (0 != permLeft.getFromPort()) {
             // -> -1 means all ports match
             if (-1 != permLeft.getFromPort()) {
-                if (permLeft.getFromPort().compareTo(permRight.getFromPort()) != 0 || 
-                        permLeft.getToPort().compareTo(permRight.getToPort()) != 0) 
+                if (permLeft.getFromPort().compareTo(permRight.getFromPort()) != 0 ||
+                        permLeft.getToPort().compareTo(permRight.getToPort()) != 0)
                     return null;
             }
             matches++;
@@ -431,7 +430,7 @@ public class EC2Engine extends ManagerBase {
 
 
         // -> was permLeft set up properly with at least one property to match?
-        if ( 0 == matches ) 
+        if ( 0 == matches )
             return null;
         else return permRight.getRuleId();
     }
@@ -442,13 +441,13 @@ public class EC2Engine extends ManagerBase {
      * @param request
      * @return
      */
-    public EC2DescribeSnapshotsResponse describeSnapshots( EC2DescribeSnapshots request ) 
+    public EC2DescribeSnapshotsResponse describeSnapshots( EC2DescribeSnapshots request )
     {
         EC2DescribeSnapshotsResponse response = new EC2DescribeSnapshotsResponse();
         EC2SnapshotFilterSet sfs = request.getFilterSet();
         EC2TagKeyValue[] tagKeyValueSet = request.getResourceTagSet();
 
-        try { 
+        try {
             response = listSnapshots( request.getSnapshotSet(),
                     getResourceTags(tagKeyValueSet));
             if (response == null) {
@@ -549,7 +548,7 @@ public class EC2Engine extends ManagerBase {
      * @param request
      * @return
      */
-    public boolean modifyImageAttribute( EC2ModifyImageAttribute request ) 
+    public boolean modifyImageAttribute( EC2ModifyImageAttribute request )
     {
         try {
             if(request.getAttribute().equals(ImageAttribute.launchPermission)){
@@ -681,7 +680,7 @@ public class EC2Engine extends ManagerBase {
         String keyPairName = request.getKeyName();
         try {
             resp = getApi().deleteSSHKeyPair(keyPairName, null, null);
-            if (resp == null) { 
+            if (resp == null) {
                 throw new Exception("Ivalid CloudStack API response");
             }
         } catch(Exception e) {
@@ -866,7 +865,7 @@ public class EC2Engine extends ManagerBase {
             } else {
                 ec2Address.setIpAddress(resp.getIpAddress());
             }
-        } catch(Exception e) { 
+        } catch(Exception e) {
             logger.error( "EC2 AllocateAddress - ", e);
             handleException(e);
         }
@@ -905,7 +904,7 @@ public class EC2Engine extends ManagerBase {
     /**
      * Create a template
      * Amazon API just gives us the instanceId to create the template from.
-     * But our createTemplate function requires the volumeId and osTypeId.  
+     * But our createTemplate function requires the volumeId and osTypeId.
      * So to get that we must make the following sequence of cloud API calls:
      * 1) listVolumes&virtualMachineId=   -- gets the volumeId
      * 2) listVirtualMachinees&id=        -- gets the templateId
@@ -917,7 +916,7 @@ public class EC2Engine extends ManagerBase {
      * @param request
      * @return
      */
-    public EC2CreateImageResponse createImage(EC2CreateImage request) 
+    public EC2CreateImageResponse createImage(EC2CreateImage request)
     {
         EC2CreateImageResponse response = new EC2CreateImageResponse();
         boolean needsRestart = false;
@@ -935,7 +934,7 @@ public class EC2Engine extends ManagerBase {
                         needsRestart = true;
                         if (!stopVirtualMachine( request.getInstanceId() ))
                             throw new Exception("Instance must be in a stopped state");
-                    }           		 
+                    }
                     volumeId = vol.getId();
                     break;
                 }
@@ -952,7 +951,7 @@ public class EC2Engine extends ManagerBase {
             EC2Image[] imageSet = images.getImageSet();
             String osTypeId = imageSet[0].getOsTypeId();
 
-            CloudStackTemplate resp = getApi().createTemplate((request.getDescription() == null ? "" : request.getDescription()), request.getName(), 
+            CloudStackTemplate resp = getApi().createTemplate((request.getDescription() == null ? "" : request.getDescription()), request.getName(),
                     osTypeId, null, null, null, null, null, null, volumeId);
             if (resp == null || resp.getId() == null) {
                 throw new Exception("Image couldn't be created");
@@ -975,15 +974,15 @@ public class EC2Engine extends ManagerBase {
 
     /**
      * Register a template
-     *  
+     * 
      * @param request
      * @return
      */
     public EC2CreateImageResponse registerImage(EC2RegisterImage request) {
         EC2CreateImageResponse image = new EC2CreateImageResponse();
         try {
-            List<CloudStackTemplate> templates = getApi().registerTemplate((request.getDescription() == null ? request.getName() : request.getDescription()), 
-                    request.getFormat(), request.getHypervisor(), request.getName(), toOSTypeId(request.getOsTypeName()), request.getLocation(), 
+            List<CloudStackTemplate> templates = getApi().registerTemplate((request.getDescription() == null ? request.getName() : request.getDescription()),
+                    request.getFormat(), request.getHypervisor(), request.getName(), toOSTypeId(request.getOsTypeName()), request.getLocation(),
                     toZoneId(request.getZoneName(), null), null, null, null, null, null, null, null, null, null);
             if (templates != null) {
                 // technically we will only ever register a single template...
@@ -1009,7 +1008,7 @@ public class EC2Engine extends ManagerBase {
      * @param image
      * @return
      */
-    public boolean deregisterImage( EC2Image image ) 
+    public boolean deregisterImage( EC2Image image )
     {
         try {
             CloudStackInfoResponse resp = getApi().deleteTemplate(image.getId(), null);
@@ -1046,7 +1045,7 @@ public class EC2Engine extends ManagerBase {
      * @param request
      * @return
      */
-    public EC2DescribeAvailabilityZonesResponse describeAvailabilityZones(EC2DescribeAvailabilityZones request) {	
+    public EC2DescribeAvailabilityZonesResponse describeAvailabilityZones(EC2DescribeAvailabilityZones request) {
         EC2DescribeAvailabilityZonesResponse availableZones = new EC2DescribeAvailabilityZonesResponse();
         try {
             availableZones = listZones(request.getZoneSet(), null);
@@ -1070,16 +1069,16 @@ public class EC2Engine extends ManagerBase {
         EC2DescribeVolumesResponse volumes = new EC2DescribeVolumesResponse();
         EC2VolumeFilterSet vfs = request.getFilterSet();
         EC2TagKeyValue[] tagKeyValueSet = request.getResourceTagSet();
-        try {   
+        try {
             String[] volumeIds = request.getVolumeSet();
             if ( 0 == volumeIds.length ){
                 volumes = listVolumes( null, null, volumes, getResourceTags(tagKeyValueSet) );
-            } else {     
-                for (String s : volumeIds) 
+            } else {
+                for (String s : volumeIds)
                     volumes = listVolumes(s, null, volumes, getResourceTags(tagKeyValueSet) );
             }
             if ( vfs != null )
-                volumes = vfs.evaluate( volumes );     
+                volumes = vfs.evaluate( volumes );
         }  catch( Exception e ) {
             logger.error( "EC2 DescribeVolumes - ", e);
             handleException(e);
@@ -1095,7 +1094,7 @@ public class EC2Engine extends ManagerBase {
      */
     public EC2Volume attachVolume( EC2Volume request ) {
         EC2Volume resp = new EC2Volume();
-        try {   
+        try {
             request.setDeviceId(mapDeviceToCloudDeviceId(request.getDevice()));
             CloudStackVolume vol = getApi().attachVolume(request.getId(), request.getInstanceId(), request.getDeviceId());
             if(vol != null) {
@@ -1327,12 +1326,12 @@ public class EC2Engine extends ManagerBase {
      * @param request
      * @return
      */
-    public boolean rebootInstances(EC2RebootInstances request) 
+    public boolean rebootInstances(EC2RebootInstances request)
     {
         EC2Instance[] vms = null;
 
         // -> reboot is not allowed on destroyed (i.e., terminated) instances
-        try {   
+        try {
             String[] instanceSet = request.getInstancesSet();
             EC2DescribeInstancesResponse previousState = listVirtualMachines( instanceSet, null, null );
             vms = previousState.getInstanceSet();
@@ -1347,7 +1346,7 @@ public class EC2Engine extends ManagerBase {
             }
 
             // -> if some specified VMs where not found we have to tell the caller
-            if (instanceSet.length != vms.length) 
+            if (instanceSet.length != vms.length)
                 throw new Exception("One or more instanceIds do not exist, other instances rebooted.");
 
             return true;
@@ -1359,7 +1358,7 @@ public class EC2Engine extends ManagerBase {
     }
 
     /**
-     * Using a template (AMI), launch n instances 
+     * Using a template (AMI), launch n instances
      * 
      * @param request
      * @return
@@ -1369,6 +1368,8 @@ public class EC2Engine extends ManagerBase {
         int createInstances    = 0;
         int canCreateInstances = -1;
         int countCreated       = 0;
+        String groupIds   = null;
+        String groupNames = null;
 
         try {
             // ugly...
@@ -1380,14 +1381,14 @@ public class EC2Engine extends ManagerBase {
                 throw new Exception("Min Count is greater than the number of instances left to allocate");
             }
 
-            if ( canCreateInstances < request.getMaxCount()) 
+            if ( canCreateInstances < request.getMaxCount())
                 createInstances = request.getMinCount();
-            else 
+            else
                 createInstances = request.getMaxCount();
 
             //find CS service Offering ID
             String instanceType = "m1.small";
-            if(request.getInstanceType() != null){ 
+            if(request.getInstanceType() != null){
                 instanceType = request.getInstanceType();
             }
             CloudStackServiceOfferingVO svcOffering = getCSServiceOfferingId(instanceType);
@@ -1410,13 +1411,25 @@ public class EC2Engine extends ManagerBase {
             // network
             //CloudStackNetwork network = findNetwork(zone);
 
+            // for EC2 security groups either a group ID or a group name is accepted
+            String[] sgIdList = request.getSecurityGroupIdSet();
+            String[] sgNameList = request.getSecurityGroupNameSet();
+            if (sgIdList.length != 0 && sgNameList.length != 0)
+                throw new EC2ServiceException(ClientError.InvalidParameterCombination,
+                        " for EC2 groups either a group ID or a group name is accepted");
+
+            if (sgIdList.length != 0)
+                groupIds = constructList(sgIdList);
+            if (sgNameList.length != 0)
+                groupNames = constructList(sgNameList);
+
             // now actually deploy the vms
             for( int i=0; i < createInstances; i++ ) {
                 try{
-                    CloudStackUserVm resp = getApi().deployVirtualMachine(svcOffering.getId(), 
+                    CloudStackUserVm resp = getApi().deployVirtualMachine(svcOffering.getId(),
                             request.getTemplateId(), zoneId, null, null, null, null,
                             null, null, null, request.getKeyName(), null, null,
-                            null, constructList(request.getGroupSet()), request.getSize().longValue(), request.getUserData());
+                            groupIds, groupNames, request.getSize().longValue(), request.getUserData());
                     EC2Instance vm = new EC2Instance();
                     vm.setId(resp.getId().toString());
                     vm.setName(resp.getName());
@@ -1480,7 +1493,7 @@ public class EC2Engine extends ManagerBase {
             EC2DescribeInstancesResponse previousState = listVirtualMachines( request.getInstancesSet(), null, null );
             vms = previousState.getInstanceSet();
 
-            // -> send start requests for each item 
+            // -> send start requests for each item
             for (EC2Instance vm : vms) {
                 vm.setPreviousState(vm.getState());
 
@@ -1516,14 +1529,14 @@ public class EC2Engine extends ManagerBase {
         EC2Instance[] virtualMachines = null;
 
         // -> first determine the current state of each VM (becomes it previous state)
-        try {   
+        try {
             String[] instanceSet = request.getInstancesSet();
             Boolean forced = request.getForce();
 
             EC2DescribeInstancesResponse previousState = listVirtualMachines( instanceSet, null, null );
             virtualMachines = previousState.getInstanceSet();
 
-            // -> send stop requests for each item 
+            // -> send stop requests for each item
             for (EC2Instance vm : virtualMachines) {
                 vm.setPreviousState( vm.getState());
                 CloudStackUserVm resp = null;
@@ -1594,14 +1607,14 @@ public class EC2Engine extends ManagerBase {
     }
 
     /**
-     * RunInstances includes a min and max count of requested instances to create.  
+     * RunInstances includes a min and max count of requested instances to create.
      * We have to be able to create the min number for the user or none at all.  So
-     * here we determine what the user has left to create. 
+     * here we determine what the user has left to create.
      * 
      * @return -1 means no limit exists, other positive numbers give max number left that
      *         the user can create.
      */
-    private int calculateAllowedInstances() throws Exception {    
+    private int calculateAllowedInstances() throws Exception {
         int maxAllowed = -1;
 
         CloudStackAccount ourAccount = getCurrentAccount();
@@ -1612,16 +1625,16 @@ public class EC2Engine extends ManagerBase {
             return -99999;
         }
 
-        // if accountType is Admin == 1, then let's return -1 
+        // if accountType is Admin == 1, then let's return -1
         if (ourAccount.getAccountType() == 1) return -1;
 
         // -> get the user limits on instances
-        // "0" represents instances:  
+        // "0" represents instances:
         // http://download.cloud.com/releases/2.2.0/api_2.2.8/user/listResourceLimits.html
         List<CloudStackResourceLimit> limits = getApi().listResourceLimits(null, null, null, null, "0");
         if (limits != null && limits.size() > 0) {
             maxAllowed = (int)limits.get(0).getMax().longValue();
-            if (maxAllowed == -1) 
+            if (maxAllowed == -1)
                 return -1;   // no limit
 
             EC2DescribeInstancesResponse existingVMS = listVirtualMachines( null, null, null );
@@ -1639,7 +1652,7 @@ public class EC2Engine extends ManagerBase {
      * @param ifs - filter out unwanted instances
      */
     private EC2DescribeInstancesResponse listVirtualMachines( String[] virtualMachineIds, EC2InstanceFilterSet ifs,
-            List<CloudStackKeyValue> resourceTags ) throws Exception 
+            List<CloudStackKeyValue> resourceTags ) throws Exception
             {
         EC2DescribeInstancesResponse instances = new EC2DescribeInstancesResponse();
 
@@ -1653,10 +1666,10 @@ public class EC2Engine extends ManagerBase {
 
         if ( null == ifs )
             return instances;
-        else return ifs.evaluate( instances );     
+        else return ifs.evaluate( instances );
             }
 
-    /**  
+    /**
      * Get one or more templates depending on the volumeId parameter.
      * 
      * @param volumeId   - if interested in one specific volume, null if want to list all volumes
@@ -1714,7 +1727,7 @@ public class EC2Engine extends ManagerBase {
     }
 
     /**
-     * Translate the given zone name into the required zoneId.  Query for 
+     * Translate the given zone name into the required zoneId.  Query for
      * a list of all zones and match the zone name given.   Amazon uses zone
      * names while the Cloud API often requires the zoneId.
      * 
@@ -1768,7 +1781,7 @@ public class EC2Engine extends ManagerBase {
      * 
      * @param serviceOfferingId
      * @return A valid value for the Amazon defined instanceType
-     * @throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException 
+     * @throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException
      */
     private String serviceOfferingIdToInstanceType( String serviceOfferingId ) throws Exception {
         try{
@@ -1787,13 +1800,13 @@ public class EC2Engine extends ManagerBase {
     }
 
     /**
-     * Match the value in the 'description' field of the listOsTypes response to get 
+     * Match the value in the 'description' field of the listOsTypes response to get
      * the osTypeId.
      * 
      * @param osTypeName
-     * @return the Cloud.com API osTypeId 
+     * @return the Cloud.com API osTypeId
      */
-    private String toOSTypeId( String osTypeName ) throws Exception { 
+    private String toOSTypeId( String osTypeName ) throws Exception {
         try {
             List<CloudStackOsType> osTypes = getApi().listOsTypes(null, null, null);
             for (CloudStackOsType osType : osTypes) {
@@ -1924,7 +1937,7 @@ public class EC2Engine extends ManagerBase {
     }
 
 
-    /**  
+    /**
      * Get one or more templates depending on the templateId parameter.
      * 
      * @param templateId - if null then return information on all existing templates, otherwise
@@ -1939,12 +1952,12 @@ public class EC2Engine extends ManagerBase {
             List<CloudStackTemplate> result = new ArrayList<CloudStackTemplate>();
 
             if(templateId != null){
-                List<CloudStackTemplate> template = getApi().listTemplates("executable", null, null, null, templateId , null, null, null); 
+                List<CloudStackTemplate> template = getApi().listTemplates("executable", null, null, null, templateId , null, null, null);
                 if(template != null){
                     result.addAll(template);
                 }
             }else{
-                List<CloudStackTemplate> selfExecutable = getApi().listTemplates("selfexecutable", null, null, null, null, null, null, null); 
+                List<CloudStackTemplate> selfExecutable = getApi().listTemplates("selfexecutable", null, null, null, null, null, null, null);
                 if(selfExecutable != null){
                     result.addAll(selfExecutable);
                 }
@@ -2214,7 +2227,7 @@ public class EC2Engine extends ManagerBase {
     public CloudStackAccount getCurrentAccount() throws Exception {
         if (currentAccount != null) {
             // verify this is the same account!!!
-            for (CloudStackUser user : currentAccount.getUser()) { 
+            for (CloudStackUser user : currentAccount.getUser()) {
                 if (user.getSecretkey() != null && user.getSecretkey().equalsIgnoreCase(UserContext.current().getSecretKey())) {
                     return currentAccount;
                 }
@@ -2247,7 +2260,7 @@ public class EC2Engine extends ManagerBase {
         List<CloudStackNetwork> networks = getApi().listNetworks(null, null, null, null, null, null, null, null, null, zoneId);
         List<CloudStackNetwork> netWithSecGroup = new ArrayList<CloudStackNetwork>();
         for (CloudStackNetwork network : networks ) {
-            if (!network.getNetworkOfferingAvailability().equalsIgnoreCase("unavailable") && network.getSecurityGroupEnabled()) 
+            if (!network.getNetworkOfferingAvailability().equalsIgnoreCase("unavailable") && network.getSecurityGroupEnabled())
                 netWithSecGroup.add(network);
         }
         // we'll take the first one
@@ -2255,7 +2268,7 @@ public class EC2Engine extends ManagerBase {
     }
 
     /**
-     * Create a network 
+     * Create a network
      * 
      * @param zoneId
      * @param offering
@@ -2264,7 +2277,7 @@ public class EC2Engine extends ManagerBase {
      * @throws Exception
      */
     private CloudStackNetwork createDefaultGuestNetwork(String zoneId, CloudStackNetworkOffering offering, CloudStackAccount owner) throws Exception {
-        return getApi().createNetwork(owner.getName() + "-network", owner.getName() + "-network",  offering.getId(), zoneId, owner.getName(), 
+        return getApi().createNetwork(owner.getName() + "-network", owner.getName() + "-network",  offering.getId(), zoneId, owner.getName(),
                 owner.getDomainId(), true, null, null, null, null, null, null, null, null);
     }
 
@@ -2288,24 +2301,24 @@ public class EC2Engine extends ManagerBase {
             if (networks != null && !networks.isEmpty()) {
                 //pick up the first required network from the network list
                 for (CloudStackNetwork network : networks)  {
-                    for (CloudStackNetworkOffering requiredOffering : reuquiredOfferings) { 
+                    for (CloudStackNetworkOffering requiredOffering : reuquiredOfferings) {
                         logger.debug("[reqd/virtual} offering: " + requiredOffering.getId() + " network " + network.getNetworkOfferingId());
                         if (network.getNetworkOfferingId().equals(requiredOffering.getId())) {
                             return network;
-                        }                
-                    } 
-                } 
+                        }
+                    }
+                }
             } else {
                 //create new network and return it
                 return createDefaultGuestNetwork(zoneId, reuquiredOfferings.get(0), caller);
             }
         } else {
-            //find all optional network offerings in the system 
+            //find all optional network offerings in the system
             List<CloudStackNetworkOffering> optionalOfferings = getApi().listNetworkOfferings("Optional", null, null, null, true, null, null, null, null, null, zoneId);
             if (optionalOfferings != null && !optionalOfferings.isEmpty()) {
                 if (networks != null && !networks.isEmpty()) {
                     for (CloudStackNetwork network : networks) {
-                        for (CloudStackNetworkOffering optionalOffering : optionalOfferings) { 
+                        for (CloudStackNetworkOffering optionalOffering : optionalOfferings) {
                             logger.debug("[optional] offering: " + optionalOffering.getId() + " network " + network.getNetworkOfferingId());
                             if (network.getNetworkOfferingId().equals(optionalOffering.getId())) {
                                 return network;
@@ -2338,7 +2351,7 @@ public class EC2Engine extends ManagerBase {
             return getNetworksWithSecurityGroupEnabled(zone.getId());
 
         } else {
-            return getNetworksWithoutSecurityGroupEnabled(zone.getId()); 
+            return getNetworksWithoutSecurityGroupEnabled(zone.getId());
         }
     }
 
@@ -2413,40 +2426,40 @@ public class EC2Engine extends ManagerBase {
 
 
     /**
-     * Translate the device name string into a Cloud Stack deviceId.   
+     * Translate the device name string into a Cloud Stack deviceId.
      * deviceId 3 is reserved for CDROM and 0 for the ROOT disk
      * 
      * @param device string
      * @return deviceId value
      */
-    private String mapDeviceToCloudDeviceId( String device ) throws Exception 
-    {	
+    private String mapDeviceToCloudDeviceId( String device ) throws Exception
+    {
         if (device.equalsIgnoreCase( "/dev/sdb"  )) return "1";
-        else if (device.equalsIgnoreCase( "/dev/sdc"  )) return "2"; 
-        else if (device.equalsIgnoreCase( "/dev/sde"  )) return "4"; 
-        else if (device.equalsIgnoreCase( "/dev/sdf"  )) return "5"; 
-        else if (device.equalsIgnoreCase( "/dev/sdg"  )) return "6"; 
-        else if (device.equalsIgnoreCase( "/dev/sdh"  )) return "7"; 
-        else if (device.equalsIgnoreCase( "/dev/sdi"  )) return "8"; 
-        else if (device.equalsIgnoreCase( "/dev/sdj"  )) return "9"; 
-
-        else if (device.equalsIgnoreCase( "/dev/xvdb" )) return "1";  
-        else if (device.equalsIgnoreCase( "/dev/xvdc" )) return "2";  
-        else if (device.equalsIgnoreCase( "/dev/xvde" )) return "4";  
-        else if (device.equalsIgnoreCase( "/dev/xvdf" )) return "5";  
-        else if (device.equalsIgnoreCase( "/dev/xvdg" )) return "6";  
-        else if (device.equalsIgnoreCase( "/dev/xvdh" )) return "7";  
-        else if (device.equalsIgnoreCase( "/dev/xvdi" )) return "8";  
-        else if (device.equalsIgnoreCase( "/dev/xvdj" )) return "9";  
-
-        else if (device.equalsIgnoreCase( "xvdb"      )) return "1";  
-        else if (device.equalsIgnoreCase( "xvdc"      )) return "2";  
-        else if (device.equalsIgnoreCase( "xvde"      )) return "4";  
-        else if (device.equalsIgnoreCase( "xvdf"      )) return "5";  
-        else if (device.equalsIgnoreCase( "xvdg"      )) return "6";  
-        else if (device.equalsIgnoreCase( "xvdh"      )) return "7";  
-        else if (device.equalsIgnoreCase( "xvdi"      )) return "8";  
-        else if (device.equalsIgnoreCase( "xvdj"      )) return "9";  
+        else if (device.equalsIgnoreCase( "/dev/sdc"  )) return "2";
+        else if (device.equalsIgnoreCase( "/dev/sde"  )) return "4";
+        else if (device.equalsIgnoreCase( "/dev/sdf"  )) return "5";
+        else if (device.equalsIgnoreCase( "/dev/sdg"  )) return "6";
+        else if (device.equalsIgnoreCase( "/dev/sdh"  )) return "7";
+        else if (device.equalsIgnoreCase( "/dev/sdi"  )) return "8";
+        else if (device.equalsIgnoreCase( "/dev/sdj"  )) return "9";
+
+        else if (device.equalsIgnoreCase( "/dev/xvdb" )) return "1";
+        else if (device.equalsIgnoreCase( "/dev/xvdc" )) return "2";
+        else if (device.equalsIgnoreCase( "/dev/xvde" )) return "4";
+        else if (device.equalsIgnoreCase( "/dev/xvdf" )) return "5";
+        else if (device.equalsIgnoreCase( "/dev/xvdg" )) return "6";
+        else if (device.equalsIgnoreCase( "/dev/xvdh" )) return "7";
+        else if (device.equalsIgnoreCase( "/dev/xvdi" )) return "8";
+        else if (device.equalsIgnoreCase( "/dev/xvdj" )) return "9";
+
+        else if (device.equalsIgnoreCase( "xvdb"      )) return "1";
+        else if (device.equalsIgnoreCase( "xvdc"      )) return "2";
+        else if (device.equalsIgnoreCase( "xvde"      )) return "4";
+        else if (device.equalsIgnoreCase( "xvdf"      )) return "5";
+        else if (device.equalsIgnoreCase( "xvdg"      )) return "6";
+        else if (device.equalsIgnoreCase( "xvdh"      )) return "7";
+        else if (device.equalsIgnoreCase( "xvdi"      )) return "8";
+        else if (device.equalsIgnoreCase( "xvdj"      )) return "9";
 
         else throw new Exception("Device is not supported");
     }
@@ -2457,7 +2470,7 @@ public class EC2Engine extends ManagerBase {
      * @param state
      * @return
      */
-    private String mapToAmazonVolState( String state ) 
+    private String mapToAmazonVolState( String state )
     {
         if (state.equalsIgnoreCase( "Allocated" ) ||
                 state.equalsIgnoreCase( "Creating"  ) ||
@@ -2465,7 +2478,7 @@ public class EC2Engine extends ManagerBase {
 
         if (state.equalsIgnoreCase( "Destroy"   )) return "deleting";
 
-        return "error"; 
+        return "error";
     }
 
     /**
@@ -2554,7 +2567,7 @@ public class EC2Engine extends ManagerBase {
 
     /**
      * Start an existing stopped instance(VM)
-     *  
+     * 
      * @param instanceId
      * @return
      * @throws Exception
@@ -2574,10 +2587,10 @@ public class EC2Engine extends ManagerBase {
     /**
      * Cloud Stack API takes a comma separated list as a parameter.
      * 
-     * @throws UnsupportedEncodingException 
+     * @throws UnsupportedEncodingException
      */
     private String constructList( String[] elements ) throws UnsupportedEncodingException {
-        if (null == elements || 0 == elements.length) return null;  	
+        if (null == elements || 0 == elements.length) return null;
         StringBuffer elementList = new StringBuffer();
 
         for( int i=0; i < elements.length; i++ ) {
@@ -2787,7 +2800,7 @@ public class EC2Engine extends ManagerBase {
                             "Not enough available addresses to satisfy your minimum request");
                 } else {
                     throw new EC2ServiceException( ServerError.InternalError, "There is insufficient capacity");
-                } 
+                }
             } else if (errorCode == 401) {
                 if ( errorMessage.contains("Unauthorized") ) {
                     throw new EC2ServiceException(ClientError.AuthFailure, "User not authorised");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/135b688a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstances.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstances.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstances.java
index e3735b5..9029faf 100644
--- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstances.java
+++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2RunInstances.java
@@ -30,7 +30,8 @@ public class EC2RunInstances {
 	private int    maxCount;
 	private int    minCount;
     private Integer    size;  		// <- in gigs
-    private List<String> groupSet = new ArrayList<String>();
+    private List<String>  groupIdSet;
+    private List<String>  groupNameSet;
 	
 	public EC2RunInstances() {
 		instanceType = null;
@@ -42,6 +43,8 @@ public class EC2RunInstances {
 		maxCount     = 0;
 		minCount     = 0;
 		size		 = 0;
+        groupIdSet   = new ArrayList<String>();
+        groupNameSet = new ArrayList<String>();
 	}
 	
 	public void setInstanceType( String instanceType ) {
@@ -115,12 +118,21 @@ public class EC2RunInstances {
 	public void setSize(Integer size) {
 		this.size = size;
 	}
-	
-    public void addGroupName( String param ) {
-        groupSet.add( param );
+
+    public void addSecuritGroupId( String param ) {
+        groupIdSet.add( param );
     }
 		
-    public String[] getGroupSet() {
-        return groupSet.toArray(new String[0]);
+    public String[] getSecurityGroupIdSet() {
+        return groupIdSet.toArray(new String[0]);
+    }
+
+	public void addSecuritGroupName( String param ) {
+        groupNameSet.add( param );
     }
+		
+    public String[] getSecurityGroupNameSet() {
+        return groupNameSet.toArray(new String[0]);
+    }
+
 }


Mime
View raw message