Sha256: 87394d07dcba631251e0acc33728e8eab7e0a784f94dbc3efe55f9be82c1efca

Contents?: true

Size: 892 Bytes

Versions: 2

Compression:

Stored size: 892 Bytes

Contents

#!/usr/bin/env ruby

require 'dd2tf'
require 'thor'
require 'dogapi'

module Dd2tf
  class Cli < Thor
    include Thor::Actions

    class_option :dd_api_key, type: :string
    class_option :dd_app_key, type: :string

    desc "puts monitor configuration as terraform config", "puts monitor config"
    def monitor
      puts Monitor.new(client).output
    end

    desc "puts timeboard configuration as terraform config", "puts timeboard config"
    def timeboard
      puts Timeboard.new(client).output
    end

    desc "puts user configuration as terraform config", "puts user config"
    def user
      puts User.new(client).output
    end

    private

    def client
      return @client unless @client.nil?
      config = Config.new(options[:dd_api_key], options[:dd_app_key])
      @client ||= ::Dogapi::Client.new(config.api_key, config.app_key)
    end
  end
end

Dd2tf::Cli.start

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dd2tf-0.1.2 exe/dd2tf
dd2tf-0.1.0 exe/dd2tf