2
votes

I'm trying to manually clean up some specific old artifacts. I'm happy just deleting the big artifacts for specific builds under: http://artifactory.example.com/artifactory/simple/libs-releases-local/com/company/path/buildName/submodule/version/

I think my best bet is using the REST API, however I'm having trouble mapping the documentation for Artifactory REST API to curl commands.

Could someone give the curl commands for, say, file info and delete item for my specific file? I think if I had that, I could figure out the rest of what I'm failing to understand. Or, if you have other great suggestions, I'm all ears.

Note, my company is using the free edition of Artifactory 2.6.1. This has severely limited the possible solutions to my problem. I've already discovered the following is unsupported:

  • AQL: Added in 3.5
  • "delete versions" button in the UI.
  • "delete builds" in API (a "pro" only feature)
2
2.6.1?! You definitely absolutely for sure need to upgrade ASAP.JBaruch

2 Answers

3
votes

That was enough for me to be able to figure out my specific example. I think the key for me was that when the documentation says "repoKey", it means something like "libs-releases-local".

Taking my specific example of:

http://artifactory.example.com/artifactory/simple/libs-releases-local/com/company/path/buildName/submodule/version/

the commands I was looking for were:

curl http://artifactory.example.com/artifactory/api/storage/libs-releases-local/com/company/path/buildName/submodule/version/
curl -X delete -u username:password http://artifactory.example.com/artifactory/libs-releases-local/com/company/path/buildName/submodule/version/

Thank you so much for the help!

2
votes

Should be straightforward. Here's a fileinfo example:

curl http://oss.jfrog.org/artifactory/api/storage/oss-snapshot-local/org/codehaus/groovy/groovy/2.5.0-SNAPSHOT/groovy-all-2.5.0-SNAPSHOT.jar

Returns:

{
  "repo" : "oss-snapshot-local",
  "path" : "/org/codehaus/groovy/groovy/2.5.0-SNAPSHOT/groovy-all-2.5.0-SNAPSHOT.jar",
  "created" : "2015-01-22T12:40:55.441Z",
  "createdBy" : "groovy-operator",
  "lastModified" : "2015-07-30T17:11:20.057Z",
  "modifiedBy" : "groovy-operator",
  "lastUpdated" : "2015-07-30T17:11:20.057Z",
  "downloadUri" : "http://oss.jfrog.org/artifactory/oss-snapshot-local/org/codehaus/groovy/groovy/2.5.0-SNAPSHOT/groovy-all-2.5.0-SNAPSHOT.jar",
  "mimeType" : "application/java-archive",
  "size" : "7091635",
  "checksums" : {
    "sha1" : "768e9c224d359aa3a7d57e0ec5d58e87787d3bd3",
    "md5" : "70ba790f40fc8a331a73598ae602e617"
  },
  "originalChecksums" : {
    "sha1" : "768e9c224d359aa3a7d57e0ec5d58e87787d3bd3",
    "md5" : "70ba790f40fc8a331a73598ae602e617"
  },
  "uri" : "http://oss.jfrog.org/artifactory/api/storage/oss-snapshot-local/org/codehaus/groovy/groovy/2.5.0-SNAPSHOT/groovy-all-2.5.0-SNAPSHOT.jar"
}