Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AQL build domain object does not return results

I'm running into an issue where I'm not able to get any of the queries I'm making on the build domain object to return when using AQL

When I make the following curl:

curl -X GET -H "X-JFrog-Art-Api: myArtifactroyKey" -H "Cache-Control: no-cache" "https://MyArtifactoryServer/artifactory/api/build/"

I get a set of results:

{
  "builds": [
    {
      "uri": "/someBuild",
      "lastStarted": "2017-02-15T22:02:49.066+0000"
    },
    {
      "uri": "/someOtherBuild",
      "lastStarted": "2017-02-15T21:45:09.590+0000"
    }, 
      "uri": "/someThirdBuild",
      "lastStarted": "2017-02-15T21:17:38.794+0000"
    }
],
  "uri": "https://myArtifactoryServer/artifactory/api/build"
}

so I know that there are builds in my Artifactory

however, when I make the following curl, which I believe to be requesting all builds with any name, I get no results

curl -X POST -H "X-JFrog-Art-Api: myArtifactroyKey" -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -d 'builds.find({"name": {"$match":"*"}})' "https://MyArtifactoryServer/artifactory/api/search/aql"

returns:

{
  "results": [],
  "range": {
    "start_pos": 0,
    "end_pos": 0,
    "total": 0
  }
}

I've been able to get results when using items.find() but have not had any luck with builds.find() Is there something that I'm missing?

My overall intention is to have a Query that returns the most recent build information of a specific build based on the name but I have been unable to get even the most simple of Query against the build domain object to work.

Thanks in advance for the help.

like image 637
bobalink Avatar asked Oct 18 '22 17:10

bobalink


1 Answers

The answer might be related to permissions. If the API key you are using belong to a non admin user than it can explain the situation.
Querying the build domain using AQL requires admin permissions, while the "All Builds" API only requires a privileged user.

like image 66
Dror Bereznitsky Avatar answered Oct 21 '22 03:10

Dror Bereznitsky