opennebula 5.2.1 → 5.3.80.beta1
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 +4 -4
- data/lib/VirtualMachineDriver.rb +7 -0
- data/lib/cloud/CloudClient.rb +1 -1
- data/lib/opennebula/acl.rb +8 -3
- data/lib/opennebula/client.rb +1 -1
- data/lib/opennebula/error.rb +10 -2
- data/lib/opennebula/group.rb +37 -7
- data/lib/opennebula/host.rb +15 -4
- data/lib/opennebula/server_cipher_auth.rb +5 -3
- data/lib/opennebula/system.rb +13 -1
- data/lib/opennebula/virtual_machine.rb +31 -34
- data/lib/opennebula/virtual_network.rb +32 -15
- data/lib/opennebula/vm_group.rb +151 -0
- data/lib/opennebula/vm_group_pool.rb +78 -0
- data/lib/opennebula/xml_element.rb +18 -0
- data/lib/opennebula/zone.rb +24 -1
- data/lib/opennebula.rb +3 -1
- data/lib/vcenter_driver.rb +35 -3111
- metadata +7 -6
@@ -0,0 +1,78 @@
|
|
1
|
+
# -------------------------------------------------------------------------- #
|
2
|
+
# Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
|
3
|
+
# #
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
|
+
# not use this file except in compliance with the License. You may obtain #
|
6
|
+
# a copy of the License at #
|
7
|
+
# #
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
9
|
+
# #
|
10
|
+
# Unless required by applicable law or agreed to in writing, software #
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
13
|
+
# See the License for the specific language governing permissions and #
|
14
|
+
# limitations under the License. #
|
15
|
+
#--------------------------------------------------------------------------- #
|
16
|
+
|
17
|
+
require 'opennebula/pool'
|
18
|
+
|
19
|
+
module OpenNebula
|
20
|
+
class VMGroupPool < Pool
|
21
|
+
#######################################################################
|
22
|
+
# Constants and Class attribute accessors
|
23
|
+
#######################################################################
|
24
|
+
VMGROUP_POOL_METHODS = {
|
25
|
+
:info => "vmgrouppool.info"
|
26
|
+
}
|
27
|
+
|
28
|
+
#######################################################################
|
29
|
+
# Class constructor & Pool Methods
|
30
|
+
#######################################################################
|
31
|
+
|
32
|
+
# +client+ a Client object that represents an XML-RPC connection
|
33
|
+
# +user_id+ used to refer to a Pool with Templates from that user
|
34
|
+
def initialize(client, user_id=-1)
|
35
|
+
super('VM_GROUP_POOL','VM_GROUP',client)
|
36
|
+
|
37
|
+
@user_id = user_id
|
38
|
+
end
|
39
|
+
|
40
|
+
# Factory method to create Template objects
|
41
|
+
def factory(element_xml)
|
42
|
+
OpenNebula::VMGroup.new(element_xml,@client)
|
43
|
+
end
|
44
|
+
|
45
|
+
#######################################################################
|
46
|
+
# XML-RPC Methods for the Template Object
|
47
|
+
#######################################################################
|
48
|
+
|
49
|
+
# Retrieves all or part of the objects in the pool.
|
50
|
+
def info(*args)
|
51
|
+
case args.size
|
52
|
+
when 0
|
53
|
+
info_filter(VMGROUP_POOL_METHODS[:info], @user_id, -1, -1)
|
54
|
+
when 3
|
55
|
+
info_filter(VMGROUP_POOL_METHODS[:info], args[0], args[1],
|
56
|
+
args[2])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def info_all()
|
61
|
+
return super(VMGROUP_POOL_METHODS[:info])
|
62
|
+
end
|
63
|
+
|
64
|
+
def info_mine()
|
65
|
+
return super(VMGROUP_POOL_METHODS[:info])
|
66
|
+
end
|
67
|
+
|
68
|
+
def info_group()
|
69
|
+
return super(VMGROUP_POOL_METHODS[:info])
|
70
|
+
end
|
71
|
+
|
72
|
+
alias_method :info!, :info
|
73
|
+
alias_method :info_all!, :info_all
|
74
|
+
alias_method :info_mine!, :info_mine
|
75
|
+
alias_method :info_group!, :info_group
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
@@ -45,6 +45,7 @@ module OpenNebula
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
|
+
@xml
|
48
49
|
end
|
49
50
|
|
50
51
|
# Builds a XML document
|
@@ -167,6 +168,23 @@ module OpenNebula
|
|
167
168
|
|
168
169
|
end
|
169
170
|
|
171
|
+
# Iterates over every Element in the XPath and returns an array
|
172
|
+
# with XMLElements
|
173
|
+
# @return [XMLElement]
|
174
|
+
def retrieve_xmlelements(xpath_str)
|
175
|
+
collection = []
|
176
|
+
if NOKOGIRI
|
177
|
+
@xml.xpath(xpath_str).each { |pelem|
|
178
|
+
collection << XMLElement.new(pelem)
|
179
|
+
}
|
180
|
+
else
|
181
|
+
@xml.elements.each(xpath_str) { |pelem|
|
182
|
+
collection << XMLElement.new(pelem)
|
183
|
+
}
|
184
|
+
end
|
185
|
+
collection
|
186
|
+
end
|
187
|
+
|
170
188
|
# Gets an attribute from an element
|
171
189
|
# key:: _String_ xpath for the element
|
172
190
|
# name:: _String_ name of the attribute
|
data/lib/opennebula/zone.rb
CHANGED
@@ -28,7 +28,9 @@ module OpenNebula
|
|
28
28
|
:allocate => "zone.allocate",
|
29
29
|
:update => "zone.update",
|
30
30
|
:rename => "zone.rename",
|
31
|
-
:delete => "zone.delete"
|
31
|
+
:delete => "zone.delete",
|
32
|
+
:addserver => "zone.addserver",
|
33
|
+
:delserver => "zone.delserver"
|
32
34
|
}
|
33
35
|
|
34
36
|
# Creates a Zone description with just its identifier
|
@@ -103,5 +105,26 @@ module OpenNebula
|
|
103
105
|
def rename(name)
|
104
106
|
return call(ZONE_METHODS[:rename], @pe_id, name)
|
105
107
|
end
|
108
|
+
|
109
|
+
# Adds servers to this Zone
|
110
|
+
#
|
111
|
+
# @param name [String] Template with zone servers
|
112
|
+
# SERVER = [ NAME = "<server_name>", ENDPOINT = "<rpc_ep>" ]
|
113
|
+
#
|
114
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
115
|
+
# otherwise
|
116
|
+
def add_servers(servers)
|
117
|
+
return call(ZONE_METHODS[:addserver], @pe_id, servers)
|
118
|
+
end
|
119
|
+
|
120
|
+
# Delete servers from this Zone
|
121
|
+
#
|
122
|
+
# @param id [Int] Server ID
|
123
|
+
#
|
124
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
125
|
+
# otherwise
|
126
|
+
def delete_servers(server_id)
|
127
|
+
return call(ZONE_METHODS[:delserver], @pe_id, server_id)
|
128
|
+
end
|
106
129
|
end
|
107
130
|
end
|
data/lib/opennebula.rb
CHANGED
@@ -62,9 +62,11 @@ require 'opennebula/marketplace'
|
|
62
62
|
require 'opennebula/marketplace_pool'
|
63
63
|
require 'opennebula/marketplaceapp'
|
64
64
|
require 'opennebula/marketplaceapp_pool'
|
65
|
+
require 'opennebula/vm_group'
|
66
|
+
require 'opennebula/vm_group_pool'
|
65
67
|
|
66
68
|
module OpenNebula
|
67
69
|
|
68
70
|
# OpenNebula version
|
69
|
-
VERSION = '5.
|
71
|
+
VERSION = '5.3.80'
|
70
72
|
end
|