Improve API arguments as String
This commit is contained in:
parent
1024718e9f
commit
13b9b5f11a
3 changed files with 6 additions and 5 deletions
|
@ -139,7 +139,7 @@ Example response:
|
|||
"mysql"
|
||||
],
|
||||
"version": null,
|
||||
"access_level": 0
|
||||
"access_level": "ref_protected"
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -159,7 +159,7 @@ PUT /runners/:id
|
|||
| `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; `not_protected`: 0, `ref_protected`: 1 |
|
||||
| `access_level` | integer | no | The access_level of the runner; `not_protected` or `ref_protected` |
|
||||
|
||||
```
|
||||
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"
|
||||
|
@ -195,7 +195,7 @@ Example response:
|
|||
"tag2"
|
||||
],
|
||||
"version": null,
|
||||
"access_level": 0
|
||||
"access_level": "ref_protected"
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -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'
|
||||
optional :access_level, type: Integer, desc: 'The access_level of the runner'
|
||||
optional :access_level, type: String, values: Ci::Runner.access_levels.keys,
|
||||
desc: 'The access_level of the runner'
|
||||
at_least_one_of :description, :active, :tag_list, :run_untagged, :locked, :access_level
|
||||
end
|
||||
put ':id' do
|
||||
|
|
|
@ -192,7 +192,7 @@ describe API::Runners do
|
|||
tag_list: ['ruby2.1', 'pgsql', 'mysql'],
|
||||
run_untagged: 'false',
|
||||
locked: 'true',
|
||||
access_level: Ci::Runner.access_levels['ref_protected'])
|
||||
access_level: 'ref_protected')
|
||||
shared_runner.reload
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
|
|
Loading…
Reference in a new issue