Search code examples
curljfrog-mission-control

Can't get artifacts, that were created within a specific date range


I need to make a manual cleanup of Jfrog artifactor from old artifacts by using REST API.

For these purposes, first of all, I must identify artifacts, created within a specific date range.

The problem is that when I use

curl -u user:password -X GET "http://artifactory:8081/artifactory/api/search"

I get this error

{
  "errors" : [ {
    "status" : 405,
    "message" : "Method Not Allowed"
  } ]

What does it mean, that method is not allowed? How can I deal with it?

The full command is

curl -u user:password "http://artifactory:8081/artifactory/api/search?from=long&to=long&repos=currentrepo"

Solution

  • You are using the rest api wrong.

    This is how the full command should look like: curl -u admin:password "http://localhost:8081/artifactory/api/search/dates?dateFields=created&from=1461052559000&to=1492588559000&repos=libs-snapshot-local"