Remove old artifacts via REST API

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove old artifacts via REST API

berryBellDragon
1. I grab Artifacts Not Downloaded Since
2. Try to Delete Item and get:
  {
  "errors" : [ {
    "status" : 400,
    "message" : "Unspecified properties to delete."
  } ]
}

Example of a call:
curl -u admin -i http://arti:8081/artifactory/api/storage/snapshots/com/ss/image/report/reporting/1.4.1-SNAPSHOT/reporting-1.4.1-20150521.184901-2.pom

Am I missing something at the end of the url for delete?  It is the one from the json from /artifactory/api/search/usage?notUsedSince=

I am using python

Code


Artifactory Pro Power Pack 3.6.0
Reply | Threaded
Open this post in threaded view
|

Re: Remove old artifacts via REST API

berryBellDragon
I knew when I posted this I'd see the issue

Need to remove /api/storage from the uri:

newstr = result['uri'].replace("/api/storage", "")
Reply | Threaded
Open this post in threaded view
|

Re: Remove old artifacts via REST API

David Pierce
In reply to this post by berryBellDragon
Hello,

Add an "-X DELETE" to the curl command, and remove "api/storage/" from
your URL, and you'll have the command we run nightly.

Also in a python script, as it happens. :-)

-Dave P.

On 6/24/2015 2:26 PM, berryBellDragon wrote:

> 1. I grab Artifacts Not Downloaded Since
> 2. Try to Delete Item and get:
>    {
>    "errors" : [ {
>      "status" : 400,
>      "message" : "Unspecified properties to delete."
>    } ]
> }
>
> Example of a call:
> curl -u admin -i
> http://arti:8081/artifactory/api/storage/snapshots/com/ss/image/report/reporting/1.4.1-SNAPSHOT/reporting-1.4.1-20150521.184901-2.pom
>
> Am I missing something at the end of the url for delete?  It is the one from
> the json from /artifactory/api/search/usage?notUsedSince=
>
> I am using python
>
> Code <http://pastebin.com/UEdHeCMW>
>
>
> Artifactory Pro Power Pack 3.6.0
>
>
>
> --
> View this message in context: http://forums.jfrog.org/Remove-old-artifacts-via-REST-API-tp7580355.html
> Sent from the Artifactory - Users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Monitor 25 network devices or servers for free with OpManager!
> OpManager is web-based network management software that monitors
> network devices and physical & virtual servers, alerts via email & sms
> for fault. Monitor 25 devices for free with no restriction. Download now
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
> _______________________________________________
> Artifactory-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/artifactory-users


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Artifactory-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/artifactory-users