requires:id,type: String,desc: 'The ID of a group'
requires:id,type: String,desc: 'The ID of a group'
end
end
...
@@ -30,16 +32,13 @@ module API
...
@@ -30,16 +32,13 @@ module API
paramsdo
paramsdo
requires:key,type: String,desc: 'The key of the variable'
requires:key,type: String,desc: 'The key of the variable'
end
end
# rubocop: disable CodeReuse/ActiveRecord
get':id/variables/:key'do
get':id/variables/:key'do
key=params[:key]
variable=find_variable(user_group,params)
variable=user_group.variables.find_by(key: key)
breaknot_found!('GroupVariable')unlessvariable
breaknot_found!('GroupVariable')unlessvariable
presentvariable,with: Entities::Ci::Variable
presentvariable,with: Entities::Ci::Variable
end
end
# rubocop: enable CodeReuse/ActiveRecord
desc'Create a new variable in a group'do
desc'Create a new variable in a group'do
successEntities::Ci::Variable
successEntities::Ci::Variable
...
@@ -50,12 +49,19 @@ module API
...
@@ -50,12 +49,19 @@ module API
optional:protected,type: String,desc: 'Whether the variable is protected'
optional:protected,type: String,desc: 'Whether the variable is protected'
optional:masked,type: String,desc: 'Whether the variable is masked'
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'
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'