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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f11ba743
Commit
f11ba743
authored
Jan 13, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some cosmetic changes to variables API documentation [ci skip]
parent
2b81248a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
44 deletions
+22
-44
doc/api/build_variables.md
doc/api/build_variables.md
+22
-44
No files found.
doc/api/build_variables.md
View file @
f11ba743
...
@@ -2,26 +2,20 @@
...
@@ -2,26 +2,20 @@
## List project variables
## List project variables
Get list of
variables of a project
.
Get list of
a project's build variables
.
```
```
GET /projects/:id/variables
GET /projects/:id/variables
```
```
### Parameters
| Attribute | Type | required | Description |
| Attribute | Type | required | Description |
|-----------|---------|----------|---------------------|
|-----------|---------|----------|---------------------|
| id | integer | yes | The ID of a project |
|
`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"
curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables"
```
```
### Example of response
```
json
```
json
[
[
{
{
...
@@ -37,27 +31,21 @@ curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3
...
@@ -37,27 +31,21 @@ curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3
## Show variable details
## Show variable details
Get
details of specifica variable of a project
.
Get
the details of a project's specific build variable
.
```
```
GET /projects/:id/variables/:key
GET /projects/:id/variables/:key
```
```
### Parameters
| Attribute | Type | required | Description |
| Attribute | Type | required | Description |
|-----------|---------|----------|-----------------------|
|-----------|---------|----------|-----------------------|
| id | integer | yes | The ID of a project |
|
`id`
| integer | yes | The ID of a project |
| key | string | yes | The
`key`
of variable |
|
`key`
| string | yes | The
`key`
of a variable |
### Example of request
```
```
curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables/TEST_VARIABLE_1"
curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables/TEST_VARIABLE_1"
```
```
### Example of response
```
json
```
json
{
{
"key"
:
"TEST_VARIABLE_1"
,
"key"
:
"TEST_VARIABLE_1"
,
...
@@ -67,28 +55,22 @@ curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3
...
@@ -67,28 +55,22 @@ curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3
## Create variable
## Create variable
Create
new variable in project
.
Create
a new build variable
.
```
```
POST /projects/:id/variables
POST /projects/:id/variables
```
```
### Parameters
| Attribute | Type | required | Description |
| Attribute | Type | required | Description |
|-----------|---------|----------|-----------------------|
|-----------|---------|----------|-----------------------|
| id | integer | yes | The ID of a project |
|
`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 |
|
`key`
| string | yes | The
`key`
of a 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 |
|
`value`
| string | yes | The
`value`
of a variable |
### Example of request
```
```
curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables" -F "key=NEW_VARIABLE" -F "value=new value"
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
{
{
"key"
:
"NEW_VARIABLE"
,
"key"
:
"NEW_VARIABLE"
,
...
@@ -98,28 +80,22 @@ curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.co
...
@@ -98,28 +80,22 @@ curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.co
## Update variable
## Update variable
Update variable.
Update
a project's build
variable.
```
```
PUT /projects/:id/variables/:key
PUT /projects/:id/variables/:key
```
```
### Parameters
| Attribute | Type | required | Description |
| Attribute | Type | required | Description |
|-----------|---------|----------|-------------------------|
|-----------|---------|----------|-------------------------|
| id | integer | yes | The ID of a project |
|
`id`
| integer | yes | The ID of a project |
| key | string | yes | The
`key`
of variable |
|
`key`
| string | yes | The
`key`
of a variable |
| value | string | yes | The
`value`
of variable |
|
`value`
| string | yes | The
`value`
of a 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"
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
{
{
"key"
:
"NEW_VARIABLE"
,
"key"
:
"NEW_VARIABLE"
,
...
@@ -129,22 +105,24 @@ curl -X PUT -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com
...
@@ -129,22 +105,24 @@ curl -X PUT -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com
## Remove variable
## Remove variable
Remove variable.
Remove
a project's build
variable.
```
```
DELETE /projects/:id/variables/:key
DELETE /projects/:id/variables/:key
```
```
### Parameters
| Attribute | Type | required | Description |
| Attribute | Type | required | Description |
|-----------|---------|----------|-------------------------|
|-----------|---------|----------|-------------------------|
| id | integer | yes | The ID of a project |
|
`id`
| integer | yes | The ID of a project |
| key | string | yes | The
`key`
of variable |
|
`key`
| string | yes | The
`key`
of a variable |
### Example of request
```
```
curl -X DELETE -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables/VARIABLE_1"
curl -X DELETE -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/variables/VARIABLE_1"
```
```
```
json
{
"key"
:
"VARIABLE_1"
,
"value"
:
"VALUE_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