module Gitlab::Client::Features

Defines methods related to feature flags. docs.gitlab.com/ce/api/features.html

Public Instance Methods

delete_feature(name) click to toggle source

Delete a feature.

@example

Gitlab.delete_feature('new_library')

@param [String] name Name of the feature to delete @return [void] This API call returns an empty response body.

# File lib/gitlab/client/features.rb, line 44
def delete_feature(name)
  delete("/features/#{name}")
end
features() click to toggle source

Get a list of all persisted features, with its gate values.

@example

Gitlab.features

@return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/features.rb, line 13
def features
  get('/features')
end
set_feature(name, value, options = {}) click to toggle source

Set a features gate value. If a feature with the given name does not exist yet it will be created. The value can be a boolean, or an integer to indicate percentage of time.

@example

Gitlab.set_feature('new_library', true)
Gitlab.set_feature('new_library', 8)
Gitlab.set_feature('new_library', true, {user: 'gitlab'})

@param [String] name(required) Name of the feature to create or update @param [String, Integer] value(required) true or false to enable/disable, or an integer for percentage of time @param [Hash] options A customizable set of options. @option options [String] :feature_group(optional) A Feature group name @option options [String] :user(optional) A GitLab username @option options [String] :project(optional) A projects path, for example “gitlab-org/gitlab-ce” @return [Gitlab::ObjectifiedHash] Information about the set/created/updated feature.

# File lib/gitlab/client/features.rb, line 32
def set_feature(name, value, options = {})
  body = { value: value }.merge(options)
  post("/features/#{name}", body: body)
end