Reputation: 237
I have a requirement to save files to amazon S3 from my xquery, instead of storing it locally in my marklogic server box (using xdmp:save right now). Is there an xquery api to upload this file to S3 from my xquery?
Upvotes: 2
Views: 606
Reputation: 3732
Even better. You do not need to run on EC2 for this.
most api's and configuration values a 'local' absolute filename works you can use "s3://bucket/key" provided you have configured the authentication, and that the API does not require appending.
On EC2, if you launch the instance with an associated IAM role and default MarkLogic configurations, the IAM credentials will be attempted if none are explicitly provided.
Upvotes: 0
Reputation: 7770
If you are running MarkLogic on an EC2 instance, then the solution is there already.. S3 is treated like a native filesystem, so using xdmp:save("S3://bucket/..." bla) works. But you need to fill in your credentials in the admin panel.
Docs are here: https://docs.marklogic.com/guide/ec2/managing#id_98406
Note that you can even store forests on S3 as well (but not with journalling turned on)
Upvotes: 2