webee 0.3 → 0.3.1
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.
- data/examples/basics.rb +3 -0
- data/examples/test.rb +14 -13
- data/lib/webee.rb +5 -2
- metadata +3 -2
data/examples/basics.rb
CHANGED
data/examples/test.rb
CHANGED
@@ -5,21 +5,22 @@ require 'active_support'
|
|
5
5
|
|
6
6
|
WeBee::Api.user = ENV['user'] || 'admin'
|
7
7
|
WeBee::Api.password = ENV['pass'] || 'xabiquo'
|
8
|
-
WeBee::Api.url = 'http://
|
8
|
+
WeBee::Api.url = 'http://10.60.1.24/api'
|
9
9
|
|
10
10
|
include WeBee
|
11
11
|
|
12
|
-
|
12
|
+
dc = Datacenter.all.first
|
13
|
+
ent = Enterprise.all.first
|
14
|
+
puts ent.name
|
15
|
+
rack = dc.racks.first
|
13
16
|
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
17
|
+
#machine = dc.discover_machine :ip => '10.60.1.24', :hypervisortype => 'kvm'
|
18
|
+
# Use the first virtual switch we find
|
19
|
+
#machine.virtual_switch = machine.virtual_switches.first
|
20
|
+
# Enable the first datastore found
|
21
|
+
#machine.datastores.first.enabled = true
|
22
|
+
# Add the hypervisor to the rack
|
23
|
+
#rack.add_machine(machine)
|
24
|
+
ent.set_limits_for_datacenter dc
|
25
|
+
vdc = ent.create_vdc :name => 'kvm-vdc2', :hypervisortype => 'KVM', :datacenter => dc
|
25
26
|
|
data/lib/webee.rb
CHANGED
@@ -28,8 +28,7 @@ end
|
|
28
28
|
|
29
29
|
module WeBee
|
30
30
|
|
31
|
-
VERSION = '0.3'
|
32
|
-
|
31
|
+
VERSION = '0.3.1'
|
33
32
|
|
34
33
|
module RestResource
|
35
34
|
|
@@ -582,6 +581,10 @@ module WeBee
|
|
582
581
|
def self.find_by_name(name, options = {})
|
583
582
|
VDC.all(options).find_all { |vdc| vdc.name =~ /#{name}/ }
|
584
583
|
end
|
584
|
+
|
585
|
+
def delete
|
586
|
+
RestClient.delete(Api.url + "/cloud/virtualdatacenters/#{vdc_id}")
|
587
|
+
end
|
585
588
|
|
586
589
|
#
|
587
590
|
# List all the virtual appliances in this virtual datacenter
|
metadata
CHANGED