0
votes

I am using Artifactory 4.8.0 (OSS)

I have deployed artifacts to 2 repos: libs-devel and libs-release-candidates.

When I execute

$ curl -u denham:password -X GET https://artifactory.server/artifactory/api/search/artifact?name=MyPackage&repos=libs-devel

The response I receive is:

"results" : [ {
    "uri" : "https://artifactory.server/artifactory/api/storage/libs-devel/com/acme/MyPackage/17.10.1-SNAPSHOT/MyPackage-17.10.1-20170908.092803-1.pom"
  }, {
    "uri" : "https://artifactory.server/artifactory/api/storage/libs-devel/com/acme/MyPackage/17.10.1-SNAPSHOT/MyPackage-17.10.1-20170908.092803-1.war"
  }, {
    "uri" : "https://artifactory.server/artifactory/api/storage/libs-release-candidates/com/acme/MyPackage/17.10.1-24/MyPackage-17.10.1-24.pom"
  }, {
    "uri" : "https://artifactory.server/artifactory/api/storage/libs-release-candidates/com/acme/MyPackage/17.10.1-24/MyPackage-17.10.1-24.war"
  }, {
    "uri" : "https://artifactory.server/artifactory/api/storage/libs-devel/com/acme/MyPackage/17.9.3-SNAPSHOT/MyPackage-17.9.3-20170907.105908-1.pom"
  }, {
    "uri" : "https://artifactory.server/artifactory/api/storage/libs-devel/com/acme/MyPackage/17.9.3-SNAPSHOT/MyPackage-17.9.3-20170907.105908-1.war"
  } ]
}

I would expect that the results would be limited to the the libs-devel repo, as specified in the url.

Have I done something wrong? Is this a bug?

Here's the API reference (for version 4) that I followed: https://www.jfrog.com/confluence/display/RTF4X/Artifactory+REST+API#ArtifactoryRESTAPI-ArtifactSearch(QuickSearch)

Thanks in advance.

2

2 Answers

2
votes

Yes. This is correct. You will be able to limit the search query to specific repositories by adding the 'repos' parameter on this rest call. We (JFrog) are not familiar with a bug on this subject and it is working on our side (Artifactory OSS - same version: 4.8.0). We will be interested to know if the same is working for you using the UI quick search.

0
votes

If using curl, the full URL needs to be encapsulated in quotes. Otherwise the & is left off the request.

I tried using Postman and it works as expected.

Bested by quote marks. :-(