Sha256: 3fe12e7b553912fc69fd4c159529981ea99700b0cf14f2e962b7f63cda2ddb8d

Contents?: true

Size: 646 Bytes

Versions: 3

Compression:

Stored size: 646 Bytes

Contents

require 'opsicle/config'

module Opsicle
  class Client
    attr_reader :aws_client
    attr_reader :config

    def initialize(environment)
      @config = Config.new(environment)
      @config.configure_aws!
      @aws_client = AWS::OpsWorks.new.client
    end

    def run_command(command, options={})
      aws_client.create_deployment(command_options(command, options))
    end

    def api_call(command, options={})
      aws_client.send(command, options)
    end

    def command_options(command, options={})
      config.opsworks_config.merge(options).merge({ command: { name: command } })
    end
    private :command_options

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opsicle-0.0.4 lib/opsicle/client.rb
opsicle-0.0.3 lib/opsicle/client.rb
opsicle-0.0.2 lib/opsicle/client.rb