opennebula 5.4.15 → 5.5.80.pre

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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/NOTICE +1 -1
  3. data/lib/ActionManager.rb +1 -1
  4. data/lib/CommandManager.rb +82 -59
  5. data/lib/DriverExecHelper.rb +1 -1
  6. data/lib/OpenNebulaDriver.rb +1 -1
  7. data/lib/VirtualMachineDriver.rb +1 -1
  8. data/lib/cloud/CloudClient.rb +3 -3
  9. data/lib/opennebula.rb +2 -2
  10. data/lib/opennebula/acl.rb +1 -1
  11. data/lib/opennebula/acl_pool.rb +1 -1
  12. data/lib/opennebula/client.rb +1 -1
  13. data/lib/opennebula/cluster.rb +1 -1
  14. data/lib/opennebula/cluster_pool.rb +1 -1
  15. data/lib/opennebula/datastore.rb +1 -1
  16. data/lib/opennebula/datastore_pool.rb +1 -1
  17. data/lib/opennebula/document.rb +1 -1
  18. data/lib/opennebula/document_json.rb +1 -1
  19. data/lib/opennebula/document_pool.rb +1 -1
  20. data/lib/opennebula/document_pool_json.rb +1 -1
  21. data/lib/opennebula/error.rb +1 -1
  22. data/lib/opennebula/group.rb +1 -1
  23. data/lib/opennebula/group_pool.rb +1 -1
  24. data/lib/opennebula/host.rb +1 -1
  25. data/lib/opennebula/host_pool.rb +1 -1
  26. data/lib/opennebula/image.rb +12 -2
  27. data/lib/opennebula/image_pool.rb +1 -1
  28. data/lib/opennebula/ldap_auth.rb +15 -20
  29. data/lib/opennebula/ldap_auth_spec.rb +1 -1
  30. data/lib/opennebula/marketplace.rb +1 -1
  31. data/lib/opennebula/marketplace_pool.rb +1 -1
  32. data/lib/opennebula/marketplaceapp.rb +14 -2
  33. data/lib/opennebula/marketplaceapp_pool.rb +1 -1
  34. data/lib/opennebula/oneflow_client.rb +1 -1
  35. data/lib/opennebula/pool.rb +1 -1
  36. data/lib/opennebula/pool_element.rb +24 -3
  37. data/lib/opennebula/security_group.rb +1 -1
  38. data/lib/opennebula/security_group_pool.rb +1 -1
  39. data/lib/opennebula/server_cipher_auth.rb +1 -1
  40. data/lib/opennebula/server_x509_auth.rb +1 -1
  41. data/lib/opennebula/ssh_auth.rb +1 -1
  42. data/lib/opennebula/system.rb +1 -1
  43. data/lib/opennebula/template.rb +14 -2
  44. data/lib/opennebula/template_pool.rb +1 -1
  45. data/lib/opennebula/user.rb +1 -1
  46. data/lib/opennebula/user_pool.rb +1 -1
  47. data/lib/opennebula/utils.rb +20 -1
  48. data/lib/opennebula/vdc.rb +1 -1
  49. data/lib/opennebula/vdc_pool.rb +1 -1
  50. data/lib/opennebula/virtual_machine.rb +19 -4
  51. data/lib/opennebula/virtual_machine_pool.rb +1 -1
  52. data/lib/opennebula/virtual_network.rb +12 -2
  53. data/lib/opennebula/virtual_network_pool.rb +1 -1
  54. data/lib/opennebula/virtual_router.rb +13 -1
  55. data/lib/opennebula/virtual_router_pool.rb +1 -1
  56. data/lib/opennebula/vm_group.rb +14 -2
  57. data/lib/opennebula/vm_group_pool.rb +1 -1
  58. data/lib/opennebula/x509_auth.rb +1 -1
  59. data/lib/opennebula/xml_element.rb +10 -1
  60. data/lib/opennebula/xml_pool.rb +1 -1
  61. data/lib/opennebula/xml_utils.rb +1 -1
  62. data/lib/opennebula/zone.rb +67 -1
  63. data/lib/opennebula/zone_pool.rb +1 -1
  64. data/lib/vcenter_driver.rb +17 -1
  65. metadata +4 -4
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -28,7 +28,9 @@ module OpenNebula
28
28
  :delete => "vmgroup.delete",
29
29
  :chown => "vmgroup.chown",
30
30
  :chmod => "vmgroup.chmod",
31
- :rename => "vmgroup.rename"
31
+ :rename => "vmgroup.rename",
32
+ :lock => "vmgroup.lock",
33
+ :unlock => "vmgroup.unlock"
32
34
  }
33
35
 
34
36
  # Creates a VMGroup description with just its identifier
@@ -129,6 +131,16 @@ module OpenNebula
129
131
  return call(VMGROUP_METHODS[:rename], @pe_id, name)
130
132
  end
131
133
 
134
+ # Lock a VMGroup
135
+ def lock(level)
136
+ return call(VMGROUP_METHODS[:lock], @pe_id, level)
137
+ end
138
+
139
+ # Unlock a VMGroup
140
+ def unlock()
141
+ return call(VMGROUP_METHODS[:unlock], @pe_id)
142
+ end
143
+
132
144
  #######################################################################
133
145
  # Helpers to get VMGroup information
