You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/04/10 11:07:55 UTC

[camel] branch master updated (b3ac8c8 -> 948f5e7)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from b3ac8c8  Merge pull request #3728 from claudiohigashi/patch-2
     new d2cf3cc  CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks list Clusters
     new e7afeea  CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks more operations
     new 782dfdf  CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks delete cluster
     new 634e4da  CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks fixed CS
     new 68cfe1e  CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks regen
     new 948f5e7  Regen docs

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../aws2/eks/EKS2ComponentConfigurer.java          |   5 +
 .../component/aws2/eks/EKS2EndpointConfigurer.java |   5 +
 .../apache/camel/component/aws2/eks/aws2-eks.json  |   2 +
 .../src/main/docs/aws2-eks-component.adoc          |   6 +-
 .../component/aws2/eks/EKS2Configuration.java      |  13 ++
 .../camel/component/aws2/eks/EKS2Producer.java     | 193 ++++++++++++++-------
 .../dsl/Aws2EksComponentBuilderFactory.java        |  13 ++
 .../src/generated/resources/metadata.json          |   2 +-
 .../endpoint/dsl/EKS2EndpointBuilderFactory.java   |  24 +++
 .../modules/ROOT/pages/aws2-eks-component.adoc     |   6 +-
 10 files changed, 198 insertions(+), 71 deletions(-)


[camel] 04/06: CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks fixed CS

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 634e4da6464c11d366e0d293c13f7ad5e8d6f66b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 10 13:03:18 2020 +0200

    CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks fixed CS
---
 .../camel/component/aws2/eks/EKS2Producer.java     | 144 ++++++++++-----------
 1 file changed, 72 insertions(+), 72 deletions(-)

diff --git a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
index 9c4396c..6aed2a7 100644
--- a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
+++ b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
@@ -101,7 +101,7 @@ public class EKS2Producer extends DefaultProducer {
             if (payload instanceof ListClustersRequest) {
                 ListClustersResponse result;
                 try {
-                    result = eksClient.listClusters((ListClustersRequest) payload);
+                    result = eksClient.listClusters((ListClustersRequest)payload);
                 } catch (AwsServiceException ase) {
                     LOG.trace("List Clusters command returned the error code {}", ase.awsErrorDetails().errorCode());
                     throw ase;
@@ -110,20 +110,20 @@ public class EKS2Producer extends DefaultProducer {
                 message.setBody(result);
             }
         } else {
-        ListClustersRequest.Builder builder = ListClustersRequest.builder();
-        if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.MAX_RESULTS))) {
-            int maxRes = exchange.getIn().getHeader(EKS2Constants.MAX_RESULTS, Integer.class);
-            builder.maxResults(maxRes);
-        }
-        ListClustersResponse result;
-        try {
-            result = eksClient.listClusters(builder.build());
-        } catch (AwsServiceException ase) {
-            LOG.trace("List Clusters command returned the error code {}", ase.awsErrorDetails().errorCode());
-            throw ase;
-        }
-        Message message = getMessageForResponse(exchange);
-        message.setBody(result);
+            ListClustersRequest.Builder builder = ListClustersRequest.builder();
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.MAX_RESULTS))) {
+                int maxRes = exchange.getIn().getHeader(EKS2Constants.MAX_RESULTS, Integer.class);
+                builder.maxResults(maxRes);
+            }
+            ListClustersResponse result;
+            try {
+                result = eksClient.listClusters(builder.build());
+            } catch (AwsServiceException ase) {
+                LOG.trace("List Clusters command returned the error code {}", ase.awsErrorDetails().errorCode());
+                throw ase;
+            }
+            Message message = getMessageForResponse(exchange);
+            message.setBody(result);
         }
     }
 
