requires:id,type: String,desc: 'The ID of a group'
end
...
...
@@ -30,16 +32,13 @@ module API
paramsdo
requires:key,type: String,desc: 'The key of the variable'
end
# rubocop: disable CodeReuse/ActiveRecord
get':id/variables/:key'do
key=params[:key]
variable=user_group.variables.find_by(key: key)
variable=find_variable(user_group,params)
breaknot_found!('GroupVariable')unlessvariable
presentvariable,with: Entities::Ci::Variable
end
# rubocop: enable CodeReuse/ActiveRecord
desc'Create a new variable in a group'do
successEntities::Ci::Variable
...
...
@@ -50,12 +49,19 @@ module API
optional:protected,type: String,desc: 'Whether the variable is protected'
optional:masked,type: String,desc: 'Whether the variable is masked'
optional:variable_type,type: String,values: ::Ci::GroupVariable.variable_types.keys,desc: 'The type of variable, must be one of env_var or file. Defaults to env_var'