opennebula 6.10.3 → 6.99.85.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 (131) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cloud/CloudClient.rb +3 -3
  3. data/lib/models/role.rb +349 -823
  4. data/lib/models/service.rb +156 -80
  5. data/lib/models/vmrole.rb +703 -0
  6. data/lib/models/vrrole.rb +284 -0
  7. data/lib/models.rb +3 -1
  8. data/lib/opennebula/acl.rb +1 -1
  9. data/lib/opennebula/acl_pool.rb +1 -1
  10. data/lib/opennebula/backupjob.rb +1 -1
  11. data/lib/opennebula/backupjob_pool.rb +1 -1
  12. data/lib/opennebula/client.rb +1 -1
  13. data/lib/opennebula/cluster.rb +45 -2
  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/flow/grammar.rb +1 -1
  23. data/lib/opennebula/flow/service_pool.rb +1 -1
  24. data/lib/opennebula/flow/service_template.rb +353 -97
  25. data/lib/opennebula/flow/service_template_ext.rb +3 -3
  26. data/lib/opennebula/flow/service_template_pool.rb +1 -1
  27. data/lib/opennebula/flow/validator.rb +458 -410
  28. data/lib/opennebula/flow.rb +1 -1
  29. data/lib/opennebula/group.rb +1 -1
  30. data/lib/opennebula/group_pool.rb +1 -1
  31. data/lib/opennebula/hook.rb +1 -1
  32. data/lib/opennebula/hook_log.rb +1 -1
  33. data/lib/opennebula/hook_pool.rb +1 -1
  34. data/lib/opennebula/host.rb +1 -60
  35. data/lib/opennebula/host_pool.rb +1 -1
  36. data/lib/opennebula/image.rb +1 -1
  37. data/lib/opennebula/image_pool.rb +1 -1
  38. data/lib/opennebula/ldap_auth.rb +1 -1
  39. data/lib/opennebula/ldap_auth_spec.rb +1 -1
  40. data/lib/opennebula/lockable_ext.rb +1 -1
  41. data/lib/opennebula/marketplace.rb +1 -1
  42. data/lib/opennebula/marketplace_pool.rb +1 -1
  43. data/lib/opennebula/marketplaceapp.rb +1 -1
  44. data/lib/opennebula/marketplaceapp_ext.rb +14 -211
  45. data/lib/opennebula/marketplaceapp_pool.rb +1 -1
  46. data/lib/opennebula/oneflow_client.rb +11 -9
  47. data/lib/opennebula/pool.rb +1 -1
  48. data/lib/opennebula/pool_element.rb +1 -1
  49. data/lib/opennebula/security_group.rb +1 -1
  50. data/lib/opennebula/security_group_pool.rb +1 -1
  51. data/lib/opennebula/server_cipher_auth.rb +1 -1
  52. data/lib/opennebula/server_x509_auth.rb +1 -1
  53. data/lib/opennebula/ssh_auth.rb +1 -1
  54. data/lib/opennebula/system.rb +1 -1
  55. data/lib/opennebula/template.rb +1 -1
  56. data/lib/opennebula/template_ext.rb +1 -1
  57. data/lib/opennebula/template_pool.rb +1 -1
  58. data/lib/opennebula/user.rb +1 -1
  59. data/lib/opennebula/user_pool.rb +1 -1
  60. data/lib/opennebula/utils.rb +2 -2
  61. data/lib/opennebula/vdc.rb +1 -1
  62. data/lib/opennebula/vdc_pool.rb +1 -1
  63. data/lib/opennebula/virtual_machine.rb +3 -12
  64. data/lib/opennebula/virtual_machine_ext.rb +2 -31
  65. data/lib/opennebula/virtual_machine_pool.rb +1 -1
  66. data/lib/opennebula/virtual_network.rb +1 -1
  67. data/lib/opennebula/virtual_network_pool.rb +1 -1
  68. data/lib/opennebula/virtual_router.rb +1 -1
  69. data/lib/opennebula/virtual_router_pool.rb +1 -1
  70. data/lib/opennebula/vm_group.rb +1 -1
  71. data/lib/opennebula/vm_group_pool.rb +1 -1
  72. data/lib/opennebula/vntemplate.rb +1 -1
  73. data/lib/opennebula/vntemplate_pool.rb +1 -1
  74. data/lib/opennebula/wait_ext.rb +1 -1
  75. data/lib/opennebula/x509_auth.rb +1 -1
  76. data/lib/opennebula/xml_element.rb +2 -2
  77. data/lib/opennebula/xml_pool.rb +1 -1
  78. data/lib/opennebula/xml_utils.rb +1 -1
  79. data/lib/opennebula/zone.rb +1 -1
  80. data/lib/opennebula/zone_pool.rb +1 -1
  81. data/lib/opennebula.rb +2 -2
  82. metadata +6 -67
  83. data/lib/ActionManager.rb +0 -280
  84. data/lib/CommandManager.rb +0 -328
  85. data/lib/DriverExecHelper.rb +0 -213
  86. data/lib/HostSyncManager.rb +0 -111
  87. data/lib/OpenNebulaDriver.rb +0 -223
  88. data/lib/VirtualMachineDriver.rb +0 -404
  89. data/lib/datacenter.rb +0 -1319
  90. data/lib/datastore.rb +0 -1049
  91. data/lib/distributed_firewall.rb +0 -293
  92. data/lib/file_helper.rb +0 -374
  93. data/lib/host.rb +0 -1518
  94. data/lib/logical_port.rb +0 -50
  95. data/lib/logical_switch.rb +0 -77
  96. data/lib/memoize.rb +0 -74
  97. data/lib/network.rb +0 -705
  98. data/lib/nsx_client.rb +0 -157
  99. data/lib/nsx_component.rb +0 -28
  100. data/lib/nsx_constants.rb +0 -162
  101. data/lib/nsx_driver.rb +0 -91
  102. data/lib/nsx_error.rb +0 -77
  103. data/lib/nsx_rule.rb +0 -206
  104. data/lib/nsxt_client.rb +0 -189
  105. data/lib/nsxt_dfw.rb +0 -196
  106. data/lib/nsxt_logical_port.rb +0 -94
  107. data/lib/nsxt_rule.rb +0 -188
  108. data/lib/nsxt_tz.rb +0 -38
  109. data/lib/nsxv_client.rb +0 -189
  110. data/lib/nsxv_dfw.rb +0 -202
  111. data/lib/nsxv_logical_port.rb +0 -107
  112. data/lib/nsxv_rule.rb +0 -172
  113. data/lib/nsxv_tz.rb +0 -41
  114. data/lib/opaque_network.rb +0 -134
  115. data/lib/rest_client.rb +0 -191
  116. data/lib/scripts_common.rb +0 -176
  117. data/lib/transport_zone.rb +0 -43
  118. data/lib/vcenter_driver.rb +0 -152
  119. data/lib/vcenter_importer.rb +0 -626
  120. data/lib/vi_client.rb +0 -273
  121. data/lib/vi_helper.rb +0 -328
  122. data/lib/virtual_machine.rb +0 -3574
  123. data/lib/virtual_wire.rb +0 -158
  124. data/lib/vm_device.rb +0 -80
  125. data/lib/vm_disk.rb +0 -202
  126. data/lib/vm_folder.rb +0 -69
  127. data/lib/vm_helper.rb +0 -30
  128. data/lib/vm_monitor.rb +0 -305
  129. data/lib/vm_nic.rb +0 -70
  130. data/lib/vm_template.rb +0 -2112
  131. data/lib/vmm_importer.rb +0 -165
data/lib/nsx_client.rb DELETED
@@ -1,157 +0,0 @@
1
- # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2024, 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
- module NSXDriver
17
-
18
- ONE_LOCATION = ENV['ONE_LOCATION'] unless defined?(ONE_LOCATION)
19
-
20
- if !ONE_LOCATION
21
- RUBY_LIB_LOCATION = '/usr/lib/one/ruby' \
22
- unless defined?(RUBY_LIB_LOCATION)
23
- GEMS_LOCATION = '/usr/share/one/gems' \
24
- unless defined?(GEMS_LOCATION)
25
- else
26
- RUBY_LIB_LOCATION = ONE_LOCATION + '/lib/ruby' \
27
- unless defined?(RUBY_LIB_LOCATION)
28
- GEMS_LOCATION = ONE_LOCATION + '/share/gems' \
29
- unless defined?(GEMS_LOCATION)
30
- end
31
-
32
- # rubocop: disable all
33
- # %%RUBYGEMS_SETUP_BEGIN%%
34
- if File.directory?(GEMS_LOCATION)
35
- real_gems_path = File.realpath(GEMS_LOCATION)
36
- if !defined?(Gem) || Gem.path != [real_gems_path]
37
- $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
38
-
39
- # Suppress warnings from Rubygems
40
- # https://github.com/OpenNebula/one/issues/5379
41
- begin
42
- verb = $VERBOSE
43
- $VERBOSE = nil
44
- require 'rubygems'
45
- Gem.use_paths(real_gems_path)
46
- ensure
47
- $VERBOSE = verb
48
- end
49
- end
50
- end
51
- # %%RUBYGEMS_SETUP_END%%
52
- # rubocop: enable all
53
-
54
- $LOAD_PATH << RUBY_LIB_LOCATION
55
-
56
- require 'net/http'
57
- require 'json'
58
- require 'nokogiri'
59
- require 'opennebula'
60
- require 'vcenter_driver'
61
- require 'nsx_driver'
62
-
63
- # Class NSXClient
64
- class NSXClient
65
-
66
- # ATTIBUTES
67
- attr_accessor :nsxmgr
68
- attr_accessor :nsx_user
69
- attr_accessor :nsx_password
70
-
71
- # CONSTRUCTORS
72
- def initialize(nsxmgr, nsx_user, nsx_password)
73
- @nsxmgr = nsxmgr
74
- @nsx_user = nsx_user
75
- @nsx_password = nsx_password
76
- end
77
-
78
- def self.new_child(nsxmgr, nsx_user, nsx_password, type)
79
- [nsxmgr, nsx_user, nsx_password, type].each do |v|
80
- next if !v.nil? && !v.empty?
81
-
82
- return nil
83
- end
84
-
85
- case type.upcase
86
- when NSXConstants::NSXT
87
- NSXTClient.new(nsxmgr, nsx_user, nsx_password)
88
- when NSXConstants::NSXV
89
- NSXVClient.new(nsxmgr, nsx_user, nsx_password)
90
- else
91
- error_msg = "Unknown NSX type: #{type}"
92
- error = NSXError::UnknownObject.new(error_msg)
93
- raise error
94
- end
95
- end
96
-
97
- def self.new_from_host(host)
98
- nsxmgr = host['TEMPLATE/NSX_MANAGER']
99
- nsx_user = host['TEMPLATE/NSX_USER']
100
- nsx_password = host['TEMPLATE/NSX_PASSWORD']
101
- nsx_type = host['TEMPLATE/NSX_TYPE']
102
-
103
- new_child(nsxmgr, nsx_user, nsx_password, nsx_type)
104
- end
105
-
106
- def self.new_from_id(hid)
107
- client = OpenNebula::Client.new
108
- host = OpenNebula::Host.new_with_id(hid, client)
109
-
110
- rc = host.info(true)
111
-
112
- if OpenNebula.is_error?(rc)
113
- raise "Could not get host info for ID: #{hid} - #{rc.message}"
114
- end
115
-
116
- new_from_host(host)
117
- end
118
-
119
- # METHODS
120
-
121
- # Return response if match with responses codes, If response not match
122
- # with expected responses codes then raise an IncorrectResponseCodeError
123
- def check_response(response, codes_array)
124
- unless response.nil?
125
- return response if codes_array.include?(response.code.to_i)
126
-
127
- response_json = JSON.parse(response.body)
128
- nsx_error = "\nNSX error code: " \
129
- "#{response_json['errorCode']}, " \
130
- "\nNSX error details: " \
131
- "#{response_json['details']}"
132
- raise NSXError::IncorrectResponseCodeError, nsx_error
133
- end
134
- raise NSXError::IncorrectResponseCodeError, nsx_error
135
- end
136
-
137
- # Return: respose.body
138
- def get(url, aditional_headers = []); end
139
-
140
- # Return: response
141
- def get_full_response(url, aditional_headers = []); end
142
-
143
- # Return: id of the created object
144
- def post(url, data, aditional_headers = []); end
145
-
146
- def put(url, data, aditional_headers = []); end
147
-
148
- def delete(url); end
149
-
150
- def get_token(url); end
151
-
152
- # Prepare headers
153
- def add_headers(aditional_headers = []); end
154
-
155
- end
156
-
157
- end
data/lib/nsx_component.rb DELETED
@@ -1,28 +0,0 @@
1
- # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2024, 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
- module NSXDriver
17
-
18
- # Class Transport Zone
19
- class NSXComponent
20
-
21
- # CONSTRUCTOR
22
- def initialize(nsx_client)
23
- @nsx_client = nsx_client
24
- end
25
-
26
- end
27
-
28
- end
data/lib/nsx_constants.rb DELETED
@@ -1,162 +0,0 @@
1
- # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2024, 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
- module NSXDriver
17
-
18
- ONE_LOCATION = ENV['ONE_LOCATION'] unless defined?(ONE_LOCATION)
19
-
20
- if !ONE_LOCATION
21
- RUBY_LIB_LOCATION = '/usr/lib/one/ruby' \
22
- unless defined?(RUBY_LIB_LOCATION)
23
- GEMS_LOCATION = '/usr/share/one/gems' \
24
- unless defined?(GEMS_LOCATION)
25
- else
26
- RUBY_LIB_LOCATION = ONE_LOCATION + '/lib/ruby' \
27
- unless defined?(RUBY_LIB_LOCATION)
28
- GEMS_LOCATION = ONE_LOCATION + '/share/gems' \
29
- unless defined?(GEMS_LOCATION)
30
- end
31
-
32
- # rubocop: disable all
33
- # %%RUBYGEMS_SETUP_BEGIN%%
34
- if File.directory?(GEMS_LOCATION)
35
- real_gems_path = File.realpath(GEMS_LOCATION)
36
- if !defined?(Gem) || Gem.path != [real_gems_path]
37
- $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
38
-
39
- # Suppress warnings from Rubygems
40
- # https://github.com/OpenNebula/one/issues/5379
41
- begin
42
- verb = $VERBOSE
43
- $VERBOSE = nil
44
- require 'rubygems'
45
- Gem.use_paths(real_gems_path)
46
- ensure
47
- $VERBOSE = verb
48
- end
49
- end
50
- end
51
- # %%RUBYGEMS_SETUP_END%%
52
- # rubocop: enable all
53
-
54
- $LOAD_PATH << RUBY_LIB_LOCATION
55
-
56
- class NSXConstants
57
-
58
- # CONSTANTS
59
- NSXT = 'NSX-T'
60
- NSXV = 'NSX-V'
61
- HEADER_JSON = { 'Content-Type' => 'application/json' }
62
- HEADER_XML = { 'Content-Type' => 'application/xml' }
63
- # NSX Manager
64
- NSXT_EXTENSION_LIST = 'com.vmware.nsx.management.nsxt'
65
- NSXV_EXTENSION_LIST = 'com.vmware.vShieldManager'
66
- NSXT_BASE = '/api/v1'
67
- NSXV_BASE = '/api/2.0'
68
- # Transport Zones
69
- NSXV_TZS = NSXV_BASE + '/vdn/scopes'
70
- NSXV_TZS_XPATH = '//vdnScope'
71
- NSXT_TZS = NSXT_BASE + '/transport-zones'
72
- # VirtualWire
73
- NSXV_AUTH = NSXV_BASE + '/services/auth/token'
74
- NSXV_LS_TYPE = 'NSX-V'
75
- NSXV_LS_NAME_XPATH = '//virtualWire/name'
76
- NSXV_LS_VNI_XPATH = '//virtualWire/vdnId'
77
- NSXV_LS_BACKING_XPATH = '//virtualWire/vdsContextWithBacking' \
78
- '/backingValue'
79
- NSXV_LS_OBJECTID_XPATH = '//virtualWire/vdsContextWithBacking' \
80
- '/switch/objectId'
81
- NSXV_LS_XPATH = '//virtualWire'
82
- NSXV_LS_SECTION = NSXV_BASE + '/vdn/virtualwires/'
83
- NSXV_TZ_SECTION = NSXV_BASE + '/vdn/scopes/'
84
- NSXV_TZ_XPATH = '//virtualWire/vdnScopeId'
85
- # OpaqueNetwork
86
- NSXT_AUTH = NSXT_BASE + '/aaa/registration-token'
87
- NSXT_LS_TYPE = 'Opaque Network'
88
- NSXT_LS_SECTION = NSXT_BASE + '/logical-switches/'
89
- # DFW
90
- ONE_SECTION_NAME = 'OpenNebula'
91
- NSXT_DFW_BASE = NSXT_BASE + '/firewall'
92
- NSXV_DFW_BASE = '/api/4.0/firewall/globalroot-0/config'
93
- NSXT_DFW_SECTIONS = '/sections'
94
- NSXV_DFW_SECTIONS = '/layer3sections'
95
- NSXV_DFW_SECTION_XPATH = '//section'
96
- NSXV_DFW_RULE_XPATH = '//rule'
97
- # RULE
98
- NSXT_RULE_BASE = NSXT_BASE + '/firewall/rules'
99
- NSXT_RULE_PROTOCOL = {
100
- 'TCP' => {
101
- :service => {
102
- :l4_protocol => 'TCP',
103
- :source_ports => [],
104
- :destination_ports => [],
105
- :resource_type => 'L4PortSetNSService'
106
- }
107
- },
108
- 'UDP' => {
109
- :service => {
110
- :l4_protocol => 'UDP',
111
- :source_ports => [],
112
- :destination_ports => [],
113
- :resource_type => 'L4PortSetNSService'
114
- }
115
- },
116
- 'ICMP' => {
117
- :service => {
118
- :protocol => 'ICMPv4',
119
- :resource_type => 'ICMPTypeNSService'
120
- }
121
- },
122
- 'ICMPv6' => {
123
- :service => {
124
- :protocol => 'ICMPv6',
125
- :resource_type => 'ICMPTypeNSService'
126
- }
127
- }
128
- }
129
- NSXV_RULE_BASE = 'xxx'
130
- NSX_RULE_IPSEC_PORTS = ['500', '4500']
131
- # Logical Ports
132
- NSXT_LP_BASE = NSXT_BASE + '/logical-ports/'
133
- NSXV_LP_BASE = ''
134
- # Messages
135
- MSG_INCOMPLETE_REQ = 'Incomplete request, NSX_MANAGER, NSX_USER, \
136
- NSX_PASSWORD and NSX_TYPE are needed'
137
- MSG_INVALID_REQ = 'Invalid request, check that NSX_MANAGER, NSX_USER, \
138
- NSX_PASSWORD and NSX_TYPE are correct'
139
- MSG_INVALID_NSXTYPE = 'Invalid NSX-TYPE: Only NSX-T and NSX-V are \
140
- supported'
141
- # Responses codes
142
- # 2xx
143
- CODE_OK = 200
144
- CODE_CREATED = 201
145
- CODE_ACCEPTED = 202
146
- CODE_NO_CONTENT = 204
147
- # 4xx
148
- CODE_BAD_REQUEST = 400
149
- CODE_UNAUTHORIZED = 401
150
- CODE_FORBIDDEN = 403
151
- CODE_NOT_FOUND = 404
152
- CODE_METHOD_NOT_ALLOWED = 405
153
- CODE_NOT_ACCEPTABLE = 406
154
- # 5xx
155
- CODE_INTERNAL_SERVER_ERROR = 500
156
- CODE_BAD_GATEWAY = 502
157
- CODE_SERVICE_UNAVAILABLE = 503
158
- CODE_GATEWAY_TIMEOUT = 504
159
-
160
- end
161
-
162
- end
data/lib/nsx_driver.rb DELETED
@@ -1,91 +0,0 @@
1
- # ---------------------------------------------------------------------------- #
2
- # Copyright 2002-2024, 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
- # ---------------------------------------------------------------------------- #
18
- # Set up the environment for the driver #
19
- # ---------------------------------------------------------------------------- #
20
-
21
- ONE_LOCATION = ENV['ONE_LOCATION'] unless defined?(ONE_LOCATION)
22
-
23
- if !ONE_LOCATION
24
- BIN_LOCATION = '/usr/bin' unless defined?(BIN_LOCATION)
25
- LIB_LOCATION = '/usr/lib/one' unless defined?(LIB_LOCATION)
26
- ETC_LOCATION = '/etc/one/' unless defined?(ETC_LOCATION)
27
- VAR_LOCATION = '/var/lib/one' unless defined?(VAR_LOCATION)
28
- GEMS_LOCATION = '/usr/share/one/gems' unless defined?(GEMS_LOCATION)
29
- else
30
- BIN_LOCATION = ONE_LOCATION + '/bin' unless defined?(BIN_LOCATION)
31
- LIB_LOCATION = ONE_LOCATION + '/lib' unless defined?(LIB_LOCATION)
32
- ETC_LOCATION = ONE_LOCATION + '/etc/' unless defined?(ETC_LOCATION)
33
- VAR_LOCATION = ONE_LOCATION + '/var/' unless defined?(VAR_LOCATION)
34
- GEMS_LOCATION = ONE_LOCATION + '/share/gems' unless defined?(GEMS_LOCATION)
35
- end
36
-
37
- ENV['LANG'] = 'C'
38
-
39
- # rubocop: disable all
40
- # %%RUBYGEMS_SETUP_BEGIN%%
41
- if File.directory?(GEMS_LOCATION)
42
- real_gems_path = File.realpath(GEMS_LOCATION)
43
- if !defined?(Gem) || Gem.path != [real_gems_path]
44
- $LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
45
-
46
- # Suppress warnings from Rubygems
47
- # https://github.com/OpenNebula/one/issues/5379
48
- begin
49
- verb = $VERBOSE
50
- $VERBOSE = nil
51
- require 'rubygems'
52
- Gem.use_paths(real_gems_path)
53
- ensure
54
- $VERBOSE = verb
55
- end
56
- end
57
- end
58
- # %%RUBYGEMS_SETUP_END%%
59
- # rubocop: enable all
60
-
61
- $LOAD_PATH << LIB_LOCATION + '/ruby'
62
- $LOAD_PATH << LIB_LOCATION + '/ruby/nsx_driver'
63
-
64
- # ---------------------------------------------------------------------------- #
65
- # NSX Library #
66
- # ---------------------------------------------------------------------------- #
67
- require 'nsx_constants'
68
- require 'nsx_error'
69
- require 'nsx_component'
70
- require 'nsx_client'
71
- require 'nsxt_client'
72
- require 'nsxv_client'
73
- require 'logical_switch'
74
- require 'opaque_network'
75
- require 'transport_zone'
76
- require 'nsxt_tz'
77
- require 'nsxv_tz'
78
- require 'virtual_wire'
79
- require 'distributed_firewall'
80
- require 'nsxt_dfw'
81
- require 'nsxv_dfw'
82
- require 'logical_port'
83
- require 'nsxt_logical_port'
84
- require 'nsxv_logical_port'
85
- require 'nsx_rule'
86
- require 'nsxt_rule'
87
- require 'nsxv_rule'
88
-
89
- # NSX Driver module
90
- module NSXDriver
91
- end
data/lib/nsx_error.rb DELETED
@@ -1,77 +0,0 @@
1
- # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2024, 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
- module NSXDriver
17
-
18
- class NSXError < StandardError
19
-
20
- # Class IncorrectResponseCodeError
21
- class IncorrectResponseCodeError < NSXError
22
-
23
- def initialize(msg = 'Incorrect response code')
24
- super(msg)
25
- end
26
-
27
- end
28
-
29
- # Class ObjectNotFound
30
- class ObjectNotFound < NSXError
31
-
32
- def initialize(msg = 'Object not found')
33
- super(msg)
34
- end
35
-
36
- end
37
-
38
- # Class UnknownObject
39
- class UnknownObject < NSXError
40
-
41
- def initialize(msg = 'Unknown object type')
42
- super(msg)
43
- end
44
-
45
- end
46
-
47
- # Class CreateError
48
- class CreateError < NSXError
49
-
50
- def initialize(msg = 'Error creating NSX object')
51
- super(msg)
52
- end
53
-
54
- end
55
-
56
- # Class DeleteError
57
- class DeleteError < NSXError
58
-
59
- def initialize(msg = 'Error deleting NSX object')
60
- super(msg)
61
- end
62
-
63
- end
64
-
65
- # Class DeleteError
66
- class MissingParameter < NSXError
67
-
68
- def initialize(parameter)
69
- msg = "Missing NSX parameter #{parameter}"
70
- super(msg)
71
- end
72
-
73
- end
74
-
75
- end
76
-
77
- end