gitlab 4.6.0 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gitlab/client/access_requests.rb +92 -90
- data/lib/gitlab/client/award_emojis.rb +126 -124
- data/lib/gitlab/client/boards.rb +81 -79
- data/lib/gitlab/client/branches.rb +89 -87
- data/lib/gitlab/client/build_variables.rb +117 -115
- data/lib/gitlab/client/builds.rb +98 -96
- data/lib/gitlab/client/commits.rb +154 -152
- data/lib/gitlab/client/deployments.rb +29 -27
- data/lib/gitlab/client/environments.rb +80 -78
- data/lib/gitlab/client/events.rb +54 -52
- data/lib/gitlab/client/group_milestones.rb +85 -83
- data/lib/gitlab/client/groups.rb +178 -176
- data/lib/gitlab/client/issues.rb +190 -188
- data/lib/gitlab/client/jobs.rb +150 -148
- data/lib/gitlab/client/keys.rb +14 -12
- data/lib/gitlab/client/labels.rb +79 -77
- data/lib/gitlab/client/merge_request_approvals.rb +101 -99
- data/lib/gitlab/client/merge_requests.rb +279 -277
- data/lib/gitlab/client/milestones.rb +85 -83
- data/lib/gitlab/client/namespaces.rb +18 -16
- data/lib/gitlab/client/notes.rb +260 -258
- data/lib/gitlab/client/pipeline_schedules.rb +123 -121
- data/lib/gitlab/client/pipeline_triggers.rb +93 -91
- data/lib/gitlab/client/pipelines.rb +62 -60
- data/lib/gitlab/client/projects.rb +526 -524
- data/lib/gitlab/client/repositories.rb +67 -65
- data/lib/gitlab/client/repository_files.rb +103 -101
- data/lib/gitlab/client/runners.rb +114 -112
- data/lib/gitlab/client/services.rb +45 -43
- data/lib/gitlab/client/sidekiq.rb +32 -30
- data/lib/gitlab/client/snippets.rb +86 -84
- data/lib/gitlab/client/system_hooks.rb +57 -55
- data/lib/gitlab/client/tags.rb +88 -86
- data/lib/gitlab/client/todos.rb +40 -38
- data/lib/gitlab/client/users.rb +243 -241
- data/lib/gitlab/client/versions.rb +13 -11
- data/lib/gitlab/help.rb +1 -1
- data/lib/gitlab/version.rb +1 -1
- metadata +1 -1
@@ -1,51 +1,53 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Third party services connected to a project.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/services.html
|
6
|
+
module Services
|
7
|
+
# Create/Edit service
|
8
|
+
# Full service params documentation: https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/services.md
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# Gitlab.change_service(42, :redmine, { new_issue_url: 'https://example.com/projects/test_project/issues/new',
|
12
|
+
# project_url: 'https://example.com/projects/test_project/issues',
|
13
|
+
# issues_url: 'https://example.com/issues/:id' })
|
14
|
+
#
|
15
|
+
# @param [Integer, String] project The ID or name of a project.
|
16
|
+
# @param [String] service A service code name.
|
17
|
+
# @param [Hash] params A service parameters.
|
18
|
+
# @return [Boolean]
|
19
|
+
def change_service(project, service, params)
|
20
|
+
put("/projects/#{url_encode project}/services/#{correct_service_name(service)}", body: params)
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
# Delete service
|
24
|
+
#
|
25
|
+
# @example
|
26
|
+
# Gitlab.delete_service(42, :redmine)
|
27
|
+
#
|
28
|
+
# @param [Integer, String] project The ID or name of a project.
|
29
|
+
# @param [String] service A service code name.
|
30
|
+
# @return [Boolean]
|
31
|
+
def delete_service(project, service)
|
32
|
+
delete("/projects/#{url_encode project}/services/#{correct_service_name(service)}")
|
33
|
+
end
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
35
|
+
# Get service
|
36
|
+
#
|
37
|
+
# @example
|
38
|
+
# Gitlab.service(42, :redmine)
|
39
|
+
#
|
40
|
+
# @param [Integer, String] project The ID or name of a project.
|
41
|
+
# @param [String] service A service code name.
|
42
|
+
# @return [Gitlab::ObjectifiedHash]
|
43
|
+
def service(project, service)
|
44
|
+
get("/projects/#{url_encode project}/services/#{correct_service_name(service)}")
|
45
|
+
end
|
45
46
|
|
46
|
-
|
47
|
+
private
|
47
48
|
|
48
|
-
|
49
|
-
|
49
|
+
def correct_service_name(service)
|
50
|
+
service.to_s.tr('_', '-')
|
51
|
+
end
|
50
52
|
end
|
51
53
|
end
|
@@ -1,37 +1,39 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to sidekiq metrics.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/sidekiq_metrics.html
|
6
|
+
module Sidekiq
|
7
|
+
# Get the current Queue Metrics
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.sidekiq_queue_metrics
|
11
|
+
def sidekiq_queue_metrics
|
12
|
+
get('/sidekiq/queue_metrics')
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
# Get the current Process Metrics
|
16
|
+
#
|
17
|
+
# @example
|
18
|
+
# Gitlab.sidekiq_process_metrics
|
19
|
+
def sidekiq_process_metrics
|
20
|
+
get('/sidekiq/process_metrics')
|
21
|
+
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
23
|
+
# Get the current Job Statistics
|
24
|
+
#
|
25
|
+
# @example
|
26
|
+
# Gitlab.sidekiq_job_stats
|
27
|
+
def sidekiq_job_stats
|
28
|
+
get('/sidekiq/job_stats')
|
29
|
+
end
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
# Get a compound response of all the previously mentioned metrics
|
32
|
+
#
|
33
|
+
# @example
|
34
|
+
# Gitlab.sidekiq_compound_metrics
|
35
|
+
def sidekiq_compound_metrics
|
36
|
+
get('/sidekiq/compound_metrics')
|
37
|
+
end
|
36
38
|
end
|
37
39
|
end
|
@@ -1,93 +1,95 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to snippets.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/project_snippets.html
|
6
|
+
module Snippets
|
7
|
+
# Gets a list of project's snippets.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.snippets(42)
|
11
|
+
#
|
12
|
+
# @param [Integer, String] project The ID or name of a project.
|
13
|
+
# @param [Hash] options A customizable set of options.
|
14
|
+
# @option options [Integer] :page The page number.
|
15
|
+
# @option options [Integer] :per_page The number of results per page.
|
16
|
+
# @return [Gitlab::ObjectifiedHash]
|
17
|
+
def snippets(project, options = {})
|
18
|
+
get("/projects/#{url_encode project}/snippets", query: options)
|
19
|
+
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
# Gets information about a snippet.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# Gitlab.snippet(2, 14)
|
25
|
+
#
|
26
|
+
# @param [Integer, String] project The ID or name of a project.
|
27
|
+
# @param [Integer] id The ID of a snippet.
|
28
|
+
# @return [Gitlab::ObjectifiedHash]
|
29
|
+
def snippet(project, id)
|
30
|
+
get("/projects/#{url_encode project}/snippets/#{id}")
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
33
|
+
# Creates a new snippet.
|
34
|
+
#
|
35
|
+
# @example
|
36
|
+
# Gitlab.create_snippet(42, { title: 'REST', file_name: 'api.rb', code: 'some code', visibility: 'public'})
|
37
|
+
#
|
38
|
+
# @param [Integer, String] project The ID or name of a project.
|
39
|
+
# @param [Hash] options A customizable set of options.
|
40
|
+
# @option options [String] :title (required) The title of a snippet.
|
41
|
+
# @option options [String] :file_name (required) The name of a snippet file.
|
42
|
+
# @option options [String] :code (required) The content of a snippet.
|
43
|
+
# @option options [String] :lifetime (optional) The expiration date of a snippet.
|
44
|
+
# @option options [String] :visibility (required) The visibility of a snippet
|
45
|
+
# @return [Gitlab::ObjectifiedHash] Information about created snippet.
|
46
|
+
def create_snippet(project, options = {})
|
47
|
+
post("/projects/#{url_encode project}/snippets", body: options)
|
48
|
+
end
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
50
|
+
# Updates a snippet.
|
51
|
+
#
|
52
|
+
# @example
|
53
|
+
# Gitlab.edit_snippet(42, 34, { file_name: 'README.txt' })
|
54
|
+
#
|
55
|
+
# @param [Integer, String] project The ID or name of a project.
|
56
|
+
# @param [Integer] id The ID of a snippet.
|
57
|
+
# @param [Hash] options A customizable set of options.
|
58
|
+
# @option options [String] :title The title of a snippet.
|
59
|
+
# @option options [String] :file_name The name of a snippet file.
|
60
|
+
# @option options [String] :code The content of a snippet.
|
61
|
+
# @option options [String] :lifetime The expiration date of a snippet.
|
62
|
+
# @option options [String] :visibility (optional) The visibility of a snippet
|
63
|
+
# @return [Gitlab::ObjectifiedHash] Information about updated snippet.
|
64
|
+
def edit_snippet(project, id, options = {})
|
65
|
+
put("/projects/#{url_encode project}/snippets/#{id}", body: options)
|
66
|
+
end
|
66
67
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
68
|
+
# Deletes a snippet.
|
69
|
+
#
|
70
|
+
# @example
|
71
|
+
# Gitlab.delete_snippet(2, 14)
|
72
|
+
#
|
73
|
+
# @param [Integer, String] project The ID or name of a project.
|
74
|
+
# @param [Integer] id The ID of a snippet.
|
75
|
+
# @return [Gitlab::ObjectifiedHash] Information about deleted snippet.
|
76
|
+
def delete_snippet(project, id)
|
77
|
+
delete("/projects/#{url_encode project}/snippets/#{id}")
|
78
|
+
end
|
78
79
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
80
|
+
# Returns raw project snippet content as plain text.
|
81
|
+
#
|
82
|
+
# @example
|
83
|
+
# Gitlab.snippet_content(2, 14)
|
84
|
+
#
|
85
|
+
# @param [Integer, String] project The ID or name of a project.
|
86
|
+
# @param [Integer] id The ID of a snippet.
|
87
|
+
# @return [Gitlab::ObjectifiedHash] Information about deleted snippet.
|
88
|
+
def snippet_content(project, id)
|
89
|
+
get("/projects/#{url_encode project}/snippets/#{id}/raw",
|
90
|
+
format: nil,
|
91
|
+
headers: { Accept: 'text/plain' },
|
92
|
+
parser: ::Gitlab::Request::Parser)
|
93
|
+
end
|
92
94
|
end
|
93
95
|
end
|
@@ -1,62 +1,64 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to system hooks.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/system_hooks.html
|
6
|
+
module SystemHooks
|
7
|
+
# Gets a list of system hooks.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.hooks
|
11
|
+
# Gitlab.system_hooks
|
12
|
+
#
|
13
|
+
# @param [Hash] options A customizable set of options.
|
14
|
+
# @option options [Integer] :page The page number.
|
15
|
+
# @option options [Integer] :per_page The number of results per page.
|
16
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
17
|
+
def hooks(options = {})
|
18
|
+
get('/hooks', query: options)
|
19
|
+
end
|
20
|
+
alias system_hooks hooks
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
22
|
+
# Adds a new system hook.
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# Gitlab.add_hook('http://example.com/hook')
|
26
|
+
# Gitlab.add_system_hook('https://api.example.net/v1/hook')
|
27
|
+
#
|
28
|
+
# @param [String] url The hook URL.
|
29
|
+
# @param [Hash] options Additional options, as allowed by Gitlab API, including but not limited to:
|
30
|
+
# @option options [String] :token A secret token for Gitlab to send in the `X-Gitlab-Token` header for authentication.
|
31
|
+
# @option options [boolean] :enable_ssl_verification `false` will cause Gitlab to ignore invalid/unsigned certificate errors (default is `true`)
|
32
|
+
# @return [Gitlab::ObjectifiedHash]
|
33
|
+
def add_hook(url, options = {})
|
34
|
+
post('/hooks', body: options.merge(url: url))
|
35
|
+
end
|
36
|
+
alias add_system_hook add_hook
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
38
|
+
# Tests a system hook.
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# Gitlab.hook(3)
|
42
|
+
# Gitlab.system_hook(12)
|
43
|
+
#
|
44
|
+
# @param [Integer] id The ID of a system hook.
|
45
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
46
|
+
def hook(id)
|
47
|
+
get("/hooks/#{id}")
|
48
|
+
end
|
49
|
+
alias system_hook hook
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
51
|
+
# Deletes a new system hook.
|
52
|
+
#
|
53
|
+
# @example
|
54
|
+
# Gitlab.delete_hook(3)
|
55
|
+
# Gitlab.delete_system_hook(12)
|
56
|
+
#
|
57
|
+
# @param [Integer] id The ID of a system hook.
|
58
|
+
# @return [Gitlab::ObjectifiedHash]
|
59
|
+
def delete_hook(id)
|
60
|
+
delete("/hooks/#{id}")
|
61
|
+
end
|
62
|
+
alias delete_system_hook delete_hook
|
60
63
|
end
|
61
|
-
alias delete_system_hook delete_hook
|
62
64
|
end
|