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
The following commit(s) were added to refs/heads/master by this push: new e46f481 Regen docs e46f481 is described below commit e46f481992d154b3f19690fb20ed59413f4dff05 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Thu Mar 7 12:05:51 2019 +0100 Regen docs --- .../modules/ROOT/pages/aws-s3-component.adoc | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/docs/components/modules/ROOT/pages/aws-s3-component.adoc b/docs/components/modules/ROOT/pages/aws-s3-component.adoc index 4921298..d1be2d1 100644 --- a/docs/components/modules/ROOT/pages/aws-s3-component.adoc +++ b/docs/components/modules/ROOT/pages/aws-s3-component.adoc @@ -395,6 +395,112 @@ when the system environment variable called "isRemote" is set to true (there are using IAM credentials on AWS environments takes away the need to refresh on remote environments and adds a major security boost (IAM credentials are refreshed automatically every 6 hours and update when their policies are updated). This is the AWS recommended way to manage credentials and therefore should be used as often as possible. +#### S3 Producer Operation examples + +- CopyObject: this operation copy an object from one bucket to a different one + +[source,java] +-------------------------------------------------------------------------------- + from("direct:start").process(new Processor() { + + @Override + public void process(Exchange exchange) throws Exception { + exchange.getIn().setHeader(S3Constants.BUCKET_DESTINATION_NAME, "camelDestinationBucket"); + exchange.getIn().setHeader(S3Constants.KEY, "camelKey"); + exchange.getIn().setHeader(S3Constants.DESTINATION_KEY, "camelDestinationKey"); + } + }) + .to("aws-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=copyObject") + .to("mock:result"); +-------------------------------------------------------------------------------- + +This operation will copy the object with the name expressed in the header camelDestinationKey to the camelDestinationBucket bucket, from the bucket mycamelbucket. + +- DeleteObject: this operation deletes an object from a bucket + +[source,java] +-------------------------------------------------------------------------------- + from("direct:start").process(new Processor() { + + @Override + public void process(Exchange exchange) throws Exception { + exchange.getIn().setHeader(S3Constants.KEY, "camelKey"); + } + }) + .to("aws-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=deleteObject") + .to("mock:result"); +-------------------------------------------------------------------------------- + +This operation will delete the object camelKey from the bucket mycamelbucket. + +- ListBuckets: this operation list the buckets for this account in this region + +[source,java] +-------------------------------------------------------------------------------- + from("direct:start") + .to("aws-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=listBuckets") + .to("mock:result"); +-------------------------------------------------------------------------------- + +This operation will list the buckets for this account + +- DeleteBucket: this operation delete the bucket specified as URI parameter or header + +[source,java] +-------------------------------------------------------------------------------- + from("direct:start") + .to("aws-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=deleteBucket") + .to("mock:result"); +-------------------------------------------------------------------------------- + +This operation will delete the bucket mycamelbucket + +- DownloadLink: this operation create a download link for the file specified in the key header + +[source,java] +-------------------------------------------------------------------------------- + from("direct:start").process(new Processor() { + + @Override + public void process(Exchange exchange) throws Exception { + exchange.getIn().setHeader(S3Constants.KEY, "camelKey"); + } + }) + .to("aws-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=downloadLink") + .to("mock:result"); +-------------------------------------------------------------------------------- + +This operation will create a downloadLink for the file camelKey in the bucket mycamelbucket + +- ListObjects: this operation list object in a specific bucket + +[source,java] +-------------------------------------------------------------------------------- + from("direct:start") + .to("aws-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=listObjects") + .to("mock:result"); +-------------------------------------------------------------------------------- + +This operation will list the objects in the mycamelbucket bucket + +- GetObject: this operation get a single object in a specific bucket + +[source,java] +-------------------------------------------------------------------------------- + from("direct:start").process(new Processor() { + + @Override + public void process(Exchange exchange) throws Exception { + exchange.getIn().setHeader(S3Constants.KEY, "camelKey"); + } + }) + .to("aws-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=getObject") + .to("mock:result"); +-------------------------------------------------------------------------------- + +This operation will return an S3Object instance related to the camelKey object in mycamelbucket bucket. + + ### Dependencies Maven users will need to add the following dependency to their pom.xml.