如何在 AQL 中返回包名称和校验和

发布于 2025-01-16 11:47:44 字数 492 浏览 4 评论 0原文

我正在使用 JSON 文件来填充我的查询,如下所示:

{
  "files": [
    {
      "aql": {
        "items.find": {
          "repo": "my-fake-repo",
          "path": {"$match": "my-fake-path"}
         }
        }
      }
    ]
}

我只想包含该 repo 中文件的 name 及其 sha256总和。我尝试使用 .include() 选项,但它对我不起作用。有关在何处添加具有此结构的 .include() 标记的任何指导吗?再次使用 JSON 文件运行 jfrog rt s --spec 选项。

I am using a JSON file to populate my query that looks something like this:

{
  "files": [
    {
      "aql": {
        "items.find": {
          "repo": "my-fake-repo",
          "path": {"$match": "my-fake-path"}
         }
        }
      }
    ]
}

I would like to include only the name of the files in that repo and their sha256 sum. I've tried to use the .include() option, but it's not working for me. Any guidance on where to add the .include() tag with this structure? Again, using a JSON file to run jfrog rt s --spec option.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城仅有旧梦在 2025-01-23 11:47:44

您可以使用以下语法来获取存储库中工件的 SHA 值。

curl -u testuser:testpassword -X POST -H "Content-Type:text/plain" -d 'items.find().include("name","actual_sha1","actual_md5","sha256")' http://art.local/artifactory/api/search/aql
{
    "results" : [ {
      "name" : "log4j-core-2.15.0.jar",
      "actual_md5" : "81e0433ae00602c0e4d00424d213b0ab",
      "actual_sha1" : "ba55c13d7ac2fd44df9cc8074455719a33f375b9",
      "sha256" : "419a8512895971b7b4f4f33e620d361254e5c9552b904b0474b09ddd4a6a220b"
    },{
      "name" : "log4j-core-2.15.0.pom",
      "actual_md5" : "41625b02e58659e1ca93934cfae05adc",
      "actual_sha1" : "6981c8f221fc6aba9797bb119b113eb392df6b2d",
      "sha256" : "7c74c42fd7abae9ba61068ea11fb2a65f13407704994bb65fb57916c96cdc75c"
    },{
      "name" : "maven-metadata.xml",
      "actual_md5" : "085d0609db2dc21acd69e92e49d4536e",
      "actual_sha1" : "e7265bab56759973893a1942a9cb1d70ed624c79",
      "sha256" : "8b973243eedee7eb8708f305f1cf8215bf57714167545eb6a3c2a98891d43677"
    } ],
    "range" : {
      "start_pos" : 0,
      "end_pos" : 3,
      "total" : 3
    }
}

You can use the following syntax to get the SHA values of the artifacts within a repository.

curl -u testuser:testpassword -X POST -H "Content-Type:text/plain" -d 'items.find().include("name","actual_sha1","actual_md5","sha256")' http://art.local/artifactory/api/search/aql
{
    "results" : [ {
      "name" : "log4j-core-2.15.0.jar",
      "actual_md5" : "81e0433ae00602c0e4d00424d213b0ab",
      "actual_sha1" : "ba55c13d7ac2fd44df9cc8074455719a33f375b9",
      "sha256" : "419a8512895971b7b4f4f33e620d361254e5c9552b904b0474b09ddd4a6a220b"
    },{
      "name" : "log4j-core-2.15.0.pom",
      "actual_md5" : "41625b02e58659e1ca93934cfae05adc",
      "actual_sha1" : "6981c8f221fc6aba9797bb119b113eb392df6b2d",
      "sha256" : "7c74c42fd7abae9ba61068ea11fb2a65f13407704994bb65fb57916c96cdc75c"
    },{
      "name" : "maven-metadata.xml",
      "actual_md5" : "085d0609db2dc21acd69e92e49d4536e",
      "actual_sha1" : "e7265bab56759973893a1942a9cb1d70ed624c79",
      "sha256" : "8b973243eedee7eb8708f305f1cf8215bf57714167545eb6a3c2a98891d43677"
    } ],
    "range" : {
      "start_pos" : 0,
      "end_pos" : 3,
      "total" : 3
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文