@@ -133,7 +133,7 @@ public class EKS2Producer extends DefaultProducer {
             if (payload instanceof CreateClusterRequest) {
                 CreateClusterResponse result;
                 try {
-                    result = eksClient.createCluster((CreateClusterRequest) payload);
+                    result = eksClient.createCluster((CreateClusterRequest)payload);
                 } catch (AwsServiceException ase) {
                     LOG.trace("Create Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
                     throw ase;
@@ -142,28 +142,28 @@ public class EKS2Producer extends DefaultProducer {
                 message.setBody(result);
             }
         } else {
-        CreateClusterRequest.Builder builder = CreateClusterRequest.builder();
-        if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME))) {
-            String name = exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME, String.class);
-            builder.name(name);
-        }
-        if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.ROLE_ARN))) {
-            String roleArn = exchange.getIn().getHeader(EKS2Constants.ROLE_ARN, String.class);
-            builder.roleArn(roleArn);
-        }
-        if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.VPC_CONFIG))) {
-            VpcConfigRequest vpcConfig = exchange.getIn().getHeader(EKS2Constants.VPC_CONFIG, VpcConfigRequest.class);
-            builder.resourcesVpcConfig(vpcConfig);
-        }
-        CreateClusterResponse result;
-        try {
-            result = eksClient.createCluster(builder.build());
-        } catch (AwsServiceException ase) {
-            LOG.trace("Create Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
-            throw ase;
-        }
-        Message message = getMessageForResponse(exchange);
-        message.setBody(result);
+            CreateClusterRequest.Builder builder = CreateClusterRequest.builder();
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME))) {
+                String name = exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME, String.class);
+                builder.name(name);
+            }
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.ROLE_ARN))) {
+                String roleArn = exchange.getIn().getHeader(EKS2Constants.ROLE_ARN, String.class);
+                builder.roleArn(roleArn);
+            }
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.VPC_CONFIG))) {
+                VpcConfigRequest vpcConfig = exchange.getIn().getHeader(EKS2Constants.VPC_CONFIG, VpcConfigRequest.class);
+                builder.resourcesVpcConfig(vpcConfig);
+            }
+            CreateClusterResponse result;
+            try {
+                result = eksClient.createCluster(builder.build());
+            } catch (AwsServiceException ase) {
+                LOG.trace("Create Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
+                throw ase;
+            }
+            Message message = getMessageForResponse(exchange);
+            message.setBody(result);
         }
     }
 
@@ -173,7 +173,7 @@ public class EKS2Producer extends DefaultProducer {
             if (payload instanceof DescribeClusterRequest) {
                 DescribeClusterResponse result;
                 try {
-                    result = eksClient.describeCluster((DescribeClusterRequest) payload);
+                    result = eksClient.describeCluster((DescribeClusterRequest)payload);
                 } catch (AwsServiceException ase) {
                     LOG.trace("Describe Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
                     throw ase;
@@ -182,22 +182,22 @@ public class EKS2Producer extends DefaultProducer {
                 message.setBody(result);
             }
         } else {
-        DescribeClusterRequest.Builder builder = DescribeClusterRequest.builder();
-        if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME))) {
-            String name = exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME, String.class);
-            builder.name(name);
-        } else {
-            throw new IllegalArgumentException("Cluster name must be specified");
-        }
-        DescribeClusterResponse result;
-        try {
-            result = eksClient.describeCluster(builder.build());
-        } catch (AwsServiceException ase) {
-            LOG.trace("Describe Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
-            throw ase;
-        }
-        Message message = getMessageForResponse(exchange);
-        message.setBody(result);
+            DescribeClusterRequest.Builder builder = DescribeClusterRequest.builder();
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME))) {
+                String name = exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME, String.class);
+                builder.name(name);
+            } else {
+                throw new IllegalArgumentException("Cluster name must be specified");
+            }
+            DescribeClusterResponse result;
+            try {
+                result = eksClient.describeCluster(builder.build());
+            } catch (AwsServiceException ase) {
+                LOG.trace("Describe Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
+                throw ase;
+            }
+            Message message = getMessageForResponse(exchange);
+            message.setBody(result);
         }
     }
 
