【发布时间】:2017-05-19 19:20:51
【问题描述】:
有没有办法使用 AQL 下载工件?
我有一个查询发送给:
curl -u user:pass \
-X POST https://artifactoryURL/artifactory/api/search/aql \
-H 'content-type: text/plain' \
-T query.aql
还有我的query.aql:
items.find(
{
"repo":{"$eq":"repo"},
"$and": [
{
"path": { "$match": "path/*"},
"name": { "$match": "*.rpm"}
}
]
}
)
.sort({ "$desc": ["modified"] })
.limit(1)
现在我知道它会返回我想要的东西,有没有办法将请求从 api/search/aql 更改为 api/download/aql 并获取这些项目?
编辑:
我也曾尝试使用 jfrog cli 执行此操作,但它们在那里并不完全支持 AQL(排序和限制不起作用)。
这是我试过的命令:
jfrog rt s --spec=query-aql.json
以及未能对结果进行排序和限制的规范:
{
"files": [
{
"aql": {
"items.find": {
"repo": "repo",
"$and": [
{
"path": { "$match": "path/*"},
"name": { "$match": "*.rpm"}
}
]
}
},
"sort": {
"$asc": ["modified"]
},
"limit": 1
}
]
}
编辑 2:
添加了 jfrog-cli-go 问题:https://github.com/JFrogDev/jfrog-cli-go/issues/56
【问题讨论】:
标签: artifactory artifactory-query-lang jfrog-cli