查看REST API支持的所有命令:
$ ssh -p 29418 user@gerrit.host gerrit –help
gerrit [COMMAND] [ARG ...] [--] [--help (-h)]
-- : end of options
--help (-h) : display this help text
Available commands of gerrit are:
apropos Search in Gerrit documentation
ban-commit Ban a commit from a project's repository
close-connection Close the specified SSH connection
create-account Create a new batch/role account
create-branch Create a new branch
create-group Create a new account group
create-project Create a new project and associated Git repository
flush-caches Flush some/all server caches from memory
gc Run Git garbage collection
gsql Administrative interface to active database
index
logging
ls-groups List groups visible to the caller
ls-members List the members of a given group
ls-projects List projects visible to the caller
ls-user-refs List refs visible to a specific user
plugin
query Query the change database
receive-pack Standard Git server side command for client side git push
rename-group Rename an account group
review Apply reviews to one or more patch sets
set-account Change an account's settings
set-head Change HEAD reference for a project
set-members Modify members of specific group or number of groups
set-project Change a project's settings
set-project-parent Change the project permissions are inherited from
set-reviewers Add or remove reviewers on a change
show-caches Display current cache statistics
show-connections Display active client SSH connections
show-queue Display the background work queues
stream-events Monitor events occurring in real time
test-submit
version Display gerrit version
可以单独查看某个子命令的详细信息,如下:
$ ssh -p 29418 user@gerrit.host gerrit set-reviewers --help
gerrit set-reviewers CHANGE ... [--] [--add (-a) REVIEWER] [--help (-h)] [--project (-p) PROJECT] [--remove (-r) REVIEWER]
CHANGE : changes to modify
-- : end of options
--add (-a) REVIEWER : user or group that should be added as reviewer
--help (-h) : display this help text
--project (-p) PROJECT : project containing the change
--remove (-r) REVIEWER : user that should be removed from the reviewer list
注意:
不同版本的gerrit 的REST API在格式上会有细微差别.请使用对应版本的API接口访问gerrit服务器.