Gerrit 通过 API 进行访问 Gerrit 提供 API 方式进行访问,访问特定的接口返回指定的 json 数据。 默认 Gerrit 的配置不开启这个功能,需要进行配置修改。
在使用 Gerrit 的帮助文档中给出示例 curl --digest --user username:password http://localhost:8080/a/path/to/api/ 这里的用户名和密码为红色内容。 实际使用中这个—digest 会加密导致无法访问需要去掉。 curl --user username:password http://localhost:8080/a/path/to/api/ 就可以正常返回数据。 Ruby 有个名为 gerry 的 gem 可以访问 Gerrit 的数据,同样有这个验证的问题。