134
146
  #######################################################################
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -145,6 +145,15 @@ module OpenNebula
145
145
  }
146
146
  end
147
147
 
148
+ # Update the content of the current doc
149
+ def set_content(content)
150
+ if NOKOGIRI
151
+ @xml.content = content
152
+ else
153
+ @xml.text = content
154
+ end
155
+ end
156
+
148
157
  # Gets an array of text from elements extracted
149
158
  # using the XPATH expression passed as filter
150
159
  def retrieve_elements(filter)
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -66,7 +66,48 @@ module OpenNebula
66
66
  super(ZONE_METHODS[:info], 'ZONE')
67
67
  end
68
68
 
69
+ # Retrieves the information extended of the given Zone.
70
+ # @return [nil, OpenNebula::Error] nil in case of success, Error
71
+ # otherwise
72
+ def info_extended()
73
+ rc = info()
74
+
75
+ return rc if OpenNebula.is_error?(rc)
76
+
77
+ @xml.xpath("SERVER_POOL/SERVER").each do |server|
78
+ endpoint = server.xpath("ENDPOINT")
79
+ endpoint = endpoint.text if endpoint
80
+
81
+ next if endpoint.nil?
82
+
83
+ client = OpenNebula::Client.new(nil, endpoint, {:timeout => 5})
84
+
85
+ xml = client.call("zone.raftstatus")
86
+
87
+ if OpenNebula.is_error?(xml)
88
+ add_element(server, "STATE", "-")
89
+ add_element(server, "TERM", "-")
90
+ add_element(server, "VOTEDFOR", "-")
91
+ add_element(server, "COMMIT", "-")
92
+ add_element(server, "LOG_INDEX", "-")
93
+ add_element(server, "FEDLOG_INDEX", "-")
94
+
95
+ next
96
+ end
97
+
98
+ xml = Nokogiri::XML(xml)
99
+
100
+ add_element_xml(server, xml, "STATE", "RAFT/STATE")
101
+ add_element_xml(server, xml, "TERM", "RAFT/TERM")
102
+ add_element_xml(server, xml, "VOTEDFOR", "RAFT/VOTEDFOR")
103
+ add_element_xml(server, xml, "COMMIT", "RAFT/COMMIT")
104
+ add_element_xml(server, xml, "LOG_INDEX", "RAFT/LOG_INDEX")
105
+ add_element_xml(server, xml, "FEDLOG_INDEX","RAFT/FEDLOG_INDEX")
106
+ end
107
+ end
108
+
69
109
  alias_method :info!, :info
110
+ alias_method :info_extended!, :info_extended
70
111
 
71
112
  # Allocates a new Zone in OpenNebula
72
113
  #
@@ -126,5 +167,30 @@ module OpenNebula
126
167
  def delete_servers(server_id)
127
168
  return call(ZONE_METHODS[:delserver], @pe_id, server_id)
128
169
  end
170
+
171
+ private
172
+
173
+ # These methods adds elements to the given node of the zone
174
+ def add_element(parent, key, value)
175
+ elem = Nokogiri::XML::Node.new(key, @xml.document)
176
+ elem.content = value
177
+
178
+ parent.add_child(elem)
179
+ end
180
+
181
+ def add_element_xml(parent, doc, key, xpath)
182
+ value = doc.at_xpath(xpath)
183
+
184
+ if value
185
+ value = value.text
186
+ else
187
+ value = "-"
188
+ end
189
+
190
+ elem = Nokogiri::XML::Node.new(key, @xml.document)
191
+ elem.content = value
192
+
193
+ parent.add_child(elem)
194
+ end
129
195
  end
130
196
  end
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # ---------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -48,6 +48,7 @@ require 'openssl'
48
48
  # vCenter Library #
49
49
  # ---------------------------------------------------------------------------- #
50
50
 
51
+ require 'vcenter_importer.rb'
51
52
  require 'memoize'
52
53
  require 'vi_client'
53
54
  require 'vi_helper'
@@ -59,6 +60,7 @@ require 'network'
59
60
  require 'file_helper'
60
61
  require 'importer'
61
62
 
63
+ CHECK_REFS = true
62
64
  # ---------------------------------------------------------------------------- #
63
65
  # Helper functions #
64
66
  # ---------------------------------------------------------------------------- #
@@ -77,3 +79,17 @@ def check_valid(parameter, label)
77
79
  exit -1
78
80
  end
79
81
  end
82
+
83
+ def check_item(item, target_class)
84
+ begin
85
+ item.name if CHECK_REFS
86
+ if target_class
87
+ if !item.instance_of?(target_class)
88
+ raise "Expecting type 'RbVmomi::VIM::#{target_class}'. " <<
89
+ "Got '#{item.class} instead."
90
+ end
91
+ end
92
+ rescue RbVmomi::Fault => e
93
+ raise "Reference \"#{item._ref}\" error. The reference does not exist"
94
+ end
95
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.15
4
+ version: 5.5.80.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-18 00:00:00.000000000 Z
11
+ date: 2018-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -137,9 +137,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - '>='
140
+ - - '>'
141
141
  - !ruby/object:Gem::Version
142
- version: '0'
142
+ version: 1.3.1
143
143
  requirements: []
144
144
  rubyforge_project:
145
145
  rubygems_version: 2.0.14.1