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 a627979dadae6ddb2be561246a10f7d4d4076e57 Author: Nicolas Filotto <[email protected]> AuthorDate: Wed Mar 30 11:03:16 2022 +0200 CAMEL-17792: Add doc about the message headers of camel-jclouds --- .../apache/camel/component/jclouds/jclouds.json | 13 +++++++++++ .../src/main/docs/jclouds-component.adoc | 19 ++++------------ .../camel/component/jclouds/JcloudsConstants.java | 25 ++++++++++++++++++++++ .../camel/component/jclouds/JcloudsEndpoint.java | 2 +- 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/components/camel-jclouds/src/generated/resources/org/apache/camel/component/jclouds/jclouds.json b/components/camel-jclouds/src/generated/resources/org/apache/camel/component/jclouds/jclouds.json index cd46ec5..e1fc898 100644 --- a/components/camel-jclouds/src/generated/resources/org/apache/camel/component/jclouds/jclouds.json +++ b/components/camel-jclouds/src/generated/resources/org/apache/camel/component/jclouds/jclouds.json @@ -28,6 +28,19 @@ "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": 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 star [...] "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": { + "CamelJcloudsBlobName": { "kind": "header", "displayName": "", "group": "producer blobstore", "label": "producer blobstore", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the blob." }, + "CamelJcloudsContainerName": { "kind": "header", "displayName": "", "group": "producer blobstore", "label": "producer blobstore", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the blob container." }, + "CamelJcloudsBlobNameList": { "kind": "header", "displayName": "", "group": "producer blobstore", "label": "producer blobstore", "required": false, "javaType": "List", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The blob name list." }, + "CamelJcloudsNodeState": { "kind": "header", "displayName": "", "group": "producer compute", "label": "producer compute", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The node state" }, + "CamelJcloudsOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to be performed on the blob.\n\nThe valid options are:\n\n* PUT\n* GET" }, + "CamelJcloudsImageId": { "kind": "header", "displayName": "", "group": "producer compute", "label": "producer compute", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The imageId that will be used for creating a node. Values depend on the actual cloud provider." }, + "CamelJcloudsLocationId": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The location that will be used for creating a node. Values depend on the actual cloud provider." }, + "CamelJcloudsHardwareId": { "kind": "header", "displayName": "", "group": "producer compute", "label": "producer compute", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The hardware that will be used for creating a node. Values depend on the actual cloud provider." }, + "CamelJcloudsGroup": { "kind": "header", "displayName": "", "group": "producer compute", "label": "producer compute", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The group that will be assigned to the newly created node. Values depend on the actual cloud provider." }, + "CamelJcloudsNodeId": { "kind": "header", "displayName": "", "group": "producer compute", "label": "producer compute", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The id of the node that will run the script or destroyed." }, + "CamelJcloudsUser": { "kind": "header", "displayName": "", "group": "producer compute", "label": "producer compute", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The user on the target node that will run the script." } + }, "properties": { "command": { "kind": "path", "displayName": "Command", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.jclouds.JcloudsCommand", "enum": [ "blobstore", "compute" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jclouds.JcloudsConfiguration", "configurationField": "configuration", "description": "What command to execute such as blobstore or co [...] "providerId": { "kind": "path", "displayName": "Provider Id", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.jclouds.JcloudsConfiguration", "configurationField": "configuration", "description": "The name of the cloud provider that provides the target service (e.g. aws-s3 or aws_ec2)." }, diff --git a/components/camel-jclouds/src/main/docs/jclouds-component.adoc b/components/camel-jclouds/src/main/docs/jclouds-component.adoc index 455e85a..b8bb547 100644 --- a/components/camel-jclouds/src/main/docs/jclouds-component.adoc +++ b/components/camel-jclouds/src/main/docs/jclouds-component.adoc @@ -27,7 +27,7 @@ S3. For example, BlobStore can give you a simple Map view of a container. The camel jclouds component allows you to use both abstractions, as it -specifes two types of endpoint the JcloudsBlobStoreEndpoint and the +specifies two types of endpoint the JcloudsBlobStoreEndpoint and the JcloudsComputeEndpoint. You can have both producers and consumers on a blobstore endpoint but you can only have producers on compute endpoints. @@ -132,20 +132,9 @@ jclouds:blobstore:aws-s3?operation=CamelJcloudsGet&container=mycontainer&blobNam For producer endpoint you can override all of the above URI options by passing the appropriate headers to the message. -=== Message Headers for blobstore - -[width="100%",cols="10%,90%",options="header",] -|======================================================================= -|Header |Description - -|`CamelJcloudsOperation` |The operation to be performed on the blob. The valid options are -* PUT -* GET - -|`CamelJcloudsContainer` |The name of the blob container. - -|`CamelJcloudsBlobName` |The name of the blob. -|======================================================================= +// component headers: START +include::partial$component-endpoint-headers.adoc[] +// component headers: END == Blobstore Usage Samples diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java index 55b6fbe..df663ef 100644 --- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java +++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java @@ -16,16 +16,25 @@ */ package org.apache.camel.component.jclouds; +import org.apache.camel.spi.Metadata; + public final class JcloudsConstants { public static final String DELIMETER = ":"; public static final String BLOBSTORE = "blobstore"; public static final String COMPUTE = "compute"; + @Metadata(label = "producer blobstore", description = "The name of the blob.", javaType = "String") public static final String BLOB_NAME = "CamelJcloudsBlobName"; + @Metadata(label = "producer blobstore", description = "The name of the blob container.", javaType = "String") public static final String CONTAINER_NAME = "CamelJcloudsContainerName"; + @Metadata(label = "producer blobstore", description = "The blob name list.", javaType = "List") public static final String BLOB_NAME_LIST = "CamelJcloudsBlobNameList"; + @Metadata(label = "producer compute", description = "The node state", javaType = "Object") public static final String NODE_STATE = "CamelJcloudsNodeState"; + @Metadata(label = "producer", + description = "The operation to be performed on the blob.\n\nThe valid options are:\n\n* PUT\n* GET", + javaType = "String") public static final String OPERATION = "CamelJcloudsOperation"; public static final String PUT = "CamelJcloudsPut"; public static final String GET = "CamelJcloudsGet"; @@ -49,11 +58,27 @@ public final class JcloudsConstants { public static final String CONTENT_DISPOSITION = "CamelJcloudsContentDisposition"; public static final String PAYLOAD_EXPIRES = "CamelJcloudsPayloadExpires"; + @Metadata(label = "producer compute", + description = "The imageId that will be used for creating a node. Values depend on the actual cloud provider.", + javaType = "String") public static final String IMAGE_ID = "CamelJcloudsImageId"; + @Metadata(label = "producer", + description = "The location that will be used for creating a node. Values depend on the actual cloud provider.", + javaType = "String") public static final String LOCATION_ID = "CamelJcloudsLocationId"; + @Metadata(label = "producer compute", + description = "The hardware that will be used for creating a node. Values depend on the actual cloud provider.", + javaType = "String") public static final String HARDWARE_ID = "CamelJcloudsHardwareId"; + @Metadata(label = "producer compute", + description = "The group that will be assigned to the newly created node. Values depend on the actual cloud provider.", + javaType = "String") public static final String GROUP = "CamelJcloudsGroup"; + @Metadata(label = "producer compute", description = "The id of the node that will run the script or destroyed.", + javaType = "String") public static final String NODE_ID = "CamelJcloudsNodeId"; + @Metadata(label = "producer compute", description = "The user on the target node that will run the script.", + javaType = "String") public static final String USER = "CamelJcloudsUser"; public static final String RUN_SCRIPT_ERROR = "CamelJcloudsRunScriptError"; diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsEndpoint.java b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsEndpoint.java index 85cb5bf..daf7c50 100644 --- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsEndpoint.java +++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsEndpoint.java @@ -25,7 +25,7 @@ import org.apache.camel.support.DefaultEndpoint; * Interact with jclouds compute and blobstore service. */ @UriEndpoint(firstVersion = "2.9.0", scheme = "jclouds", title = "JClouds", syntax = "jclouds:command:providerId", - category = { Category.API, Category.CLOUD, Category.COMPUTE }) + category = { Category.API, Category.CLOUD, Category.COMPUTE }, headersClass = JcloudsConstants.class) public abstract class JcloudsEndpoint extends DefaultEndpoint { @UriParam
