AQL构建域对象不返回结果 [英] AQL build domain object does not return results

查看:91
本文介绍了AQL构建域对象不返回结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到一个问题,在使用AQL时,我无法获得我在构建域对象上进行的任何查询以返回

I'm running into an issue where I'm not able to get any of the queries I'm making on the build domain object to return when using AQL

当我进行以下卷曲时:

curl -X GET -H "X-JFrog-Art-Api: myArtifactroyKey" -H "Cache-Control: no-cache" "https://MyArtifactoryServer/artifactory/api/build/"

我得到了一组结果:

{
  "builds": [
    {
      "uri": "/someBuild",
      "lastStarted": "2017-02-15T22:02:49.066+0000"
    },
    {
      "uri": "/someOtherBuild",
      "lastStarted": "2017-02-15T21:45:09.590+0000"
    }, 
      "uri": "/someThirdBuild",
      "lastStarted": "2017-02-15T21:17:38.794+0000"
    }
],
  "uri": "https://myArtifactoryServer/artifactory/api/build"
}

所以我知道我的Artifactory中有建物

so I know that there are builds in my Artifactory

但是,当我进行以下卷曲时,我相信它会请求使用任何名称的所有版本,但没有任何结果

however, when I make the following curl, which I believe to be requesting all builds with any name, I get no results

curl -X POST -H "X-JFrog-Art-Api: myArtifactroyKey" -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -d 'builds.find({"name": {"$match":"*"}})' "https://MyArtifactoryServer/artifactory/api/search/aql"

返回:

{
  "results": [],
  "range": {
    "start_pos": 0,
    "end_pos": 0,
    "total": 0
  }
}

使用items.find()时我已经能够获得结果,但是builds.find()没有任何运气吗?

I've been able to get results when using items.find() but have not had any luck with builds.find() Is there something that I'm missing?

我的总体目的是拥有一个查询,该查询根据名称返回特定构建的最新构建信息,但是我无法针对构建域对象使用最简单的Query来工作.

My overall intention is to have a Query that returns the most recent build information of a specific build based on the name but I have been unable to get even the most simple of Query against the build domain object to work.

预先感谢您的帮助.

推荐答案

答案可能与权限有关.如果您使用的API密钥属于非管理员用户,则可以解释这种情况.
使用AQL查询构建域需要管理员权限,而所有构建" API仅需要特权用户.

The answer might be related to permissions. If the API key you are using belong to a non admin user than it can explain the situation.
Querying the build domain using AQL requires admin permissions, while the "All Builds" API only requires a privileged user.

这篇关于AQL构建域对象不返回结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