[英]Artifactory API to upload directory with contents
I was looking into the Artifactory REST API doc but I could not find any API that allows us to upload a directory with contents (can be files, subdirectory).我正在查看Artifactory REST API 文档,但找不到任何 API 允许我们上传包含内容(可以是文件、子目录)的目录。 There is only API to upload an individual file.上传单个文件只有API。 I also found this where it stated that it can be done through GUI or the JFrog CLI.我还在它声明可以通过 GUI 或 JFrog CLI 完成的地方找到了这个。 I wonder if I misread some documents and if there actually is a way to do that with the REST API.我想知道我是否误读了一些文件,是否真的有办法用 REST API 做到这一点。
In order to upload (aka "deploy") a directory with its contents via REST API you can use the Deploy Artifacts from Archive endpoint.为了通过 REST API 上传(也称为“部署”)目录及其内容,您可以使用从存档端点部署工件。
You'll need to create an archive file ( zip
, tar
, tar.gz
) with the directory and its contents, and call the upload API with the target folder, specifying the X-Explode-Archive: true
request header.您需要使用目录及其内容创建存档文件( zip
、 tar
、 tar.gz
),并使用目标文件夹调用上传 API ,指定X-Explode-Archive: true
请求 header。
Eg (simplified - omitted auth, etc.):例如(简化 - 省略 auth 等):
curl -X PUT https://jfrog.foo.bar/artifactory/my-repo-local/ \
-H "X-Explode-Archive: true" \
-T my-file.tar.gz
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.