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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
b6044590
Commit
b6044590
authored
Jan 07, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ./doc/api
parent
b60c1462
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
1 deletion
+108
-1
doc/api/README.md
doc/api/README.md
+1
-0
doc/api/variables.md
doc/api/variables.md
+106
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-1
No files found.
doc/api/README.md
View file @
b6044590
...
...
@@ -23,6 +23,7 @@
-
[
Namespaces
](
namespaces.md
)
-
[
Settings
](
settings.md
)
-
[
Keys
](
keys.md
)
-
[
Variables
](
variables.md
)
## Clients
...
...
doc/api/variables.md
0 → 100644
View file @
b6044590
# Variables
## Variables keys
All variable keys must contains only letters, digits and '
\_
'. They must also be no longer than 255 characters.
## List project variables
Get list of variables of a project.
```
GET /projects/:id/variables
```
Parameters:
-
`id`
(required) - The ID of a project
```
json
[
{
"key"
:
"TEST_VARIABLE_1"
,
"value"
:
"TEST_1"
},
{
"key"
:
"TEST_VARIABLE_2"
,
"value"
:
"TEST_2"
}
]
```
## Show variable details
Get details of specifica variable of a project.
```
GET /projects/:id/variables/:key
```
Parameters:
-
`id`
(required) - The ID of a project
-
`key`
(required) - The
`key`
of variable
```
json
{
"key"
:
"TEST_VARIABLE_1"
,
"value"
:
"TEST_1"
}
```
## Create variable
Create new variable in project.
```
POST /projects/:id/variables
```
Parameters:
-
`id`
(required) - The ID of a project
-
`key`
(required) - The
`key`
for variable
-
`value`
(required) - The
`value`
for variable
```
json
{
"key"
:
"NEW_VARIABLE"
,
"value"
:
"new value"
}
```
## Update variable
Update variable.
```
PUT /projects/:id/variables/:key
```
Parameters:
-
`id`
(required) - The ID of a project
-
`key`
(required) - The
`key`
for variable
-
`value`
(required) - The
`value`
for variable
```
json
{
"key"
:
"NEW_VARIABLE"
,
"value"
:
"updated value"
}
```
## Remove variable
Remove variable.
```
DELETE /projects/:id/variables/:key
```
Parameters:
-
`id`
(required) - The ID of a project
-
`key`
(required) - The
`key`
for variable
lib/api/entities.rb
View file @
b6044590
...
...
@@ -367,7 +367,7 @@ module API
end
class
Variable
<
Grape
::
Entity
expose
:
id
,
:
key
,
:value
expose
:key
,
:value
end
end
end
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