class Confy::Api::Config

Any member of the team which has access to the project can retrieve any of it's environment's configuration document or edit it.

org - Name of the organization project - Name of the project env - Name of the environment

Public Class Methods

new(org, project, env, client) click to toggle source
# File lib/confy/api/config.rb, line 12
def initialize(org, project, env, client)
  @org = org
  @project = project
  @env = env
  @client = client
end

Public Instance Methods

retrieve(options = {}) click to toggle source

Get an environment configuration

'/orgs/:org/projects/:project/envs/:env/config' GET

# File lib/confy/api/config.rb, line 22
def retrieve(options = {})
  body = options.fetch(:query, {})

  @client.get("/orgs/#{@org}/projects/#{@project}/envs/#{@env}/config", body, options)
end
update(config, options = {}) click to toggle source

Update the configuration document for the given environment of the project. We will patch the document recursively.

'/orgs/:org/projects/:project/envs/:env/config' PATCH

config - Configuration to update

# File lib/confy/api/config.rb, line 33
def update(config, options = {})
  body = options.fetch(:body, {})
  body[:config] = config

  @client.patch("/orgs/#{@org}/projects/#{@project}/envs/#{@env}/config", body, options)
end
versions(options = {}) click to toggle source

List the last 10 versions of the environment configuration

'/orgs/:org/projects/:project/envs/:env/versions' GET

# File lib/confy/api/config.rb, line 43
def versions(options = {})
  body = options.fetch(:query, {})

  @client.get("/orgs/#{@org}/projects/#{@project}/envs/#{@env}/versions", body, options)
end