camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [1/3] camel git commit: CAMEL-8882: Camel-AWS EC2: Add options to Run Instance command, add Placement header
Date Thu, 18 Jun 2015 15:36:36 GMT
Repository: camel
Updated Branches:
  refs/heads/master fc38b2e67 -> ce5c0873e


CAMEL-8882: Camel-AWS EC2: Add options to Run Instance command, add Placement header


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

Branch: refs/heads/master
Commit: ce5c0873ed116f436760d2ecf7b9a8452e39faa5
Parents: 2327502
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Thu Jun 18 11:22:29 2015 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Thu Jun 18 17:33:22 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/component/aws/ec2/EC2Constants.java  | 1 +
 .../java/org/apache/camel/component/aws/ec2/EC2Producer.java   | 6 ++++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ce5c0873/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Constants.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Constants.java
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Constants.java
index 8b30166..0a863bf 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Constants.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Constants.java
@@ -34,4 +34,5 @@ public interface EC2Constants {
     String INSTANCES_IDS            = "CamelAwsEC2InstancesIds";
     String INSTANCES_KEY_PAIR       = "CamelAwsEC2InstancesKeyPair";
     String INSTANCES_CLIENT_TOKEN   = "CamelAwsEC2InstancesClientToken";
+    String INSTANCES_PLACEMENT      = "CamelAwsEC2InstancesPlacement";
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/ce5c0873/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Producer.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Producer.java
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Producer.java
index 2256161..2d5681d 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Producer.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/ec2/EC2Producer.java
@@ -27,6 +27,7 @@ import com.amazonaws.services.ec2.model.DescribeInstancesResult;
 import com.amazonaws.services.ec2.model.InstanceType;
 import com.amazonaws.services.ec2.model.MonitorInstancesRequest;
 import com.amazonaws.services.ec2.model.MonitorInstancesResult;
+import com.amazonaws.services.ec2.model.Placement;
 import com.amazonaws.services.ec2.model.RebootInstancesRequest;
 import com.amazonaws.services.ec2.model.RunInstancesRequest;
 import com.amazonaws.services.ec2.model.RunInstancesResult;
@@ -126,6 +127,7 @@ public class EC2Producer extends DefaultProducer {
         Collection securityGroups;
         String keyName;
         String clientToken;
+        Placement placement;
         RunInstancesRequest request = new RunInstancesRequest();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EC2Constants.IMAGE_ID))) {
             ami = exchange.getIn().getHeader(EC2Constants.IMAGE_ID, String.class);
@@ -175,6 +177,10 @@ public class EC2Producer extends DefaultProducer {
             clientToken = exchange.getIn().getHeader(EC2Constants.INSTANCES_CLIENT_TOKEN,
String.class);
             request.withClientToken(clientToken);
         }
+        if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EC2Constants.INSTANCES_PLACEMENT)))
{
+            placement = exchange.getIn().getHeader(EC2Constants.INSTANCES_PLACEMENT, Placement.class);
+            request.withPlacement(placement);
+        }
         RunInstancesResult result;
         try {
             result = ec2Client.runInstances(request);


Mime
View raw message