vcli 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7e81df0bb2f86fe03b09126c0d8eb1b94311cb4
4
- data.tar.gz: 8855ae08ad7abe06fccfe03ec3b013a201cfaff0
3
+ metadata.gz: f8a8344e5a0dbeebb82f380036a4277ce11d1b5b
4
+ data.tar.gz: bec4f4aa5fc0d67c252f908bb7b4b86debe8ac86
5
5
  SHA512:
6
- metadata.gz: 6fbccfa4493719c91059d197c92b129c85e5daff9ef0680cc07956396aeba0a739037e9c79cfdd9ff79286472fcb3e4e43d0d77f4f9067774975d8a599d4620d
7
- data.tar.gz: 4420b8b9c08e0c934ead13d07fc6ebbd6b2c83c5dbd0f48af717c2e414cfbca79780cccf21895fad99971e32708be644a0dd94298cfc4b7b2a8908d5c0f4a11b
6
+ metadata.gz: 836a555387274f25b22a3f1a26ebd8e83ce161f5ee2f1d6b5acdc1e14337adfd955cef477b4f19e0e6781b986ed041d16dbe9465bc7bc40db21e9802faa05021
7
+ data.tar.gz: 18330f53ba237764ff4a6a3f09a58c58d2334aa88689f4b914130488cabc7dac82c52245501a57c61a1e3d124d5316b0705b668dde73dd424e8c93689a104cd3
@@ -0,0 +1,50 @@
1
+ module Vcli
2
+ module CLI
3
+ class Modify < Thor
4
+ desc "ip", "Modify IP"
5
+ method_option :vdc, :type => :string, :required => true
6
+ method_option :va, :type => :string, :required => true
7
+ method_option :vmid, :type => :string, :required => true
8
+ method_option :ipid, :type => :string, :required => true
9
+ method_option :vlanid, :type => :string, :required => true
10
+ def ip( )
11
+ abq = AbiquoAPI.new(:abiquo_api_url => Vcli::target,
12
+ :abiquo_username => Vcli::user,
13
+ :abiquo_password => Vcli::password)
14
+ vdc=options[:vdc].to_s
15
+ va=options[:va].to_s
16
+ vmid=options[:vmid].to_s
17
+ vlanid=options[:vlanid].to_s
18
+ ipid=options[:ipid].to_s
19
+ l = AbiquoAPI::Link.new(:href => '/api/cloud/virtualdatacenters/' + vdc + '/virtualappliances/'+va+'/virtualmachines/'+vmid,
20
+ :type => 'application/vnd.abiquo.virtualmachine+json',
21
+ :client => abq)
22
+ vm=l.get
23
+ link2=AbiquoAPI::Link.new(:href => 'api/cloud/virtualdatacenters/'+vdc+'/privatenetworks/'+vlanid+'/ips/'+ipid,
24
+ :type => 'application/vnd.abiquo.privateip+json',
25
+ :client => abq)
26
+ ips=link2.get
27
+ while vm.state == "LOCKED" or vm.state == "ON"
28
+ sleep 10
29
+ puts "Waiting for Machine to Power off"
30
+ vm=l.get
31
+ end
32
+ vm.link(:nic0).href=ips.url
33
+ vm.link(:nic0).title=ips.ip
34
+ vm.link(:nic0).rel="nic0"
35
+ vm.link(:nic0).type="application/vnd.abiquo.privateip+json"
36
+ reqoptions=Hash.new
37
+ reqoptions[:accept] = 'application/vnd.abiquo.acceptedrequest+json'
38
+ response=abq.put(l,vm,reqoptions)
39
+ puts "Waiting for Machine to Reconfigure"
40
+ sleep 10
41
+ response2=response.link(:status).get
42
+ while response2.state == "LOCKED" || response2.state=="STARTED"
43
+ response2=response.link(:status).get
44
+ sleep 10
45
+ print "."
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
data/lib/vcli/version.rb CHANGED
@@ -25,7 +25,9 @@ module Vcli
25
25
  # 0.2.6 #05082015# Added create virtualmachine
26
26
  #################################################################
27
27
  # 0.2.7 #11082015# Added modify ip
28
+ #################################################################
29
+ # 0.2.8 #11082015# Bumped
28
30
  #################################################################
29
31
 
30
- VERSION = "0.2.7"
32
+ VERSION = "0.2.8"
31
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Fearn
@@ -157,6 +157,7 @@ files:
157
157
  - lib/vcli/cli.rb
158
158
  - lib/vcli/cli/create.rb
159
159
  - lib/vcli/cli/delete.rb
160
+ - lib/vcli/cli/modify.rb
160
161
  - lib/vcli/cli/resource.rb
161
162
  - lib/vcli/cli/show.rb
162
163
  - lib/vcli/version.rb