Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
2b81248a
Commit
2b81248a
authored
Jan 13, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify builds API documentation style [ci skip]
parent
3b7f3428
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
20 deletions
+64
-20
doc/api/build_variables.md
doc/api/build_variables.md
+64
-20
No files found.
doc/api/build_variables.md
View file @
2b81248a
# Build Variables
# Build Variables
## Variables keys
All variable keys must contains only letters, digits and '
\_
'. They must also be no longer than 255 characters.
## List project variables
## List project variables
Get list of variables of a project.
Get list of variables of a project.
...
@@ -12,9 +8,19 @@ Get list of variables of a project.
...
@@ -12,9 +8,19 @@ Get list of variables of a project.
GET /projects/:id/variables
GET /projects/:id/variables
```
```
Parameters:
### Parameters
| Attribute | Type | required | Description |
|-----------|---------|----------|---------------------|
| id | integer | yes | The ID of a project |
### Example of request
```
curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables"
```
-
`id`
(required) - The ID of a project
### Example of response
```
json
```
json
[
[
...
@@ -37,10 +43,20 @@ Get details of specifica variable of a project.
...
@@ -37,10 +43,20 @@ Get details of specifica variable of a project.
GET /projects/:id/variables/:key
GET /projects/:id/variables/:key
```
```
Parameters:
### Parameters
-
`id`
(required) - The ID of a project
| Attribute | Type | required | Description |
-
`key`
(required) - The
`key`
of variable
|-----------|---------|----------|-----------------------|
| id | integer | yes | The ID of a project |
| key | string | yes | The
`key`
of variable |
### Example of request
```
curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables/TEST_VARIABLE_1"
```
### Example of response
```
json
```
json
{
{
...
@@ -57,11 +73,21 @@ Create new variable in project.
...
@@ -57,11 +73,21 @@ Create new variable in project.
POST /projects/:id/variables
POST /projects/:id/variables
```
```
Parameters:
### Parameters
| Attribute | Type | required | Description |
|-----------|---------|----------|-----------------------|
| id | integer | yes | The ID of a project |
| key | string | yes | The
`key`
of variable; must have no more than 255 characters; only
`A-Z`
,
`a-z`
,
`0-9`
, and
`_`
are allowed |
| value | string | yes | The
`value`
of variable |
-
`id`
(required) - The ID of a project
### Example of request
-
`key`
(required) - The
`key`
for variable
-
`value`
(required) - The
`value`
for variable
```
curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables" -F "key=NEW_VARIABLE" -F "value=new value"
```
### Example of response
```
json
```
json
{
{
...
@@ -78,11 +104,21 @@ Update variable.
...
@@ -78,11 +104,21 @@ Update variable.
PUT /projects/:id/variables/:key
PUT /projects/:id/variables/:key
```
```
Parameters:
### Parameters
-
`id`
(required) - The ID of a project
| Attribute | Type | required | Description |
-
`key`
(required) - The
`key`
for variable
|-----------|---------|----------|-------------------------|
-
`value`
(required) - The
`value`
for variable
| id | integer | yes | The ID of a project |
| key | string | yes | The
`key`
of variable |
| value | string | yes | The
`value`
of variable |
### Example of request
```
curl -X PUT -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables/NEW_VARIABLE" -F "value=updated value"
```
### Example of response
```
json
```
json
{
{
...
@@ -99,8 +135,16 @@ Remove variable.
...
@@ -99,8 +135,16 @@ Remove variable.
DELETE /projects/:id/variables/:key
DELETE /projects/:id/variables/:key
```
```
Parameters:
### Parameters
| Attribute | Type | required | Description |
|-----------|---------|----------|-------------------------|
| id | integer | yes | The ID of a project |
| key | string | yes | The
`key`
of variable |
-
`id`
(required) - The ID of a project
### Example of request
-
`key`
(required) - The
`key`
for variable
```
curl -X DELETE -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables/VARIABLE_1"
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment