访问Gerrit REST API的确切链接是什么?

时间:2018-12-07 08:18:57

标签: rest api gerrit

我正在尝试在项目中使用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是一个可以从以下网址访问的项目:

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

我对此非常生气,有人可以帮我吗?

1 个答案:

答案 0 :(得分:0)

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

void* v = d; // -> need to go back via static_cast<D*>!

A* a    = static_cast<A*>(v);    // requires v = static_cast<A*>(d);
B<D>* d = static_cast<B<D>*>(v); // requires v = static_cast<B<D>*>(d);
相关问题