Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
6f19fc11
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6f19fc11
编写于
8月 24, 2017
作者:
S
Shinya Maeda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add API support
上级
af112c55
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
13 addition
and
4 deletion
+13
-4
doc/api/runners.md
doc/api/runners.md
+7
-2
lib/api/entities.rb
lib/api/entities.rb
+1
-0
lib/api/runners.rb
lib/api/runners.rb
+2
-1
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+3
-1
未找到文件。
doc/api/runners.md
浏览文件 @
6f19fc11
...
...
@@ -138,7 +138,8 @@ Example response:
"ruby"
,
"mysql"
],
"version"
:
null
"version"
:
null
,
"access_level"
:
0
}
```
...
...
@@ -156,6 +157,9 @@ PUT /runners/:id
|
`description`
| string | no | The description of a runner |
|
`active`
| boolean | no | The state of a runner; can be set to
`true`
or
`false`
|
|
`tag_list`
| array | no | The list of tags for a runner; put array of tags, that should be finally assigned to a runner |
|
`run_untagged`
| boolean | no | Flag indicating the runner can execute untagged jobs |
|
`locked`
| boolean | no | Flag indicating the runner is locked |
|
`access_level`
| integer | no | The access_level of the runner;
`unprotected`
: 0,
`protected`
: 1 |
```
curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/runners/6" --form "description=test-1-20150125-test" --form "tag_list=ruby,mysql,tag1,tag2"
...
...
@@ -190,7 +194,8 @@ Example response:
"tag1"
,
"tag2"
],
"version"
:
null
"version"
:
null
,
"access_level"
:
0
}
```
...
...
lib/api/entities.rb
浏览文件 @
6f19fc11
...
...
@@ -775,6 +775,7 @@ module API
expose
:tag_list
expose
:run_untagged
expose
:locked
expose
:access_level
expose
:version
,
:revision
,
:platform
,
:architecture
expose
:contacted_at
expose
:token
,
if:
lambda
{
|
runner
,
options
|
options
[
:current_user
].
admin?
||
!
runner
.
is_shared?
}
...
...
lib/api/runners.rb
浏览文件 @
6f19fc11
...
...
@@ -55,7 +55,8 @@ module API
optional
:tag_list
,
type:
Array
[
String
],
desc:
'The list of tags for a runner'
optional
:run_untagged
,
type:
Boolean
,
desc:
'Flag indicating the runner can execute untagged jobs'
optional
:locked
,
type:
Boolean
,
desc:
'Flag indicating the runner is locked'
at_least_one_of
:description
,
:active
,
:tag_list
,
:run_untagged
,
:locked
optional
:access_level
,
type:
Integer
,
desc:
'The access_level of the runner'
at_least_one_of
:description
,
:active
,
:tag_list
,
:run_untagged
,
:locked
,
:access_level
end
put
':id'
do
runner
=
get_runner
(
params
.
delete
(
:id
))
...
...
spec/requests/api/runners_spec.rb
浏览文件 @
6f19fc11
...
...
@@ -191,7 +191,8 @@ describe API::Runners do
active:
!
active
,
tag_list:
[
'ruby2.1'
,
'pgsql'
,
'mysql'
],
run_untagged:
'false'
,
locked:
'true'
)
locked:
'true'
,
access_level:
1
)
shared_runner
.
reload
expect
(
response
).
to
have_http_status
(
200
)
...
...
@@ -200,6 +201,7 @@ describe API::Runners do
expect
(
shared_runner
.
tag_list
).
to
include
(
'ruby2.1'
,
'pgsql'
,
'mysql'
)
expect
(
shared_runner
.
run_untagged?
).
to
be
(
false
)
expect
(
shared_runner
.
locked?
).
to
be
(
true
)
expect
(
shared_runner
.
protected_?
).
to
be_truthy
expect
(
shared_runner
.
ensure_runner_queue_value
)
.
not_to
eq
(
runner_queue_value
)
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录