简体   繁体   English

如何使用 REST API 从 jfrog 工件中查找具有特定属性值的工件

[英]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"
      ]
    }
  }
]

You can use the AQL REST API method, for example:您可以使用AQL REST API 方法,例如:

curl -uuser:password -H "content-type: text/plain" -XPOST http://localhost:8081/artifactory/api/search/aql -d "items.find({\"@foo\" : {\"\$eq\" : \"bar\"}})"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用声明式管道将项目 Jar 作为 maven 工件发布到 Jfrog Artifactory - Publish project Jar as maven artifacts to Jfrog Artifactory using Declarative Pipeline Artifactory jfrog jenkins 无法按规范上传工件 - Artifactory jfrog jenkins failed uploading artifacts by spec 如何通过终端从 JFrog Artifactory 下载 Artifactory? - How to download Artifactory from JFrog Artifactory via terminal? 在 jfrog artifactory 中按属性搜索文件 - search file by property in jfrog artifactory 使用 Jenkins 管道为 Maven 工件设置分类器在 Jfrog Artifactory 中促进构建 - Set classifier for maven artifacts Promoting Builds in Jfrog Artifactory using Jenkins pipeline 在jenkins管道中将通用工件上传到JFrog Artifactory时,如何重命名现有文件夹 - How to rename existing folder while uploading generic artifacts to JFrog Artifactory in jenkins pipeline Jenkinsfile管道将工件存储到jfrog工件,文件名中带有sha校验和 - Jenkinsfile pipeline to store artifacts to jfrog artifactory with sha checksum in filename 如何对 jfrog 工件进行数字签名? - How to digital sign jfrog artifacts? 如何在 jfrog Artifactory 中获取子文件夹和文件的列表 - How to get a list of subfolders and files in jfrog Artifactory pip 使用 Jenkinsfile 从本地 pypi(JFROG 工件)安装 python package 和 dependencies.whl 文件 - pip install a python package and dependencies .whl file from local pypi (JFROG artifactory) using Jenkinsfile
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM