class DLDInternet::AWS::EC2::Instance_Types::Cli

noinspection RubyParenthesesAfterMethodCallInspection

Public Class Methods

new(args = [], local_options = {}, config = {}) click to toggle source
Calls superclass method
# File lib/dldinternet/aws/ec2/instance_types/cli.rb, line 41
def initialize(args = [], local_options = {}, config = {})
  super(args,local_options,config)
  @log_level = :step
end
start(argv = ARGV, config = {}) click to toggle source
Calls superclass method
# File lib/dldinternet/aws/ec2/instance_types/cli.rb, line 34
def self.start(argv = ARGV, config = {})
  if argv.size == 0 or argv[0].match(%r'^--')
    argv.unshift('get')
  end
  super(argv,config)
end

Public Instance Methods

get() click to toggle source
# File lib/dldinternet/aws/ec2/instance_types/cli.rb, line 47
def get()
  parse_options
  puts 'get instance types' if options[:verbose]

  it = DLDInternet::AWS::EC2::Instance_Types.get_ec2_instance_types()
  case options[:format]
  when /yaml/
    puts it.to_yaml line_width: 1024, indentation: 4, canonical: false
  when /json/
    puts JSON.pretty_generate( it, { indent: "\t", space: ' '})
  else
    puts it.ai
  end
  0
end
help() click to toggle source
Calls superclass method
# File lib/dldinternet/aws/ec2/instance_types/cli.rb, line 29
def help()
  puts "Version: #{VERSION}"
  super
end
load(path) click to toggle source
# File lib/dldinternet/aws/ec2/instance_types/cli.rb, line 64
def load(path)
  parse_options
  puts 'load instance types' if options[:verbose]

  it = DLDInternet::AWS::EC2::Instance_Types.load_ec2_instance_types(path)
  ap it
end
save(path) click to toggle source
# File lib/dldinternet/aws/ec2/instance_types/cli.rb, line 73
def save(path)
  parse_options
  puts 'save instance types' if options[:verbose]

  it = DLDInternet::AWS::EC2::Instance_Types.get_ec2_instance_types()
  DLDInternet::AWS::EC2::Instance_Types.save_ec2_instance_types(path, it)
end