【问题标题】:what's the exact link to access Gerrit REST API?访问 Gerrit REST API 的确切链接是什么?
【发布时间】:2018-12-07 19:07:51
【问题描述】:

我正在尝试在我的项目中使用 Gerrit,我需要使用 REST API 访问此 gerrit。

我查看了此页面上的用户指南:https://gerrit-review.googlesource.com/Documentation/rest-api.html,但我很沮丧,因为我找不到命令行的确切链接地址。

比如我想获取服务器的版本信息,根据这个链接:https://gerrit-review.googlesource.com/Documentation/rest-api-config.html,我用这个命令:

$ curl -4 -G --digest --user user:password https://gerrit.xxx.com/gerrit/a/server/config/version HTTP/1.0
Unauthorizedcurl: (7) Failed connect to HTTP:80; No route to host
$

如果我使用http而不是https,是这样的:

$ curl -4 -G --digest --user user:password http://gerrit.xxx.com/gerrit/a/server/config/version HTTP/1.0
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://gerrit.xxx.com/gerrit/a/server/config/version">here</a>.</p>
</body></html>
curl: (7) Failed connect to HTTP:80; No route to host
$

而 TTT/PPP 是一个可以从这个 url 访问的项目:

https://gerrit.xxx.com/gerrit/#/admin/projects/TTT/PPP

我快要疯了,有人能帮帮我吗?

【问题讨论】:

    标签: rest api gerrit


    【解决方案1】:

    要获取服务器的版本信息,请执行以下操作:

    curl -s --user USER:PASS --request GET https://GERRIT-SERVER/a/config/server/version
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-10
      • 1970-01-01
      • 2016-09-12
      相关资源
      最近更新 更多