[英]how to find artifacts from jfrog artifactory that have a specific property value using REST API
I want to search for all the artifacts in my artifactory that have some property filed-我想在我的工件中搜索所有具有某些属性的工件-
items.find({"@some_property" : {"$eq" : "some_value"}})
How can I do it while using REST API?使用 REST API 时我该怎么做?
Here is an example:这是一个例子:
Following AQL query遵循 AQL 查询
items.find(
{
"repo":{"$eq":"mymavenrepo"},
"name": {"$match" : "*.jar"}
}
)
can be translated to this REST call可以翻译成这个 REST 调用
http://localhost/artifactory/api/search/artifact?name=*jar&re
pos=jcenter-cache
Easier with JFrog CLI :使用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"
]
}
}
]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.