Reputation: 705
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 `('
Upvotes: 0
Views: 17471
Reputation: 661
To get a proper answer, you should use a content-type:
curl -X POST -k -u user:pwd -H "content-type: text/plain" 'https://xxx/artifactory/api/search/aql' -d 'items.find({"repo":"repo-local"})'
Upvotes: 0
Reputation: 386
curl -X POST -k -u user:pwd 'https://xxx/artifactory/api/search/aql' -d 'items.find({"repo":"repo-local"})' gives json output.
use single quotes -- This worked for me fine
Upvotes: 2
Reputation: 171
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
Upvotes: 6
Reputation: 974
Try this curl statement:
curl -u uname:password -X POST -d "items.find({"repo":"war-release"})" https:///artifactory/api/search/aql
Upvotes: 3