@@ -207,7 +207,7 @@ public class EKS2Producer extends DefaultProducer {
             if (payload instanceof DeleteClusterRequest) {
                 DeleteClusterResponse result;
                 try {
-                    result = eksClient.deleteCluster((DeleteClusterRequest) payload);
+                    result = eksClient.deleteCluster((DeleteClusterRequest)payload);
                 } catch (AwsServiceException ase) {
                     LOG.trace("Delete Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
                     throw ase;
@@ -216,22 +216,22 @@ public class EKS2Producer extends DefaultProducer {
                 message.setBody(result);
             }
         } else {
-        DeleteClusterRequest.Builder builder = DeleteClusterRequest.builder();
-        if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME))) {
-            String name = exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME, String.class);
-            builder.name(name);
-        } else {
-            throw new IllegalArgumentException("Cluster name must be specified");
-        }
-        DeleteClusterResponse result;
-        try {
-            result = eksClient.deleteCluster(builder.build());
-        } catch (AwsServiceException ase) {
-            LOG.trace("Delete Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
-            throw ase;
-        }
-        Message message = getMessageForResponse(exchange);
-        message.setBody(result);
+            DeleteClusterRequest.Builder builder = DeleteClusterRequest.builder();
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME))) {
+                String name = exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME, String.class);
+                builder.name(name);
+            } else {
+                throw new IllegalArgumentException("Cluster name must be specified");
+            }
+            DeleteClusterResponse result;
+            try {
+                result = eksClient.deleteCluster(builder.build());
+            } catch (AwsServiceException ase) {
+                LOG.trace("Delete Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
+                throw ase;
+            }
+            Message message = getMessageForResponse(exchange);
+            message.setBody(result);
         }
     }
 


[camel] 02/06: CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks more operations

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit e7afeeaa66ceb1306fe1982c606907e90c230e3d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 10 12:55:05 2020 +0200

    CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks more operations
---
 .../camel/component/aws2/eks/EKS2Producer.java     | 34 ++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
index e2cd44f..69c3358 100644
--- a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
+++ b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
@@ -127,7 +127,21 @@ public class EKS2Producer extends DefaultProducer {
         }
     }
 
-    private void createCluster(EksClient eksClient, Exchange exchange) {
+    private void createCluster(EksClient eksClient, Exchange exchange) throws InvalidPayloadException {
+        if (getConfiguration().isPojoRequest()) {
+            Object payload = exchange.getIn().getMandatoryBody();
+            if (payload instanceof CreateClusterRequest) {
+                CreateClusterResponse result;
+                try {
+                    result = eksClient.createCluster((CreateClusterRequest) payload);
+                } catch (AwsServiceException ase) {
+                    LOG.trace("Create Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
+                    throw ase;
+                }
+                Message message = getMessageForResponse(exchange);
+                message.setBody(result);
+            }
+        } else {
         CreateClusterRequest.Builder builder = CreateClusterRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME))) {
             String name = exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME, String.class);
@@ -150,9 +164,24 @@ public class EKS2Producer extends DefaultProducer {
         }
         Message message = getMessageForResponse(exchange);
         message.setBody(result);
+        }
     }
 
