File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -90,21 +90,43 @@ Get a variable::
9090 p_var = project.variables.get('key_name')
9191 g_var = group.variables.get('key_name')
9292
93+ .. note ::
94+
95+ If there are multiple variables with the same key, use ``filter `` to select
96+ the correct environment_scope. See the GitLab API docs for more information.
97+
9398Create a variable::
9499
95100 var = project.variables.create({'key': 'key1', 'value': 'value1'})
96101 var = group.variables.create({'key': 'key1', 'value': 'value1'})
97102
103+ .. note ::
104+
105+ If a variable with the same key already exists, the new variable must have a
106+ different environment_scope. Otherwise, GitLab returns a message similar to:
107+ VARIABLE_NAME has already been taken. See the GitLab API docs for more
108+ information.
109+
98110Update a variable value::
99111
100112 var.value = 'new_value'
101113 var.save()
102114 # or
103115 project.variables.update("key1", {"value": "new_value"})
104116
117+ .. note ::
118+
119+ If there are multiple variables with the same key, use ``filter `` to select
120+ the correct environment_scope. See the GitLab API docs for more information.
121+
105122Remove a variable::
106123
107124 project.variables.delete('key_name')
108125 group.variables.delete('key_name')
109126 # or
110127 var.delete()
128+
129+ .. note ::
130+
131+ If there are multiple variables with the same key, use ``filter `` to select
132+ the correct environment_scope. See the GitLab API docs for more information.
You can’t perform that action at this time.
0 commit comments