vcli 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vcli/cli/modify.rb +50 -0
- data/lib/vcli/version.rb +3 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8a8344e5a0dbeebb82f380036a4277ce11d1b5b
|
4
|
+
data.tar.gz: bec4f4aa5fc0d67c252f908bb7b4b86debe8ac86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|