module Gitlab::Client::SystemHooks

Defines methods related to system hooks. @see docs.gitlab.com/ce/api/system_hooks.html

Public Instance Methods

add_hook(url, options = {}) click to toggle source

Adds a new system hook.

@example

Gitlab.add_hook('http://example.com/hook')
Gitlab.add_system_hook('https://api.example.net/v1/hook')

@param [String] url The hook URL. @param [Hash] options Additional options, as allowed by Gitlab API, including but not limited to: @option options [String] :token A secret token for Gitlab to send in the `X-Gitlab-Token` header for authentication. @option options [boolean] :enable_ssl_verification `false` will cause Gitlab to ignore invalid/unsigned certificate errors (default is `true`) @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/system_hooks.rb, line 33
def add_hook(url, options = {})
  post('/hooks', body: options.merge(url: url))
end
Also aliased as: add_system_hook
add_system_hook(url, options = {})
Alias for: add_hook
delete_hook(id) click to toggle source

Deletes a new system hook.

@example

Gitlab.delete_hook(3)
Gitlab.delete_system_hook(12)

@param [Integer] id The ID of a system hook. @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/system_hooks.rb, line 59
def delete_hook(id)
  delete("/hooks/#{id}")
end
Also aliased as: delete_system_hook
delete_system_hook(id)
Alias for: delete_hook
hook(id) click to toggle source

Tests a system hook.

@example

Gitlab.hook(3)
Gitlab.system_hook(12)

@param [Integer] id The ID of a system hook. @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/system_hooks.rb, line 46
def hook(id)
  get("/hooks/#{id}")
end
Also aliased as: system_hook
hooks(options = {}) click to toggle source

Gets a list of system hooks.

@example

Gitlab.hooks
Gitlab.system_hooks

@param [Hash] options A customizable set of options. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/system_hooks.rb, line 17
def hooks(options = {})
  get('/hooks', query: options)
end
Also aliased as: system_hooks
system_hook(id)
Alias for: hook
system_hooks(options = {})
Alias for: hooks