JFrog Artifactory API Deploy Artifact with Properties

╄→尐↘猪︶ㄣ 提交于 2020-01-25 03:50:27

问题


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

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

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?

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


回答1:


The correct format would be something like:

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")



来源:https://stackoverflow.com/questions/49184396/jfrog-artifactory-api-deploy-artifact-with-properties

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