You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过REST API执行AQL查询查找Artifactory特定属性值的制品

How to Run Your AQL Query via Artifactory REST API

Got it, let's break down exactly how to execute that AQL search using Artifactory's REST API. It's a simple POST request once you have the right pieces in place.

Key Details First

  • Endpoint: You'll use the api/search/aql endpoint (append this to your Artifactory base URL, e.g., https://your-artifactory-url.com/artifactory/api/search/aql)
  • Request Method: POST (AQL queries are always sent as POST requests)
  • Authentication: Artifactory requires valid credentials—use your username + password, or username + API key (API keys are more secure for automation)

Example with curl (Most Common for Automation)

Here's a ready-to-use curl command you can adapt:

curl -u your-username:your-password-or-api-key -X POST "https://your-artifactory-instance.com/artifactory/api/search/aql" -d 'items.find({"@some_property" : {"$eq" : "some_value"}})'

A quick breakdown of the parts:

  • -u: Handles basic authentication—replace the placeholder with your actual credentials
  • -X POST: Explicitly sets the request method to POST
  • -d: Passes your AQL query as the request body. Wrap the query in single quotes to avoid shell escaping issues on most systems.

Example with Postman (For Testing/Manual Queries)

If you prefer a GUI tool:

  1. Open Postman and create a new POST request
  2. Enter your full Artifactory AQL endpoint URL (e.g., https://your-artifactory-url.com/artifactory/api/search/aql)
  3. Go to the Authorization tab, select Basic Auth, and input your Artifactory username and password/api key
  4. Switch to the Body tab, select raw, set the format dropdown to Text, then paste your AQL query:
    items.find({"@some_property" : {"$eq" : "some_value"}})
    
  5. Click Send—you'll get a JSON response with all artifacts that match your property filter.

What to Expect in the Response

The response will be a JSON object with a results array containing all matching items. Each item includes details like path, name, repo, properties, and more.

内容的提问来源于stack exchange,提问作者yiaca

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 07:29:17