diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-10-18 20:10:08 +0200 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-10-31 13:42:29 +0100 |
commit | a4827ee2b9a5dd51356a4e11455c0075fe6cea69 (patch) | |
tree | 178aa0e6c5bf0c322690c8d9f5d5f335e195e2f0 /lib/api/system_hooks.rb | |
parent | 76690017e28c2e42e58130fe64d7feb92d085b01 (diff) | |
download | gitlab-ce-a4827ee2b9a5dd51356a4e11455c0075fe6cea69.tar.gz |
Be able to POST subscriptions for system hooks
Diffstat (limited to 'lib/api/system_hooks.rb')
-rw-r--r-- | lib/api/system_hooks.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/system_hooks.rb b/lib/api/system_hooks.rb index 794e34874f4..ca95c044ecc 100644 --- a/lib/api/system_hooks.rb +++ b/lib/api/system_hooks.rb @@ -19,10 +19,14 @@ module API success Entities::Hook end params do - requires :url, type: String, desc: 'The URL for the system hook' + requires :url, type: String, desc: "The URL to send the request to" + optional :token, type: String, desc: 'The token used to validate payloads' + optional :push_events, type: Boolean, desc: "Trigger hook on push events" + optional :tag_push_events, type: Boolean, desc: "Trigger hook on tag push events" + optional :enable_ssl_verification, type: Boolean, desc: "Do SSL verification when triggering the hook" end post do - hook = SystemHook.new declared(params).to_h + hook = SystemHook.new declared(params, include_missing: false).to_h if hook.save present hook, with: Entities::Hook |