Sha256: 4a6831e3fe67c0495748f3acc1ca083dbbc4333cdc046b221ab76a48d3460a7d

Contents?: true

Size: 803 Bytes

Versions: 14

Compression:

Stored size: 803 Bytes

Contents

$:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib')
require 'ace-client'
require 'thor'
require 'nokogiri'

BANNER = 'Usage: ace-q2 DescribeSomethings Key1=Value1 Key2=Value2 ...'

def validate_env
  %w(ACE_ACCESS_KEY_ID ACE_SECRET_ACCESS_KEY ACE_ENDPOINT).each do |x|
    abort "Error: please set #{x} environment variable" if ENV[x].nil?
  end
end

def main(args)
  abort BANNER if args.size < 1
  validate_env

  action = args.shift
  params = {}
  args.each do |arg|
    key, value = arg.split('=')
    if value.nil?
      abort 'Error: please specify params like Key=Value'
    end
    params[key] = value
  end

  response = AceClient::Query2.new.action(action, params)
  puts Nokogiri::XML(response.body).to_xml(:indent => 4)
end

main(ARGV.dup)

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ace-client-0.0.19 bin/ace-q2
ace-client-0.0.18 bin/ace-q2
ace-client-0.0.17 bin/ace-q2
ace-client-0.0.16 bin/ace-q2
ace-client-0.0.15 bin/ace-q2
ace-client-0.0.14 bin/ace-q2
ace-client-0.0.13 bin/ace-q2
ace-client-0.0.12 bin/ace-q2
ace-client-0.0.11 bin/ace-q2
ace-client-0.0.10 bin/ace-q2
ace-client-0.0.9 bin/ace-q2
ace-client-0.0.8 bin/ace-q2
ace-client-0.0.7 bin/ace-q2
ace-client-0.0.6 bin/ace-q2