Module: Gitlab::Client::Services

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/services.rb

Instance Method Summary collapse

Instance Method Details

#change_service(project, service, params) ⇒ Boolean

Create/Edit service Full service params documentation: github.com/gitlabhq/gitlabhq/blob/master/doc/api/services.md

Examples:

Gitlab.change_service(42, :redmine, { new_issue_url: 'https://example.com/projects/test_project/issues/new',
                                      project_url: 'https://example.com/projects/test_project/issues',
                                      issues_url: 'https://example.com/issues/:id' })

Parameters:

  • project (Integer)

    The ID of a project.

  • service (String)

    A service code name.

  • params (Hash)

    A service parameters.

Returns:

  • (Boolean)


15
16
17
# File 'lib/gitlab/client/services.rb', line 15

def change_service(project, service, params)
  put("/projects/#{project}/services/#{correct_service_name(service)}", body: params)
end

#delete_service(project, service) ⇒ Boolean

Delete service

Examples:

Gitlab.delete_service(42, :redmine)

Parameters:

  • project (Integer)

    The ID of a project.

  • service (String)

    A service code name.

Returns:

  • (Boolean)


27
28
29
# File 'lib/gitlab/client/services.rb', line 27

def delete_service(project, service)
  delete("/projects/#{project}/services/#{correct_service_name(service)}")
end

#service(project, service) ⇒ Gitlab::ObjectifiedHash

Get service

Examples:

Gitlab.service(42, :redmine)

Parameters:

  • project (Integer)

    The ID of a project.

  • service (String)

    A service code name.

Returns:



39
40
41
# File 'lib/gitlab/client/services.rb', line 39

def service(project, service)
  get("/projects/#{project}/services/#{correct_service_name(service)}")
end