gitlab 4.5.0 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/stale.yml +18 -0
- data/.rubocop_todo.yml +46 -0
- data/Gemfile +2 -0
- data/README.md +22 -22
- data/Rakefile +3 -5
- data/bin/console +1 -0
- data/exe/gitlab +5 -1
- data/gitlab.gemspec +9 -6
- data/lib/gitlab.rb +6 -3
- data/lib/gitlab/api.rb +5 -3
- data/lib/gitlab/cli.rb +11 -5
- data/lib/gitlab/cli_helpers.rb +31 -22
- data/lib/gitlab/client.rb +7 -8
- data/lib/gitlab/client/access_requests.rb +100 -93
- data/lib/gitlab/client/award_emojis.rb +127 -127
- data/lib/gitlab/client/boards.rb +82 -82
- data/lib/gitlab/client/branches.rb +89 -89
- data/lib/gitlab/client/build_variables.rb +117 -117
- data/lib/gitlab/client/builds.rb +98 -98
- data/lib/gitlab/client/commits.rb +154 -154
- data/lib/gitlab/client/deployments.rb +29 -29
- data/lib/gitlab/client/environments.rb +80 -80
- data/lib/gitlab/client/events.rb +54 -54
- data/lib/gitlab/client/group_milestones.rb +85 -86
- data/lib/gitlab/client/groups.rb +178 -178
- data/lib/gitlab/client/issues.rb +195 -196
- data/lib/gitlab/client/jobs.rb +150 -150
- data/lib/gitlab/client/keys.rb +14 -14
- data/lib/gitlab/client/labels.rb +79 -79
- data/lib/gitlab/client/merge_request_approvals.rb +102 -102
- data/lib/gitlab/client/merge_requests.rb +281 -256
- data/lib/gitlab/client/milestones.rb +85 -85
- data/lib/gitlab/client/namespaces.rb +18 -18
- data/lib/gitlab/client/notes.rb +260 -260
- data/lib/gitlab/client/pipeline_schedules.rb +123 -123
- data/lib/gitlab/client/pipeline_triggers.rb +93 -93
- data/lib/gitlab/client/pipelines.rb +62 -62
- data/lib/gitlab/client/projects.rb +526 -505
- data/lib/gitlab/client/repositories.rb +68 -55
- data/lib/gitlab/client/repository_files.rb +103 -103
- data/lib/gitlab/client/runners.rb +113 -115
- data/lib/gitlab/client/services.rb +46 -45
- data/lib/gitlab/client/sidekiq.rb +32 -32
- data/lib/gitlab/client/snippets.rb +86 -86
- data/lib/gitlab/client/system_hooks.rb +57 -57
- data/lib/gitlab/client/tags.rb +87 -88
- data/lib/gitlab/client/todos.rb +41 -41
- data/lib/gitlab/client/users.rb +242 -228
- data/lib/gitlab/client/versions.rb +16 -0
- data/lib/gitlab/configuration.rb +7 -5
- data/lib/gitlab/error.rb +3 -1
- data/lib/gitlab/file_response.rb +4 -2
- data/lib/gitlab/help.rb +9 -9
- data/lib/gitlab/objectified_hash.rb +5 -4
- data/lib/gitlab/page_links.rb +9 -7
- data/lib/gitlab/paginated_response.rb +14 -4
- data/lib/gitlab/request.rb +8 -5
- data/lib/gitlab/shell.rb +6 -4
- data/lib/gitlab/shell_history.rb +7 -5
- data/lib/gitlab/version.rb +3 -1
- metadata +8 -5
@@ -1,59 +1,72 @@
|
|
1
|
-
|
2
|
-
# Defines methods related to repositories.
|
3
|
-
# @see https://docs.gitlab.com/ce/api/repositories.html
|
4
|
-
module Repositories
|
5
|
-
# Get file tree project (root level).
|
6
|
-
#
|
7
|
-
# @example
|
8
|
-
# Gitlab.tree(42)
|
9
|
-
# Gitlab.tree(42, { path: 'Gemfile' })
|
10
|
-
#
|
11
|
-
# @param [Integer, String] project The ID or name of a project.
|
12
|
-
# @param [Hash] options A customizable set of options.
|
13
|
-
# @option options [String] :path The path inside repository.
|
14
|
-
# @option options [String] :ref_name The name of a repository branch or tag.
|
15
|
-
# @return [Gitlab::ObjectifiedHash]
|
16
|
-
def tree(project, options={})
|
17
|
-
get("/projects/#{url_encode project}/repository/tree", query: options)
|
18
|
-
end
|
19
|
-
alias_method :repo_tree, :tree
|
1
|
+
# frozen_string_literal: true
|
20
2
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
3
|
+
# Defines methods related to repositories.
|
4
|
+
# @see https://docs.gitlab.com/ce/api/repositories.html
|
5
|
+
module Repositories
|
6
|
+
# Get file tree project (root level).
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# Gitlab.tree(42)
|
10
|
+
# Gitlab.tree(42, { path: 'Gemfile' })
|
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 [String] :path The path inside repository.
|
15
|
+
# @option options [String] :ref_name The name of a repository branch or tag.
|
16
|
+
# @return [Gitlab::ObjectifiedHash]
|
17
|
+
def tree(project, options = {})
|
18
|
+
get("/projects/#{url_encode project}/repository/tree", query: options)
|
19
|
+
end
|
20
|
+
alias repo_tree tree
|
21
|
+
|
22
|
+
# Get project repository archive
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# Gitlab.repo_archive(42)
|
26
|
+
# Gitlab.repo_archive(42, 'deadbeef')
|
27
|
+
#
|
28
|
+
# @param [Integer, String] project The ID or name of a project.
|
29
|
+
# @param [String] ref The commit sha, branch, or tag to download.
|
30
|
+
# @return [Gitlab::FileResponse]
|
31
|
+
def repo_archive(project, ref = 'master')
|
32
|
+
get("/projects/#{url_encode project}/repository/archive",
|
33
|
+
format: nil,
|
34
|
+
headers: { Accept: 'application/octet-stream' },
|
35
|
+
query: { sha: ref },
|
36
|
+
parser: proc { |body, _|
|
37
|
+
if body.encoding == Encoding::ASCII_8BIT # binary response
|
38
|
+
::Gitlab::FileResponse.new StringIO.new(body, 'rb+')
|
39
|
+
else # error with json response
|
40
|
+
::Gitlab::Request.parse(body)
|
41
|
+
end
|
42
|
+
})
|
43
|
+
end
|
44
|
+
|
45
|
+
# Compares branches, tags or commits.
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
# Gitlab.compare(42, 'master', 'feature/branch')
|
49
|
+
# Gitlab.repo_compare(42, 'master', 'feature/branch')
|
50
|
+
#
|
51
|
+
# @param [Integer] project The ID of a project.
|
52
|
+
# @param [String] from The commit SHA or branch name of from branch.
|
53
|
+
# @param [String] to The commit SHA or branch name of to branch.
|
54
|
+
# @return [Gitlab::ObjectifiedHash]
|
55
|
+
def compare(project, from, to)
|
56
|
+
get("/projects/#{url_encode project}/repository/compare", query: { from: from, to: to })
|
57
|
+
end
|
58
|
+
alias repo_compare compare
|
43
59
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
get("/projects/#{url_encode project}/repository/compare", query: { from: from, to: to })
|
56
|
-
end
|
57
|
-
alias_method :repo_compare, :compare
|
60
|
+
# Get the common ancestor for 2 refs (commit SHAs, branch names or tags).
|
61
|
+
#
|
62
|
+
# @example
|
63
|
+
# Gitlab.merge_base(42, ['master', 'feature/branch'])
|
64
|
+
# Gitlab.merge_base(42, ['master', 'feature/branch'])
|
65
|
+
#
|
66
|
+
# @param [Integer, String] project The ID or URL-encoded path of the project.
|
67
|
+
# @param [Array] refs Array containing 2 commit SHAs, branch names, or tags.
|
68
|
+
# @return [Gitlab::ObjectifiedHash]
|
69
|
+
def merge_base(project, refs)
|
70
|
+
get("/projects/#{url_encode project}/repository/merge_base", query: { refs: refs })
|
58
71
|
end
|
59
72
|
end
|
@@ -1,113 +1,113 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'base64'
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
alias_method :repo_file_contents, :file_contents
|
5
|
+
# Defines methods related to repository files.
|
6
|
+
# @see https://docs.gitlab.com/ce/api/repository_files.html
|
7
|
+
module RepositoryFiles
|
8
|
+
# Get the contents of a file
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# Gitlab.file_contents(42, 'Gemfile')
|
12
|
+
# Gitlab.repo_file_contents(3, 'Gemfile', 'ed899a2f4b50b4370feeea94676502b42383c746')
|
13
|
+
#
|
14
|
+
# @param [Integer, String] project The ID or name of a project.
|
15
|
+
# @param [String] filepath The relative path of the file in the repository
|
16
|
+
# @param [String] ref The name of a repository branch or tag or if not given the default branch.
|
17
|
+
# @return [String]
|
18
|
+
def file_contents(project, filepath, ref = 'master')
|
19
|
+
get "/projects/#{url_encode project}/repository/files/#{url_encode filepath}/raw",
|
20
|
+
query: { ref: ref },
|
21
|
+
format: nil,
|
22
|
+
headers: { Accept: 'text/plain' },
|
23
|
+
parser: ::Gitlab::Request::Parser
|
24
|
+
end
|
25
|
+
alias repo_file_contents file_contents
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
27
|
+
# Gets a repository file.
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
# Gitlab.get_file(42, "README.md", "master")
|
31
|
+
#
|
32
|
+
# @param [Integer, String] project The ID or name of a project.
|
33
|
+
# @param [String] file_path The full path of the file.
|
34
|
+
# @param [String] ref The name of branch, tag or commit.
|
35
|
+
# @return [Gitlab::ObjectifiedHash]
|
36
|
+
def get_file(project, file_path, ref)
|
37
|
+
get("/projects/#{url_encode project}/repository/files/#{url_encode file_path}", query: {
|
38
|
+
ref: ref
|
39
|
+
})
|
40
|
+
end
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
42
|
+
# Creates a new repository file.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
# Gitlab.create_file(42, "path", "branch", "content", "commit message")
|
46
|
+
#
|
47
|
+
# @param [Integer, String] project The ID or name of a project.
|
48
|
+
# @param [String] path full path to new file.
|
49
|
+
# @param [String] branch the name of the branch.
|
50
|
+
# @param [String] content file content.
|
51
|
+
# @param [String] commit_message ...commit message.
|
52
|
+
# @param [Hash] options Optional additional details for commit
|
53
|
+
# @option options [String] :author_name Commit author's name
|
54
|
+
# @option options [String] :author_email Commit author's email address
|
55
|
+
# @return [Gitlab::ObjectifiedHash]
|
56
|
+
def create_file(project, path, branch, content, commit_message, options = {})
|
57
|
+
post("/projects/#{url_encode project}/repository/files/#{url_encode path}", body: {
|
58
|
+
branch: branch,
|
59
|
+
commit_message: commit_message
|
60
|
+
}.merge(options).merge(encoded_content_attributes(content)))
|
61
|
+
end
|
61
62
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
63
|
+
# Edits an existing repository file.
|
64
|
+
#
|
65
|
+
# @example
|
66
|
+
# Gitlab.edit_file(42, "path", "branch", "content", "commit message")
|
67
|
+
#
|
68
|
+
# @param [Integer, String] project The ID or name of a project.
|
69
|
+
# @param [String] path full path of file to update.
|
70
|
+
# @param [String] branch the name of the branch to commit changes to.
|
71
|
+
# @param [String] content new file content.
|
72
|
+
# @param [String] commit_message ...commit message.
|
73
|
+
# @param [Hash] options Optional additional details for commit
|
74
|
+
# @option options [String] :author_name Commit author's name
|
75
|
+
# @option options [String] :author_email Commit author's email address
|
76
|
+
# @return [Gitlab::ObjectifiedHash]
|
77
|
+
def edit_file(project, path, branch, content, commit_message, options = {})
|
78
|
+
put("/projects/#{url_encode project}/repository/files/#{url_encode path}", body: {
|
79
|
+
branch: branch,
|
80
|
+
commit_message: commit_message
|
81
|
+
}.merge(options).merge(encoded_content_attributes(content)))
|
82
|
+
end
|
82
83
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
84
|
+
# Removes an existing repository file.
|
85
|
+
#
|
86
|
+
# @example
|
87
|
+
# Gitlab.remove_file(42, "path", "branch", "commit message")
|
88
|
+
#
|
89
|
+
# @param [Integer, String] project The ID or name of a project.
|
90
|
+
# @param [String] path full path of file to delete.
|
91
|
+
# @param [String] branch the name of the branch to commit the deletion to.
|
92
|
+
# @param [String] commit_message ...a commit message ;)
|
93
|
+
# @param [Hash] options Optional additional details for commit
|
94
|
+
# @option options [String] :author_name Commit author's name
|
95
|
+
# @option options [String] :author_email Commit author's email address
|
96
|
+
# @return [Gitlab::ObjectifiedHash]
|
97
|
+
def remove_file(project, path, branch, commit_message, options = {})
|
98
|
+
delete("/projects/#{url_encode project}/repository/files/#{url_encode path}",
|
99
|
+
body: {
|
100
|
+
branch: branch,
|
101
|
+
commit_message: commit_message
|
102
|
+
}.merge(options))
|
103
|
+
end
|
103
104
|
|
104
|
-
|
105
|
+
private
|
105
106
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
107
|
+
def encoded_content_attributes(content)
|
108
|
+
{
|
109
|
+
encoding: 'base64',
|
110
|
+
content: Base64.encode64(content)
|
111
|
+
}
|
112
112
|
end
|
113
113
|
end
|
@@ -1,126 +1,124 @@
|
|
1
|
-
|
2
|
-
# Defines methods related to runners.
|
3
|
-
# @see https://docs.gitlab.com/ce/api/runners.html
|
4
|
-
module Runners
|
1
|
+
# frozen_string_literal: true
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
#
|
24
|
-
# @example
|
25
|
-
# Gitlab.all_runners
|
26
|
-
#
|
27
|
-
# @param [Hash] options A customizable set of options.
|
28
|
-
# @option options [String] :scope The scope of runners to show, one of: specific, shared, active, paused, online; showing all runners if none provided
|
29
|
-
# @return [Array<Gitlab::ObjectifiedHash>]
|
30
|
-
def all_runners(options = {})
|
31
|
-
get("/runners/all", query: options)
|
32
|
-
end
|
3
|
+
# Defines methods related to runners.
|
4
|
+
# @see https://docs.gitlab.com/ce/api/runners.html
|
5
|
+
module Runners
|
6
|
+
# Get a list of specific runners available to the user.
|
7
|
+
# @see https://docs.gitlab.com/ce/api/runners.html#list-owned-runners
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.runners
|
11
|
+
# Gitlab.runners(:active)
|
12
|
+
# Gitlab.runners(:paused)
|
13
|
+
#
|
14
|
+
# @param [Hash] options A customizable set of options.
|
15
|
+
# @option options [String] :scope The scope of specific runners to show, one of: active, paused, online; showing all runners if none provided
|
16
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
17
|
+
def runners(options = {})
|
18
|
+
get('/runners', query: options)
|
19
|
+
end
|
33
20
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
21
|
+
# Get a list of all runners in the GitLab instance (specific and shared). Access is restricted to users with admin privileges.
|
22
|
+
# @see https://docs.gitlab.com/ce/api/runners.html#list-all-runners
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
# Gitlab.all_runners
|
26
|
+
#
|
27
|
+
# @param [Hash] options A customizable set of options.
|
28
|
+
# @option options [String] :scope The scope of runners to show, one of: specific, shared, active, paused, online; showing all runners if none provided
|
29
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
30
|
+
def all_runners(options = {})
|
31
|
+
get('/runners/all', query: options)
|
32
|
+
end
|
45
33
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
# @option options [String] :tag_list The list of tags for a runner; put array of tags, that should be finally assigned to a runner
|
58
|
-
# @return <Gitlab::ObjectifiedHash>
|
59
|
-
def update_runner(id, options={})
|
60
|
-
put("/runners/#{id}", query: options)
|
61
|
-
end
|
34
|
+
# Get details of a runner..
|
35
|
+
# @see https://docs.gitlab.com/ce/api/runners.html#get-runners-details
|
36
|
+
#
|
37
|
+
# @example
|
38
|
+
# Gitlab.runner(42)
|
39
|
+
#
|
40
|
+
# @param [Integer, String] id The ID of a runner
|
41
|
+
# @return <Gitlab::ObjectifiedHash>
|
42
|
+
def runner(id)
|
43
|
+
get("/runners/#{id}")
|
44
|
+
end
|
62
45
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
46
|
+
# Update details of a runner.
|
47
|
+
# @see https://docs.gitlab.com/ce/api/runners.html#update-runners-details
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
# Gitlab.update_runner(42, { description: 'Awesome runner' })
|
51
|
+
# Gitlab.update_runner(42, { active: false })
|
52
|
+
# Gitlab.update_runner(42, { tag_list: [ 'awesome', 'runner' ] })
|
53
|
+
#
|
54
|
+
# @param [Integer, String] id The ID of a runner
|
55
|
+
# @param [Hash] options A customizable set of options.
|
56
|
+
# @option options [String] :active The state of a runner; can be set to true or false.
|
57
|
+
# @option options [String] :tag_list The list of tags for a runner; put array of tags, that should be finally assigned to a runner
|
58
|
+
# @return <Gitlab::ObjectifiedHash>
|
59
|
+
def update_runner(id, options = {})
|
60
|
+
put("/runners/#{id}", query: options)
|
61
|
+
end
|
74
62
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
63
|
+
# Remove a runner.
|
64
|
+
# @see https://docs.gitlab.com/ce/api/runners.html#remove-a-runner
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# Gitlab.delete_runner(42)
|
68
|
+
#
|
69
|
+
# @param [Integer, String] id The ID of a runner
|
70
|
+
# @return <Gitlab::ObjectifiedHash>
|
71
|
+
def delete_runner(id)
|
72
|
+
delete("/runners/#{id}")
|
73
|
+
end
|
85
74
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
end
|
75
|
+
# Gets a list of Jobs for a Runner
|
76
|
+
#
|
77
|
+
# @example
|
78
|
+
# Gitlab.runner_jobs(1)
|
79
|
+
#
|
80
|
+
# @param [Integer] id The ID of a runner.
|
81
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
82
|
+
def runner_jobs(runner_id)
|
83
|
+
get("/runners/#{url_encode runner_id}/jobs")
|
84
|
+
end
|
97
85
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
post("/projects/#{url_encode project_id}/runners", body: body)
|
110
|
-
end
|
86
|
+
# List all runners (specific and shared) available in the project. Shared runners are listed if at least one shared runner is defined and shared runners usage is enabled in the project's settings.
|
87
|
+
# @see https://docs.gitlab.com/ce/api/runners.html#list-projects-runners
|
88
|
+
#
|
89
|
+
# @example
|
90
|
+
# Gitlab.project_runners(42)
|
91
|
+
#
|
92
|
+
# @param [Integer, String] id The ID or name of a project.
|
93
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
94
|
+
def project_runners(project_id)
|
95
|
+
get("/projects/#{url_encode project_id}/runners")
|
96
|
+
end
|
111
97
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
98
|
+
# Enable an available specific runner in the project.
|
99
|
+
# @see https://docs.gitlab.com/ce/api/runners.html#enable-a-runner-in-project
|
100
|
+
#
|
101
|
+
# @example
|
102
|
+
# Gitlab.project_enable_runner(2, 42)
|
103
|
+
#
|
104
|
+
# @param [Integer, String] id The ID or name of a project.
|
105
|
+
# @param [Integer, String] id The ID of a runner.
|
106
|
+
# @return <Gitlab::ObjectifiedHash>
|
107
|
+
def project_enable_runner(project_id, id)
|
108
|
+
body = { runner_id: id }
|
109
|
+
post("/projects/#{url_encode project_id}/runners", body: body)
|
110
|
+
end
|
124
111
|
|
112
|
+
# Disable a specific runner from the project. It works only if the project isn't the only project associated with the specified runner.
|
113
|
+
# @see https://docs.gitlab.com/ce/api/runners.html#disable-a-runner-from-project
|
114
|
+
#
|
115
|
+
# @example
|
116
|
+
# Gitlab.project_disable_runner(2, 42)
|
117
|
+
#
|
118
|
+
# @param [Integer, String] id The ID or name of a project.
|
119
|
+
# @param [Integer, String] runner_id The ID of a runner.
|
120
|
+
# @return <Gitlab::ObjectifiedHash>
|
121
|
+
def project_disable_runner(id, runner_id)
|
122
|
+
delete("/projects/#{url_encode id}/runners/#{runner_id}")
|
125
123
|
end
|
126
124
|
end
|