-    private void describeCluster(EksClient eksClient, Exchange exchange) {
+    private void describeCluster(EksClient eksClient, Exchange exchange) throws InvalidPayloadException {
+        if (getConfiguration().isPojoRequest()) {
+            Object payload = exchange.getIn().getMandatoryBody();
+            if (payload instanceof DescribeClusterRequest) {
+                DescribeClusterResponse result;
+                try {
+                    result = eksClient.describeCluster((DescribeClusterRequest) payload);
+                } catch (AwsServiceException ase) {
+                    LOG.trace("Describe Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
+                    throw ase;
+                }
+                Message message = getMessageForResponse(exchange);
+                message.setBody(result);
+            }
+        } else {
         DescribeClusterRequest.Builder builder = DescribeClusterRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME))) {
             String name = exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME, String.class);
@@ -169,6 +198,7 @@ public class EKS2Producer extends DefaultProducer {
         }
         Message message = getMessageForResponse(exchange);
         message.setBody(result);
+        }
     }
 
     private void deleteCluster(EksClient eksClient, Exchange exchange) {


[camel] 06/06: Regen docs

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 948f5e72bfa12770708042c598843f15fc7dba7d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 10 13:06:50 2020 +0200

    Regen docs
---
 docs/components/modules/ROOT/pages/aws2-eks-component.adoc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/components/modules/ROOT/pages/aws2-eks-component.adoc b/docs/components/modules/ROOT/pages/aws2-eks-component.adoc
index 1a11d4e..cdbf096 100644
--- a/docs/components/modules/ROOT/pages/aws2-eks-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-eks-component.adoc
@@ -39,7 +39,7 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 EKS component supports 11 options, which are listed below.
+The AWS 2 EKS component supports 12 options, which are listed below.
 
 
 
@@ -50,6 +50,7 @@ The AWS 2 EKS component supports 11 options, which are listed below.
 | *eksClient* (producer) | To use a existing configured AWS EKS as client |  | EksClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. The value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | EKS2Operations
+| *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the EKS client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the EKS client |  | Integer
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the EKS client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
@@ -82,7 +83,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (11 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -91,6 +92,7 @@ with the following path and query parameters:
 | *eksClient* (producer) | To use a existing configured AWS EKS as client |  | EksClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. The value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | EKS2Operations
+| *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the EKS client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the EKS client |  | Integer
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the EKS client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol


[camel] 05/06: CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks regen

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 68cfe1e070556b6442130e18ac1064fbbff79efa
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 10 13:04:26 2020 +0200

    CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks regen
---
 .../aws2/eks/EKS2ComponentConfigurer.java          |  5 +++++
 .../component/aws2/eks/EKS2EndpointConfigurer.java |  5 +++++
 .../apache/camel/component/aws2/eks/aws2-eks.json  |  2 ++
 .../src/main/docs/aws2-eks-component.adoc          |  6 ++++--
 .../dsl/Aws2EksComponentBuilderFactory.java        | 13 ++++++++++++
 .../src/generated/resources/metadata.json          |  2 +-
 .../endpoint/dsl/EKS2EndpointBuilderFactory.java   | 24 ++++++++++++++++++++++
 7 files changed, 54 insertions(+), 3 deletions(-)

diff --git a/components/camel-aws2-eks/src/generated/java/org/apache/camel/component/aws2/eks/EKS2ComponentConfigurer.java b/components/camel-aws2-eks/src/generated/java/org/apache/camel/component/aws2/eks/EKS2ComponentConfigurer.java
index c9ec167..25b50f9 100644
--- a/components/camel-aws2-eks/src/generated/java/org/apache/camel/component/aws2/eks/EKS2ComponentConfigurer.java
+++ b/components/camel-aws2-eks/src/generated/java/org/apache/camel/component/aws2/eks/EKS2ComponentConfigurer.java
@@ -36,6 +36,8 @@ public class EKS2ComponentConfigurer extends PropertyConfigurerSupport implement
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.aws2.eks.EKS2Operations.class, value)); return true;
+        case "pojorequest":
+        case "pojoRequest": getOrCreateConfiguration(target).setPojoRequest(property(camelContext, boolean.class, value)); return true;
         case "proxyhost":
         case "proxyHost": getOrCreateConfiguration(target).setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
         case "proxyport":
@@ -58,6 +60,7 @@ public class EKS2ComponentConfigurer extends PropertyConfigurerSupport implement
         answer.put("eksClient", software.amazon.awssdk.services.eks.EksClient.class);
         answer.put("lazyStartProducer", boolean.class);
         answer.put("operation", org.apache.camel.component.aws2.eks.EKS2Operations.class);
+        answer.put("pojoRequest", boolean.class);
         answer.put("proxyHost", java.lang.String.class);
         answer.put("proxyPort", java.lang.Integer.class);
         answer.put("proxyProtocol", software.amazon.awssdk.core.Protocol.class);
@@ -80,6 +83,8 @@ public class EKS2ComponentConfigurer extends PropertyConfigurerSupport implement
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "operation": return getOrCreateConfiguration(target).getOperation();
+        case "pojorequest":
+        case "pojoRequest": return getOrCreateConfiguration(target).isPojoRequest();
         case "proxyhost":
         case "proxyHost": return getOrCreateConfiguration(target).getProxyHost();
         case "proxyport":
diff --git a/components/camel-aws2-eks/src/generated/java/org/apache/camel/component/aws2/eks/EKS2EndpointConfigurer.java b/components/camel-aws2-eks/src/generated/java/org/apache/camel/component/aws2/eks/EKS2EndpointConfigurer.java
index fcf1b56..28b08ee 100644
--- a/components/camel-aws2-eks/src/generated/java/org/apache/camel/component/aws2/eks/EKS2EndpointConfigurer.java
+++ b/components/camel-aws2-eks/src/generated/java/org/apache/camel/component/aws2/eks/EKS2EndpointConfigurer.java
@@ -28,6 +28,8 @@ public class EKS2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "lazystartproducer":
         case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
         case "operation": target.getConfiguration().setOperation(property(camelContext, org.apache.camel.component.aws2.eks.EKS2Operations.class, value)); return true;
