JFrog Artifactory API部署带有属性的工件 [英] JFrog Artifactory API Deploy Artifact with Properties

查看:446
本文介绍了JFrog Artifactory API部署带有属性的工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读此API指南.我的Artifactory版本是4.12.2. https://www.jfrog.com/confluence/display/RTF/Artifactory + REST + API#ArtifactoryRESTAPI-ItemProperties

Reading this API guide. My Artifactory version is 4.12.2. https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-ItemProperties

它说要像这样部署一个工件.

It says to deploy an artifact like so.

curl -u myUser:myP455w0rd! -X PUT "http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt" -T Desktop/myNewFile.txt

那很好,但是我还想在上传文件的同时向file.txt添加属性.我确实看到了一个单独的API来设置属性.

That works fine but I also want to add properties to file.txt while also uploading. I did see a separate API to set properties.

PUT /api/storage/libs-release-local/ch/qos/logback/logback-classic/0.9.9?properties=os=win,linux;qa=done&recursive=1

那行得通.我想也许这样做会有用.

That works. I thought maybe it would work to do this.

curl -u myUser:myP455w0rd! -X PUT "http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt?properties=os=win,linux;qa=done&recursive=1" -T Desktop/myNewFile.txt

它没有用.是否可以上传工件并同时设置属性,还是必须进行两次不同的API调用?

It didn't work. Is it possible to upload an artifact and simultaneously set properties or does it have to be two different API calls?

我确实使用jfrog cli,但是我需要一个API解决方案.

I do use jfrog cli but I need an API solution.

推荐答案

正确的格式如下:

curl -u myUser:myP455w0rd! -X PUT "http://localhost:8081/artifactory/my-repository/my/new/artifact/directory/file.txt;propertyA=valueA;propertyB=valueB" -T Desktop/myNewFile.txt

您可以在此处(我同意它是隐藏得很好"的)

You can find the relevant documentation here (I agree that it was "well hidden")

这篇关于JFrog Artifactory API部署带有属性的工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