Class: Trollop::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/rbvmomi/trollop.rb

Instance Method Summary collapse

Instance Method Details

#rbvmomi_computer_optObject



26
27
28
# File 'lib/rbvmomi/trollop.rb', line 26

def rbvmomi_computer_opt
  opt :computer, "Compute resource", :type => :string, :short => "R", :default => ENV['RBVMOMI_COMPUTER']
end

#rbvmomi_connection_optsObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/rbvmomi/trollop.rb', line 7

def rbvmomi_connection_opts
  opt :host, "host", :type => :string, :short => 'o', :default => ENV['RBVMOMI_HOST']
  opt :port, "port", :type => :int, :short => :none, :default => (ENV.member?('RBVMOMI_PORT') ? ENV['RBVMOMI_PORT'].to_i : 443)
  opt :"no-ssl", "don't use ssl", :short => :none, :default => (ENV['RBVMOMI_SSL'] == '0') 
  opt :insecure, "don't verify ssl certificate", :short => 'k', :default => (ENV['RBVMOMI_INSECURE'] == '1')
  opt :user, "username", :short => 'u', :default => (ENV['RBVMOMI_USER'] || 'root')
  opt :password, "password", :short => 'p', :default => (ENV['RBVMOMI_PASSWORD'] || '')
  opt :path, "SOAP endpoint path", :short => :none, :default => (ENV['RBVMOMI_PATH'] || '/sdk')
  opt :debug, "Log SOAP messages", :short => 'd'
end

#rbvmomi_datacenter_optObject



18
19
20
# File 'lib/rbvmomi/trollop.rb', line 18

def rbvmomi_datacenter_opt
  opt :datacenter, "datacenter", :type => :string, :short => "D", :default => (ENV['RBVMOMI_DATACENTER'] || 'ha-datacenter')
end

#rbvmomi_datastore_optObject



30
31
32
# File 'lib/rbvmomi/trollop.rb', line 30

def rbvmomi_datastore_opt
  opt :datastore, "Datastore", :short => 's', :default => (ENV['RBVMOMI_DATASTORE'] || 'datastore1')
end

#rbvmomi_folder_optObject



22
23
24
# File 'lib/rbvmomi/trollop.rb', line 22

def rbvmomi_folder_opt
  opt :folder, "VM folder", :type => :string, :short => "F", :default => (ENV['RBVMOMI_FOLDER'] || '')
end