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

nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers
in repository https://gitbox.apache.org/repos/asf/camel.git

commit bea1c6b80375766226068030f852f3a926823f8f
Author: Nicolas Filotto <[email protected]>
AuthorDate: Wed Mar 16 09:47:07 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-aws2-ec2
---
 .../apache/camel/component/aws2/ec2/aws2-ec2.json  | 17 ++++++++++++
 .../src/main/docs/aws2-ec2-component.adoc          | 30 +++-------------------
 .../camel/component/aws2/ec2/AWS2EC2Constants.java | 21 +++++++++++++++
 .../camel/component/aws2/ec2/AWS2EC2Endpoint.java  |  3 ++-
 4 files changed, 43 insertions(+), 28 deletions(-)

diff --git 
a/components/camel-aws/camel-aws2-ec2/src/generated/resources/org/apache/camel/component/aws2/ec2/aws2-ec2.json
 
b/components/camel-aws/camel-aws2-ec2/src/generated/resources/org/apache/camel/component/aws2/ec2/aws2-ec2.json
index 43b74d9..aac588c 100644
--- 
a/components/camel-aws/camel-aws2-ec2/src/generated/resources/org/apache/camel/component/aws2/ec2/aws2-ec2.json
+++ 
b/components/camel-aws/camel-aws2-ec2/src/generated/resources/org/apache/camel/component/aws2/ec2/aws2-ec2.json
@@ -39,6 +39,23 @@
     "useDefaultCredentialsProvider": { "kind": "property", "displayName": "Use 
Default Credentials Provider", "group": "producer", "label": "", "required": 
false, "type": "boolean", "javaType": "boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, 
"configurationClass": 
"org.apache.camel.component.aws2.ec2.AWS2EC2Configuration", 
"configurationField": "configuration", "description": "Set whether the EC2 
client should expect to load credentials through  [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired 
Enabled", "group": "advanced", "label": "advanced", "required": false, "type": 
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": true, "description": "Whether autowiring is 
enabled. This is used for automatic autowiring options (the option must be 
marked as autowired) by looking up in the registry to find if there is a single 
instance of matching type, which t [...]
   },
+  "headers": {
+    "CamelAwsEC2ImageId": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "An image ID of the AWS marketplace" },
+    "CamelAwsEC2InstanceType": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": 
"software.amazon.awssdk.services.ec2.model.InstanceType", "enum": [ 
"a1.medium", "a1.large", "a1.xlarge", "a1.2xlarge", "a1.4xlarge", "a1.metal", 
"c1.medium", "c1.xlarge", "c3.large", "c3.xlarge", "c3.2xlarge", "c3.4xlarge", 
"c3.8xlarge", "c4.large", "c4.xlarge", "c4.2xlarge", "c4.4xlarge", 
"c4.8xlarge", "c5.large", "c5.xlarge", "c5.2xlarge", "c5.4xlarge" [...]
+    "CamelAwsEC2Operation": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The operation we want to perform" },
+    "CamelAwsEC2InstanceMinCount": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "Integer", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The minimum number of instances we want to run." },
+    "CamelAwsEC2InstanceMaxCount": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "Integer", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The maximum number of instances we want to run." },
+    "CamelAwsEC2InstanceMonitoring": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "Boolean", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Define if we want the running instances to be monitored" 
},
+    "CamelAwsEC2InstanceKernelId": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The ID of the kernel." },
+    "CamelAwsEC2InstanceEbsOptimized": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "Boolean", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Define if the creating instance is optimized for EBS 
I\/O." },
+    "CamelAwsEC2InstanceSecurityGroups": { "kind": "header", "displayName": 
"", "group": "producer", "label": "", "required": false, "javaType": 
"Collection<String>", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "The security groups to associate to the 
instances" },
+    "CamelAwsEC2InstancesIds": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "Collection<String>", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "A collection of instances IDS to execute start, stop, 
describe and\nterminate operations on." },
+    "CamelAwsEC2InstancesKeyPair": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "The name of the key pair." },
+    "CamelAwsEC2InstancesClientToken": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": "String", 
"deprecated": false, "deprecationNote": "", "autowired": false, "secret": 
false, "description": "Unique, case-sensitive identifier you provide to ensure 
the idempotency of the request." },
+    "CamelAwsEC2InstancesPlacement": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": 
"software.amazon.awssdk.services.ec2.model.Placement", "deprecated": false, 
"deprecationNote": "", "autowired": false, "secret": false, "description": "The 
placement for the instance." },
+    "CamelAwsEC2InstancesTags": { "kind": "header", "displayName": "", 
"group": "producer", "label": "", "required": false, "javaType": 
"Collection<Tag>", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "description": "A collection of tags to add or remove 
from EC2 resources" },
+    "CamelAwsEC2SubnetId": { "kind": "header", "displayName": "", "group": 
"producer", "label": "", "required": false, "javaType": "String", "deprecated": 
false, "deprecationNote": "", "autowired": false, "secret": false, 
"description": "The ID of the subnet to launch the instance into." }
+  },
   "properties": {
     "label": { "kind": "path", "displayName": "Label", "group": "producer", 
"label": "", "required": true, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": 
false, "secret": false, "configurationClass": 
"org.apache.camel.component.aws2.ec2.AWS2EC2Configuration", 
"configurationField": "configuration", "description": "Logical name" },
     "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": 
"producer", "label": "producer", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "configurationClass": 
"org.apache.camel.component.aws2.ec2.AWS2EC2Configuration", 
"configurationField": "configuration", "description": "Amazon AWS Access Key" },
diff --git 
a/components/camel-aws/camel-aws2-ec2/src/main/docs/aws2-ec2-component.adoc 
b/components/camel-aws/camel-aws2-ec2/src/main/docs/aws2-ec2-component.adoc
index 78e50b0..c338947 100644
--- a/components/camel-aws/camel-aws2-ec2/src/main/docs/aws2-ec2-component.adoc
+++ b/components/camel-aws/camel-aws2-ec2/src/main/docs/aws2-ec2-component.adoc
@@ -69,33 +69,9 @@ You have the possibility of avoiding the usage of explicit 
static credentials, b
 
 For more information about this you can look at 
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html[AWS
 credentials documentation]
 
-=== Message headers evaluated by the EC2 producer
-
-[width="100%",cols="10%,10%,80%",options="header",]
-|=======================================================================
-|Header |Type |Description
-
-|`CamelAwsEC2ImageId` |`String` |An image ID of the AWS marketplace
-
-|`CamelAwsEC2InstanceType` |com.amazonaws.services.ec2.model.InstanceType |The 
instance type we want to create and run
-
-|`CamelAwsEC2Operation` |`String` |The operation we want to perform
-
-|`CamelAwsEC2InstanceMinCount` |`Int` |The mininum number of instances we want 
to run.
-
-|`CamelAwsEC2InstanceMaxCount` |`Int` |The maximum number of instances we want 
to run.
-
-|`CamelAwsEC2InstanceMonitoring` |Boolean |Define if we want the running 
instances to be monitored
-
-|`CamelAwsEC2InstanceEbsOptimized` |`Boolean` |Define if the creating instance 
is optimized for EBS I/O.
-
-|`CamelAwsEC2InstanceSecurityGroups` |Collection |The security groups to 
associate to the instances
-
-|`CamelAwsEC2InstancesIds` |`Collection` |A collection of instances IDS to 
execute start, stop, describe and
-terminate operations on.
-
-|`CamelAwsEC2InstancesTags` |`Collection` |A collection of tags to add or 
remove from EC2 resources
-|=======================================================================
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Supported producer operations
 
diff --git 
a/components/camel-aws/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Constants.java
 
b/components/camel-aws/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Constants.java
index 2e4bddb..263ac73 100644
--- 
a/components/camel-aws/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Constants.java
+++ 
b/components/camel-aws/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Constants.java
@@ -16,24 +16,45 @@
  */
 package org.apache.camel.component.aws2.ec2;
 
+import org.apache.camel.spi.Metadata;
+
 /**
  * Constants used in Camel AWS EC2 module SDK v2
  */
 public interface AWS2EC2Constants {
 
+    @Metadata(description = "An image ID of the AWS marketplace", javaType = 
"String")
     String IMAGE_ID = "CamelAwsEC2ImageId";
+    @Metadata(description = "The instance type we want to create and run",
+              javaType = 
"software.amazon.awssdk.services.ec2.model.InstanceType")
     String INSTANCE_TYPE = "CamelAwsEC2InstanceType";
+    @Metadata(description = "The operation we want to perform", javaType = 
"String")
     String OPERATION = "CamelAwsEC2Operation";
+    @Metadata(description = "The minimum number of instances we want to run.", 
javaType = "Integer")
     String INSTANCE_MIN_COUNT = "CamelAwsEC2InstanceMinCount";
+    @Metadata(description = "The maximum number of instances we want to run.", 
javaType = "Integer")
     String INSTANCE_MAX_COUNT = "CamelAwsEC2InstanceMaxCount";
+    @Metadata(description = "Define if we want the running instances to be 
monitored", javaType = "Boolean")
     String INSTANCE_MONITORING = "CamelAwsEC2InstanceMonitoring";
+    @Metadata(description = "The ID of the kernel.", javaType = "String")
     String INSTANCE_KERNEL_ID = "CamelAwsEC2InstanceKernelId";
+    @Metadata(description = "Define if the creating instance is optimized for 
EBS I/O.", javaType = "Boolean")
     String INSTANCE_EBS_OPTIMIZED = "CamelAwsEC2InstanceEbsOptimized";
+    @Metadata(description = "The security groups to associate to the 
instances", javaType = "Collection<String>")
     String INSTANCE_SECURITY_GROUPS = "CamelAwsEC2InstanceSecurityGroups";
+    @Metadata(description = "A collection of instances IDS to execute start, 
stop, describe and\n" +
+                            "terminate operations on.",
+              javaType = "Collection<String>")
     String INSTANCES_IDS = "CamelAwsEC2InstancesIds";
+    @Metadata(description = "The name of the key pair.", javaType = "String")
     String INSTANCES_KEY_PAIR = "CamelAwsEC2InstancesKeyPair";
+    @Metadata(description = "Unique, case-sensitive identifier you provide to 
ensure the idempotency of the request.",
+              javaType = "String")
     String INSTANCES_CLIENT_TOKEN = "CamelAwsEC2InstancesClientToken";
+    @Metadata(description = "The placement for the instance.", javaType = 
"software.amazon.awssdk.services.ec2.model.Placement")
     String INSTANCES_PLACEMENT = "CamelAwsEC2InstancesPlacement";
+    @Metadata(description = "A collection of tags to add or remove from EC2 
resources", javaType = "Collection<Tag>")
     String INSTANCES_TAGS = "CamelAwsEC2InstancesTags";
+    @Metadata(description = "The ID of the subnet to launch the instance 
into.", javaType = "String")
     String SUBNET_ID = "CamelAwsEC2SubnetId";
 }
diff --git 
a/components/camel-aws/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Endpoint.java
 
b/components/camel-aws/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Endpoint.java
index 766f655..20c4fd2 100644
--- 
a/components/camel-aws/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Endpoint.java
+++ 
b/components/camel-aws/camel-aws2-ec2/src/main/java/org/apache/camel/component/aws2/ec2/AWS2EC2Endpoint.java
@@ -32,7 +32,8 @@ import software.amazon.awssdk.services.ec2.Ec2Client;
  * Manage AWS EC2 instances using AWS SDK version 2.x.
  */
 @UriEndpoint(firstVersion = "3.1.0", scheme = "aws2-ec2", title = "AWS Elastic 
Compute Cloud (EC2)",
-             syntax = "aws2-ec2:label", producerOnly = true, category = { 
Category.CLOUD, Category.MANAGEMENT })
+             syntax = "aws2-ec2:label", producerOnly = true, category = { 
Category.CLOUD, Category.MANAGEMENT },
+             headersClass = AWS2EC2Constants.class)
 public class AWS2EC2Endpoint extends ScheduledPollEndpoint {
 
     private Ec2Client ec2Client;

Reply via email to