list all builds(artifacts) in a repo on jfrog-artifactory using AQL(artifactory query language)

user6136315 picture user6136315 · Mar 30, 2016 · Viewed 9.8k times · Source

When ever I run the curl command it's throwing a syntax error. I've followed this documentation to list all artifacts in 'war-release' repo. No idea what's the issue.

$curl -u uname:password -X POST https://<artifactory.com>/artifactory/api/search/aql -d items.find({"repo":"war-release"})

-bash: syntax error near unexpected token `('

Answer

Gidi.S picture Gidi.S · May 9, 2016

Another option that doesn't requires to enclose the query with " or ' and works in most environments is to save the query to file, lets call it aql.query

items.find(
     {
          "repo":"war-release"
     }
)

and then run the following curl command from the same directory that contains the aql.query file (don't forget to replace the templates in the command with your user name, password, host and port).

curl -X POST -uuser:password 'http://host:port/artifactory/api/search/aql' -Taql.query