camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [2/3] camel git commit: CAMEL-8882: Camel-AWS EC2: Add options to Run Instance command, add clientToken header
Date Thu, 18 Jun 2015 15:36:37 GMT
CAMEL-8882: Camel-AWS EC2: Add options to Run Instance command, add clientToken header


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

Branch: refs/heads/master
Commit: 23275028a45a146143401b0074a438fd9d3feda1
Parents: 409a039
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Thu Jun 18 11:18:57 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    | 5 +++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/23275028/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 c0e95dc..8b30166 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
@@ -33,4 +33,5 @@ public interface EC2Constants {
     String INSTANCE_SECURITY_GROUPS = "CamelAwsEC2InstanceSecurityGroups";
     String INSTANCES_IDS            = "CamelAwsEC2InstancesIds";
     String INSTANCES_KEY_PAIR       = "CamelAwsEC2InstancesKeyPair";
+    String INSTANCES_CLIENT_TOKEN   = "CamelAwsEC2InstancesClientToken";
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/23275028/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 dff573d..2256161 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
@@ -125,6 +125,7 @@ public class EC2Producer extends DefaultProducer {
         boolean ebsOptimized;
         Collection securityGroups;
         String keyName;
+        String clientToken;
         RunInstancesRequest request = new RunInstancesRequest();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EC2Constants.IMAGE_ID))) {
             ami = exchange.getIn().getHeader(EC2Constants.IMAGE_ID, String.class);
@@ -170,6 +171,10 @@ public class EC2Producer extends DefaultProducer {
             keyName = exchange.getIn().getHeader(EC2Constants.INSTANCES_KEY_PAIR, String.class);
             request.withKeyName(keyName);
         }
+        if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EC2Constants.INSTANCES_CLIENT_TOKEN)))
{
+            clientToken = exchange.getIn().getHeader(EC2Constants.INSTANCES_CLIENT_TOKEN,
String.class);
+            request.withClientToken(clientToken);
+        }
         RunInstancesResult result;
         try {
             result = ec2Client.runInstances(request);


Mime
View raw message