I want to search for all the artifacts in Artifactory that have some property field:
items.find({"@some_property" : {"$eq" : "some_value"}})
How can I do it using a REST API?
I want to search for all the artifacts in Artifactory that have some property field:
items.find({"@some_property" : {"$eq" : "some_value"}})
How can I do it using a REST API?
Easier with JFrog CLI:
jfrog rt s '*' --props some_property=some_value
Example results:
[Info] Searching artifacts...
[Info] Found 1 artifact.
[
{
"path": "generic-local/hello",
"type": "file",
"size": 6,
"created": "2020-11-29T14:00:18.410Z",
"modified": "2020-11-29T14:00:18.222Z",
"sha1": "f572d396fae9206628714fb2ce00f72e94f2258f",
"md5": "b1946ac92492d2347c6235b4d2611184",
"props": {
"some_property": [
"some_value"
]
}
}
]
You can use the AQL REST API method, for example:
curl -uuser:password -H "content-type: text/plain" -XPOST http://localhost:8081/artifactory/api/search/aql -d "items.find({\"@foo\" : {\"\$eq\" : \"bar\"}})"
Here is an example:
Following AQL query
can be translated to this REST call