+        case "pojorequest":
+        case "pojoRequest": target.getConfiguration().setPojoRequest(property(camelContext, boolean.class, value)); return true;
         case "proxyhost":
         case "proxyHost": target.getConfiguration().setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
         case "proxyport":
@@ -50,6 +52,7 @@ public class EKS2EndpointConfigurer extends PropertyConfigurerSupport implements
         answer.put("eksClient", software.amazon.awssdk.services.eks.EksClient.class);
         answer.put("lazyStartProducer", boolean.class);
         answer.put("operation", org.apache.camel.component.aws2.eks.EKS2Operations.class);
+        answer.put("pojoRequest", boolean.class);
         answer.put("proxyHost", java.lang.String.class);
         answer.put("proxyPort", java.lang.Integer.class);
         answer.put("proxyProtocol", software.amazon.awssdk.core.Protocol.class);
@@ -72,6 +75,8 @@ public class EKS2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
         case "operation": return target.getConfiguration().getOperation();
+        case "pojorequest":
+        case "pojoRequest": return target.getConfiguration().isPojoRequest();
         case "proxyhost":
         case "proxyHost": return target.getConfiguration().getProxyHost();
         case "proxyport":
diff --git a/components/camel-aws2-eks/src/generated/resources/org/apache/camel/component/aws2/eks/aws2-eks.json b/components/camel-aws2-eks/src/generated/resources/org/apache/camel/component/aws2/eks/aws2-eks.json
index 9f856f2..5fcc075 100644
--- a/components/camel-aws2-eks/src/generated/resources/org/apache/camel/component/aws2/eks/aws2-eks.json
+++ b/components/camel-aws2-eks/src/generated/resources/org/apache/camel/component/aws2/eks/aws2-eks.json
@@ -25,6 +25,7 @@
     "eksClient": { "kind": "property", "displayName": "Eks Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.eks.EksClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS EKS as client" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the r [...]
     "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eks.EKS2Operations", "enum": [ "listClusters", "describeCluster", "createCluster", "deleteCluster" ], "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "The operation [...]
+    "pojoRequest": { "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the EKS client" },
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the EKS client" },
     "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the EKS client" },
