Class: Vcli::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/vcli/cli.rb

Instance Method Summary collapse

Instance Method Details

#loginObject



17
18
19
20
21
22
23
24
25
# File 'lib/vcli/cli.rb', line 17

def ()
  abq = AbiquoAPI.new(:abiquo_api_url => Vcli::target,
                      :abiquo_username => Vcli::user,
                      :abiquo_password => Vcli::password)
  abq.user
  enterprise=abq.user.link(:enterprise).get
  puts "Logged into Abiquo Portal as User - #{abq.user.id} - #{abq.user.name} #{abq.user.surname}"
  puts "                    in Enterprise - #{enterprise.id} - #{abq.enterprise.title}"
end

#target(url) ⇒ Object



10
11
12
13
14
# File 'lib/vcli/cli.rb', line 10

def target(url)
  Vcli.set_config("target",url)
  command = "Set target of cli to #{url}"
  puts command
end

#user(username, password) ⇒ Object



28
29
30
31
32
# File 'lib/vcli/cli.rb', line 28

def user(username, password)
  Vcli.set_config("user",username)
  Vcli.set_config("password",password)
  puts "Set user details complete"
end