xquery api to upload data from marklogic to amazon s3

馋奶兔 提交于 2019-12-02 04:36:05

问题


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?


回答1:


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)




回答2:


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.



来源:https://stackoverflow.com/questions/37554370/xquery-api-to-upload-data-from-marklogic-to-amazon-s3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!