@@ -38,6 +39,7 @@
     "eksClient": { "kind": "parameter", "displayName": "Eks Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.eks.EksClient", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS EKS as client" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the  [...]
     "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.eks.EKS2Operations", "enum": [ "listClusters", "describeCluster", "createCluster", "deleteCluster" ], "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "The operatio [...]
+    "pojoRequest": { "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the EKS client" },
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the EKS client" },
     "proxyProtocol": { "kind": "parameter", "displayName": "Proxy Protocol", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.eks.EKS2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating the EKS client" },
diff --git a/components/camel-aws2-eks/src/main/docs/aws2-eks-component.adoc b/components/camel-aws2-eks/src/main/docs/aws2-eks-component.adoc
index a8cd204..12d2a5e 100644
--- a/components/camel-aws2-eks/src/main/docs/aws2-eks-component.adoc
+++ b/components/camel-aws2-eks/src/main/docs/aws2-eks-component.adoc
@@ -38,7 +38,7 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 EKS component supports 11 options, which are listed below.
+The AWS 2 EKS component supports 12 options, which are listed below.
 
 
 
@@ -49,6 +49,7 @@ The AWS 2 EKS component supports 11 options, which are listed below.
 | *eksClient* (producer) | To use a existing configured AWS EKS as client |  | EksClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. The value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | EKS2Operations
+| *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the EKS client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the EKS client |  | Integer
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the EKS client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
@@ -81,7 +82,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (11 parameters):
+=== Query Parameters (12 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -90,6 +91,7 @@ with the following path and query parameters:
 | *eksClient* (producer) | To use a existing configured AWS EKS as client |  | EksClient
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *operation* (producer) | *Required* The operation to perform. The value can be one of: listClusters, describeCluster, createCluster, deleteCluster |  | EKS2Operations
+| *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the EKS client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the EKS client |  | Integer
 | *proxyProtocol* (producer) | To define a proxy protocol when instantiating the EKS client. The value can be one of: HTTP, HTTPS | HTTPS | Protocol
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2EksComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2EksComponentBuilderFactory.java
index d1b81be..680cc60 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2EksComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2EksComponentBuilderFactory.java
@@ -108,6 +108,18 @@ public interface Aws2EksComponentBuilderFactory {
             return this;
         }
         /**
+         * If we want to use a POJO request as body or not.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Default: false
+         * Group: producer
+         */
+        default Aws2EksComponentBuilder pojoRequest(boolean pojoRequest) {
+            doSetProperty("pojoRequest", pojoRequest);
+            return this;
+        }
+        /**
          * To define a proxy host when instantiating the EKS client.
          * 
          * The option is a: <code>java.lang.String</code> type.
@@ -221,6 +233,7 @@ public interface Aws2EksComponentBuilderFactory {
             case "eksClient": getOrCreateConfiguration((EKS2Component) component).setEksClient((software.amazon.awssdk.services.eks.EksClient) value); return true;
             case "lazyStartProducer": ((EKS2Component) component).setLazyStartProducer((boolean) value); return true;
             case "operation": getOrCreateConfiguration((EKS2Component) component).setOperation((org.apache.camel.component.aws2.eks.EKS2Operations) value); return true;
+            case "pojoRequest": getOrCreateConfiguration((EKS2Component) component).setPojoRequest((boolean) value); return true;
             case "proxyHost": getOrCreateConfiguration((EKS2Component) component).setProxyHost((java.lang.String) value); return true;
             case "proxyPort": getOrCreateConfiguration((EKS2Component) component).setProxyPort((java.lang.Integer) value); return true;
             case "proxyProtocol": getOrCreateConfiguration((EKS2Component) component).setProxyProtocol((software.amazon.awssdk.core.Protocol) value); return true;
diff --git a/core/camel-componentdsl/src/generated/resources/metadata.json b/core/camel-componentdsl/src/generated/resources/metadata.json
index 8b42e4c..cceb20d 100644
--- a/core/camel-componentdsl/src/generated/resources/metadata.json
+++ b/core/camel-componentdsl/src/generated/resources/metadata.json
@@ -524,7 +524,6 @@
     "lenientProperties": false,
     "javaType": "org.apache.camel.component.aws2.eks.EKS2Component",
     "firstVersion": "3.1.0",
-    "supportLevel": "Stable",
     "groupId": "org.apache.camel",
     "artifactId": "camel-aws2-eks",
     "version": "3.3.0-SNAPSHOT"
@@ -7599,6 +7598,7 @@
     "lenientProperties": false,
     "javaType": "org.apache.camel.component.zookeeper.ZooKeeperComponent",
     "firstVersion": "2.9.0",
+    "supportLevel": "Stable",
     "groupId": "org.apache.camel",
     "artifactId": "camel-zookeeper",
     "version": "3.3.0-SNAPSHOT"
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/EKS2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/EKS2EndpointBuilderFactory.java
index 29b65dc..846a5c5 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/EKS2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/EKS2EndpointBuilderFactory.java
@@ -128,6 +128,30 @@ public interface EKS2EndpointBuilderFactory {
             return this;
         }
         /**
+         * If we want to use a POJO request as body or not.
+         * 
+         * The option is a: <code>boolean</code> type.
+         * 
+         * Default: false
+         * Group: producer
+         */
+        default EKS2EndpointBuilder pojoRequest(boolean pojoRequest) {
+            doSetProperty("pojoRequest", pojoRequest);
+            return this;
+        }
+        /**
+         * If we want to use a POJO request as body or not.
+         * 
+         * The option will be converted to a <code>boolean</code> type.
+         * 
+         * Default: false
+         * Group: producer
+         */
+        default EKS2EndpointBuilder pojoRequest(String pojoRequest) {
+            doSetProperty("pojoRequest", pojoRequest);
+            return this;
+        }
+        /**
          * To define a proxy host when instantiating the EKS client.
          * 
          * The option is a: <code>java.lang.String</code> type.


[camel] 01/06: CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks list Clusters

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d2cf3cc3da8158383577ce1a112859af8ebfec4d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 10 12:40:44 2020 +0200

    CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks list Clusters
---
 .../camel/component/aws2/eks/EKS2Configuration.java    | 13 +++++++++++++
 .../apache/camel/component/aws2/eks/EKS2Producer.java  | 18 +++++++++++++++++-
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Configuration.java b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Configuration.java
index dd24f8e..53428be 100644
--- a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Configuration.java
+++ b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Configuration.java
@@ -47,6 +47,8 @@ public class EKS2Configuration implements Cloneable {
     private Integer proxyPort;
     @UriParam
     private String region;
+    @UriParam(defaultValue = "false")
+    private boolean pojoRequest;
 
     public EksClient getEksClient() {
         return eksClient;
@@ -138,6 +140,17 @@ public class EKS2Configuration implements Cloneable {
     public void setRegion(String region) {
         this.region = region;
     }
+    
+    public boolean isPojoRequest() {
+        return pojoRequest;
+    }
+
+    /**
+     * If we want to use a POJO request as body or not
+     */
+    public void setPojoRequest(boolean pojoRequest) {
+        this.pojoRequest = pojoRequest;
+    }
 
     // *************************************************
     //
diff --git a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
index 37630b5..e2cd44f 100644
--- a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
+++ b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.eks;
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
+import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.Message;
 import org.apache.camel.support.DefaultProducer;
 import org.apache.camel.util.ObjectHelper;
@@ -94,7 +95,21 @@ public class EKS2Producer extends DefaultProducer {
         return (EKS2Endpoint)super.getEndpoint();
     }
 
-    private void listClusters(EksClient eksClient, Exchange exchange) {
+    private void listClusters(EksClient eksClient, Exchange exchange) throws InvalidPayloadException {
+        if (getConfiguration().isPojoRequest()) {
+            Object payload = exchange.getIn().getMandatoryBody();
+            if (payload instanceof ListClustersRequest) {
+                ListClustersResponse result;
+                try {
+                    result = eksClient.listClusters((ListClustersRequest) payload);
+                } catch (AwsServiceException ase) {
+                    LOG.trace("List Clusters command returned the error code {}", ase.awsErrorDetails().errorCode());
+                    throw ase;
+                }
+                Message message = getMessageForResponse(exchange);
+                message.setBody(result);
+            }
+        } else {
         ListClustersRequest.Builder builder = ListClustersRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.MAX_RESULTS))) {
             int maxRes = exchange.getIn().getHeader(EKS2Constants.MAX_RESULTS, Integer.class);
@@ -109,6 +124,7 @@ public class EKS2Producer extends DefaultProducer {
         }
         Message message = getMessageForResponse(exchange);
         message.setBody(result);
+        }
     }
 
     private void createCluster(EksClient eksClient, Exchange exchange) {


[camel] 03/06: CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks delete cluster

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 782dfdf37adc4829c31bc9881e41dd20086038f6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 10 13:02:28 2020 +0200

    CAMEL-14868 - Camel-AWS2-*: Where possible, give the possiblity to the end user to pass an AWS Request pojo as body, aws2-eks delete cluster
---
 .../apache/camel/component/aws2/eks/EKS2Producer.java   | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
index 69c3358..9c4396c 100644
--- a/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
+++ b/components/camel-aws2-eks/src/main/java/org/apache/camel/component/aws2/eks/EKS2Producer.java
@@ -201,7 +201,21 @@ public class EKS2Producer extends DefaultProducer {
         }
     }
 
-    private void deleteCluster(EksClient eksClient, Exchange exchange) {
+    private void deleteCluster(EksClient eksClient, Exchange exchange) throws InvalidPayloadException {
+        if (getConfiguration().isPojoRequest()) {
+            Object payload = exchange.getIn().getMandatoryBody();
+            if (payload instanceof DeleteClusterRequest) {
+                DeleteClusterResponse result;
+                try {
+                    result = eksClient.deleteCluster((DeleteClusterRequest) payload);
+                } catch (AwsServiceException ase) {
+                    LOG.trace("Delete Cluster command returned the error code {}", ase.awsErrorDetails().errorCode());
+                    throw ase;
+                }
+                Message message = getMessageForResponse(exchange);
+                message.setBody(result);
+            }
+        } else {
         DeleteClusterRequest.Builder builder = DeleteClusterRequest.builder();
         if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME))) {
             String name = exchange.getIn().getHeader(EKS2Constants.CLUSTER_NAME, String.class);
@@ -218,6 +232,7 @@ public class EKS2Producer extends DefaultProducer {
         }
         Message message = getMessageForResponse(exchange);
         message.setBody(result);
+        }
     }
 
     public static Message getMessageForResponse(final Exchange exchange) {