opennebula 7.2.0 → 7.3.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.
- checksums.yaml +4 -4
- data/lib/cloud/CloudClient.rb +1 -1
- data/lib/models/vmrole.rb +64 -0
- data/lib/models/vrrole.rb +9 -0
- data/lib/opennebula/error.rb +1 -1
- data/lib/opennebula/group.rb +15 -0
- data/lib/opennebula/grpc/group_pb.rb +2 -1
- data/lib/opennebula/grpc/group_services_pb.rb +1 -0
- data/lib/opennebula/grpc/vm_pb.rb +3 -1
- data/lib/opennebula/grpc/vm_services_pb.rb +2 -0
- data/lib/opennebula/lib/client.rb +138 -0
- data/lib/opennebula/lib/grpc_client.rb +105 -0
- data/lib/opennebula/lib/xml_client.rb +178 -0
- data/lib/opennebula/version.rb +1 -1
- data/lib/opennebula/virtual_machine.rb +22 -1
- data/lib/opennebula/virtual_machine_pool.rb +0 -1
- data/lib/opennebula/virtual_network.rb +0 -36
- data/lib/opennebula/vm_group_pool.rb +1 -0
- data/lib/opennebula/zone_pool.rb +1 -0
- metadata +7 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d0f6cee39422e6d1cf47a18a969901d01da1feeec7c75770a3e1281877704d87
|
|
4
|
+
data.tar.gz: af582244a4340f44701146566dc69914b15dbcaedc31d8e169d0eaf002c55aae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a054777999c468e2042477cd46e76aee600f2e44dea9f983771be79da189c00fcee612857e576ae56d2906f5b4d949070b980aaf42b06ab257de21a65286d5b0
|
|
7
|
+
data.tar.gz: ed30cd62b7dd6b6f6433ccd155b5b4407a15acb9d4e6e4307dbe63282b03d0534fff92dc590bb68d900aedcba32a77ea62aada0f02f36504521944a42a2a5ba5
|
data/lib/cloud/CloudClient.rb
CHANGED
data/lib/models/vmrole.rb
CHANGED
|
@@ -182,6 +182,70 @@ module OpenNebula
|
|
|
182
182
|
[false, error_msgs.join('\n')]
|
|
183
183
|
end
|
|
184
184
|
|
|
185
|
+
# Delete the given scheduled action from the VM in this role that owns it.
|
|
186
|
+
#
|
|
187
|
+
# Missing scheduled actions are ignored to keep the operation
|
|
188
|
+
# idempotent. Missing VM records are also ignored because there is no
|
|
189
|
+
# scheduled action left to delete from them.
|
|
190
|
+
#
|
|
191
|
+
# @param [Integer] sched_id SCHED_ACTION ID
|
|
192
|
+
#
|
|
193
|
+
# @return [Array<true, String>, Array<false, String>] true if the action
|
|
194
|
+
# was deleted or already missing, false and the error reasons if the
|
|
195
|
+
# target VM could not be checked or the deletion failed
|
|
196
|
+
def delete_sched_action(sched_id)
|
|
197
|
+
sched_id = sched_id.to_i
|
|
198
|
+
|
|
199
|
+
nodes.each do |node|
|
|
200
|
+
vm_id = node['deploy_id']
|
|
201
|
+
|
|
202
|
+
if vm_id.nil?
|
|
203
|
+
Log.debug LOG_COMP,
|
|
204
|
+
"Role #{name} : skipping node without VM",
|
|
205
|
+
@service.id
|
|
206
|
+
next
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
vm = OpenNebula::VirtualMachine.new_with_id(vm_id,
|
|
210
|
+
@service.client)
|
|
211
|
+
rc = vm.info
|
|
212
|
+
if OpenNebula.is_error?(rc)
|
|
213
|
+
Log.warn LOG_COMP,
|
|
214
|
+
"Role #{name} : VM #{vm_id} error getting " \
|
|
215
|
+
"information; #{rc.message}",
|
|
216
|
+
@service.id
|
|
217
|
+
next
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
has_sched_action = vm.has_elements?(
|
|
221
|
+
"TEMPLATE/SCHED_ACTION[ID=#{sched_id}]"
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
next unless has_sched_action
|
|
225
|
+
|
|
226
|
+
rc = vm.sched_action_delete(sched_id)
|
|
227
|
+
|
|
228
|
+
if OpenNebula.is_error?(rc)
|
|
229
|
+
msg = "Role #{name} : VM #{vm_id} error deleting sched " \
|
|
230
|
+
"action #{sched_id}; #{rc.message}"
|
|
231
|
+
|
|
232
|
+
Log.error LOG_COMP, msg, @service.id
|
|
233
|
+
@service.log_error(msg)
|
|
234
|
+
|
|
235
|
+
return [false, msg]
|
|
236
|
+
else
|
|
237
|
+
msg = "Role #{name} : sched action #{sched_id} " \
|
|
238
|
+
"deleted from VM #{vm_id}"
|
|
239
|
+
|
|
240
|
+
Log.debug LOG_COMP, msg, @service.id
|
|
241
|
+
|
|
242
|
+
return [true, msg]
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
[true, "Sched action:#{sched_id} not found on Role:#{name}"]
|
|
247
|
+
end
|
|
248
|
+
|
|
185
249
|
########################################################################
|
|
186
250
|
# Scalability
|
|
187
251
|
########################################################################
|
data/lib/models/vrrole.rb
CHANGED
|
@@ -67,6 +67,15 @@ module OpenNebula
|
|
|
67
67
|
)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
|
+
def delete_sched_action(sched_id)
|
|
71
|
+
log_msg = "Sched action:#{sched_id} delete skipped on Virtual " \
|
|
72
|
+
"Router Role:#{name}"
|
|
73
|
+
|
|
74
|
+
Log.debug LOG_COMP, log_msg, @service.id
|
|
75
|
+
|
|
76
|
+
[true, log_msg]
|
|
77
|
+
end
|
|
78
|
+
|
|
70
79
|
########################################################################
|
|
71
80
|
# Scalability
|
|
72
81
|
########################################################################
|
data/lib/opennebula/error.rb
CHANGED
data/lib/opennebula/group.rb
CHANGED
|
@@ -29,6 +29,7 @@ module OpenNebula
|
|
|
29
29
|
:update => "group.update",
|
|
30
30
|
:delete => "group.delete",
|
|
31
31
|
:quota => "group.quota",
|
|
32
|
+
:vlan => "group.vlan",
|
|
32
33
|
:add_admin => "group.addadmin",
|
|
33
34
|
:del_admin => "group.deladmin",
|
|
34
35
|
}
|
|
@@ -248,6 +249,20 @@ module OpenNebula
|
|
|
248
249
|
return rc
|
|
249
250
|
end
|
|
250
251
|
|
|
252
|
+
# Sets the group VLAN rules
|
|
253
|
+
# @param vlan [String] a template (XML or txt) with the new VLAN rules
|
|
254
|
+
#
|
|
255
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
|
256
|
+
# otherwise
|
|
257
|
+
def set_vlan_rules(vlan)
|
|
258
|
+
return Error.new('ID not defined') if !@pe_id
|
|
259
|
+
|
|
260
|
+
rc = @client.call(GROUP_METHODS[:vlan],@pe_id, vlan)
|
|
261
|
+
rc = nil if !OpenNebula.is_error?(rc)
|
|
262
|
+
|
|
263
|
+
return rc
|
|
264
|
+
end
|
|
265
|
+
|
|
251
266
|
# Adds a User to the Group administrators set
|
|
252
267
|
# @param user_id [Integer] User ID
|
|
253
268
|
#
|
|
@@ -7,7 +7,7 @@ require 'google/protobuf'
|
|
|
7
7
|
require 'shared_pb'
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
descriptor_data = "\n\x0bgroup.proto\x12\tone.group\x1a\x0cshared.proto\"4\n\x0f\x41llocateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\r\n\x05gname\x18\x02 \x01(\t\"0\n\rDeleteRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"?\n\x0bInfoRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64\x65\x63rypt\x18\x03 \x01(\x08\"R\n\rUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\x12\x0e\n\x06\x61ppend\x18\x04 \x01(\x05\"C\n\x0f\x41\x64\x64\x41\x64minRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07user_id\x18\x03 \x01(\x05\"C\n\x0f\x44\x65lAdminRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07user_id\x18\x03 \x01(\x05\">\n\x0cQuotaRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\r\n\x05quota\x18\x03 \x01(\t\">\n\x19\x44\x65\x66\x61ultQuotaUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\r\n\x05quota\x18\x02 \x01(\t\"%\n\x0fPoolInfoRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t2\
|
|
10
|
+
descriptor_data = "\n\x0bgroup.proto\x12\tone.group\x1a\x0cshared.proto\"4\n\x0f\x41llocateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\r\n\x05gname\x18\x02 \x01(\t\"0\n\rDeleteRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"?\n\x0bInfoRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64\x65\x63rypt\x18\x03 \x01(\x08\"R\n\rUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\x12\x0e\n\x06\x61ppend\x18\x04 \x01(\x05\"C\n\x0f\x41\x64\x64\x41\x64minRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07user_id\x18\x03 \x01(\x05\"C\n\x0f\x44\x65lAdminRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07user_id\x18\x03 \x01(\x05\">\n\x0cQuotaRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\r\n\x05quota\x18\x03 \x01(\t\"<\n\x0bVlanRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0c\n\x04vlan\x18\x03 \x01(\t\">\n\x19\x44\x65\x66\x61ultQuotaUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\r\n\x05quota\x18\x02 \x01(\t\"%\n\x0fPoolInfoRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t2\x83\x05\n\x0cGroupService\x12\x37\n\x08\x41llocate\x12\x1a.one.group.AllocateRequest\x1a\x0f.one.ResponseID\x12\x33\n\x06\x44\x65lete\x12\x18.one.group.DeleteRequest\x1a\x0f.one.ResponseID\x12\x30\n\x04Info\x12\x16.one.group.InfoRequest\x1a\x10.one.ResponseXML\x12\x33\n\x06Update\x12\x18.one.group.UpdateRequest\x1a\x0f.one.ResponseID\x12\x31\n\x05Quota\x12\x17.one.group.QuotaRequest\x1a\x0f.one.ResponseID\x12/\n\x04Vlan\x12\x16.one.group.VlanRequest\x1a\x0f.one.ResponseID\x12\x37\n\x08\x41\x64\x64\x41\x64min\x12\x1a.one.group.AddAdminRequest\x1a\x0f.one.ResponseID\x12\x37\n\x08\x44\x65lAdmin\x12\x1a.one.group.DelAdminRequest\x1a\x0f.one.ResponseID\x12@\n\x10\x44\x65\x66\x61ultQuotaInfo\x12\x1a.one.group.PoolInfoRequest\x1a\x10.one.ResponseXML\x12L\n\x12\x44\x65\x66\x61ultQuotaUpdate\x12$.one.group.DefaultQuotaUpdateRequest\x1a\x10.one.ResponseXML\x12\x38\n\x08PoolInfo\x12\x1a.one.group.PoolInfoRequest\x1a\x10.one.ResponseXMLB9Z7github.com/OpenNebula/one/src/oca/go/src/goca/api/groupb\x06proto3"
|
|
11
11
|
|
|
12
12
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -21,6 +21,7 @@ module One
|
|
|
21
21
|
AddAdminRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.group.AddAdminRequest").msgclass
|
|
22
22
|
DelAdminRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.group.DelAdminRequest").msgclass
|
|
23
23
|
QuotaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.group.QuotaRequest").msgclass
|
|
24
|
+
VlanRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.group.VlanRequest").msgclass
|
|
24
25
|
DefaultQuotaUpdateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.group.DefaultQuotaUpdateRequest").msgclass
|
|
25
26
|
PoolInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.group.PoolInfoRequest").msgclass
|
|
26
27
|
end
|
|
@@ -50,6 +50,7 @@ module One
|
|
|
50
50
|
rpc :Info, ::One::Group::InfoRequest, ::One::ResponseXML
|
|
51
51
|
rpc :Update, ::One::Group::UpdateRequest, ::One::ResponseID
|
|
52
52
|
rpc :Quota, ::One::Group::QuotaRequest, ::One::ResponseID
|
|
53
|
+
rpc :Vlan, ::One::Group::VlanRequest, ::One::ResponseID
|
|
53
54
|
rpc :AddAdmin, ::One::Group::AddAdminRequest, ::One::ResponseID
|
|
54
55
|
rpc :DelAdmin, ::One::Group::DelAdminRequest, ::One::ResponseID
|
|
55
56
|
rpc :DefaultQuotaInfo, ::One::Group::PoolInfoRequest, ::One::ResponseXML
|
|
@@ -7,7 +7,7 @@ require 'google/protobuf'
|
|
|
7
7
|
require 'shared_pb'
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
descriptor_data = "\n\x08vm.proto\x12\x06one.vm\x1a\x0cshared.proto\"E\n\x0f\x41llocateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x10\n\x08template\x18\x02 \x01(\t\x12\x0c\n\x04hold\x18\x03 \x01(\x08\"?\n\x0bInfoRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64\x65\x63rypt\x18\x03 \x01(\x08\"R\n\rUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\x12\x0e\n\x06\x61ppend\x18\x04 \x01(\x05\">\n\rRenameRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0c\n\x04name\x18\x03 \x01(\t\"\xe6\x01\n\x0c\x43hmodRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08user_use\x18\x03 \x01(\x11\x12\x13\n\x0buser_manage\x18\x04 \x01(\x11\x12\x12\n\nuser_admin\x18\x05 \x01(\x11\x12\x11\n\tgroup_use\x18\x06 \x01(\x11\x12\x14\n\x0cgroup_manage\x18\x07 \x01(\x11\x12\x13\n\x0bgroup_admin\x18\x08 \x01(\x11\x12\x11\n\tother_use\x18\t \x01(\x11\x12\x14\n\x0cother_manage\x18\n \x01(\x11\x12\x13\n\x0bother_admin\x18\x0b \x01(\x11\"R\n\x0c\x43hownRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07user_id\x18\x03 \x01(\x11\x12\x10\n\x08group_id\x18\x04 \x01(\x11\"K\n\x0bLockRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\r\n\x05level\x18\x03 \x01(\x05\x12\x0c\n\x04test\x18\x04 \x01(\x08\"0\n\rUnlockRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"y\n\rDeployRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0b\n\x03hid\x18\x03 \x01(\x05\x12\x15\n\rno_overcommit\x18\x04 \x01(\x08\x12\r\n\x05\x64s_id\x18\x05 \x01(\x11\x12\x14\n\x0cnic_template\x18\x06 \x01(\t\"E\n\rActionRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x61\x63tion_name\x18\x02 \x01(\t\x12\x0b\n\x03oid\x18\x03 \x01(\x05\"\x8a\x01\n\x0eMigrateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0b\n\x03hid\x18\x03 \x01(\x05\x12\x0c\n\x04live\x18\x04 \x01(\x08\x12\x15\n\rno_overcommit\x18\x05 \x01(\x08\x12\r\n\x05\x64s_id\x18\x06 \x01(\x11\x12\x16\n\x0emigration_type\x18\x07 \x01(\x05\"x\n\x11\x44iskSaveAsRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x12\n\nimage_type\x18\x05 \x01(\t\x12\x0f\n\x07snap_id\x18\x06 \x01(\x11\"[\n\x19\x44iskSnapshotCreateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0c\n\x04name\x18\x04 \x01(\t\"^\n\x19\x44iskSnapshotDeleteRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0f\n\x07snap_id\x18\x04 \x01(\x05\"^\n\x19\x44iskSnapshotRevertRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0f\n\x07snap_id\x18\x04 \x01(\x05\"l\n\x19\x44iskSnapshotRenameRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0f\n\x07snap_id\x18\x04 \x01(\x05\x12\x0c\n\x04name\x18\x05 \x01(\t\"F\n\x11\x44iskAttachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\"E\n\x11\x44iskDetachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\"S\n\x11\x44iskResizeRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0c\n\x04size\x18\x04 \x01(\t\"E\n\x10NicAttachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\"C\n\x10NicDetachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06nic_id\x18\x03 \x01(\x05\"e\n\x10NicUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06nic_id\x18\x03 \x01(\x05\x12\x10\n\x08template\x18\x04 \x01(\t\x12\x0e\n\x06\x61ppend\x18\x05 \x01(\x05\"Q\n\x0fSGAttachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06nic_id\x18\x03 \x01(\x05\x12\r\n\x05sg_id\x18\x04 \x01(\x05\"Q\n\x0fSGDetachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06nic_id\x18\x03 \x01(\x05\x12\r\n\x05sg_id\x18\x04 \x01(\x05\"F\n\x15SnapshotCreateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0c\n\x04name\x18\x03 \x01(\t\"I\n\x15SnapshotDeleteRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07snap_id\x18\x03 \x01(\x05\"I\n\x15SnapshotRevertRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07snap_id\x18\x03 \x01(\x05\"Y\n\rResizeRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\x12\x15\n\rno_overcommit\x18\x04 \x01(\x08\"V\n\x11UpdateConfRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\x12\x0e\n\x06\x61ppend\x18\x04 \x01(\x05\"D\n\x0eRecoverRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x11\n\toperation\x18\x03 \x01(\x05\"4\n\x11MonitoringRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"D\n\x0fSchedAddRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\"Y\n\x12SchedUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08sched_id\x18\x03 \x01(\x05\x12\x10\n\x08template\x18\x04 \x01(\t\"G\n\x12SchedDeleteRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08sched_id\x18\x03 \x01(\x05\"N\n\rBackupRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\r\n\x05\x64s_id\x18\x03 \x01(\x05\x12\r\n\x05reset\x18\x04 \x01(\x08\"6\n\x13\x42\x61\x63kupCancelRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"j\n\x0eRestoreRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08image_id\x18\x03 \x01(\x05\x12\x14\n\x0cincrement_id\x18\x04 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x05 \x01(\x05\"E\n\x10PciAttachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\"C\n\x10PciDetachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06pci_id\x18\x03 \x01(\x05\"N\n\x0b\x45xecRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0b\n\x03\x63md\x18\x03 \x01(\t\x12\x11\n\tcmd_stdin\x18\x04 \x01(\t\"3\n\x10\x45xecRetryRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"4\n\x11\x45xecCancelRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"u\n\x0fPoolInfoRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66ilter_flag\x18\x02 \x01(\x11\x12\r\n\x05start\x18\x03 \x01(\x11\x12\x0b\n\x03\x65nd\x18\x04 \x01(\x11\x12\r\n\x05state\x18\x05 \x01(\x11\x12\x0e\n\x06\x66ilter\x18\x06 \x01(\t\"G\n\x12PoolInfoSetRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x01(\t\x12\x10\n\x08\x65xtended\x18\x03 \x01(\x08\"Q\n\x15PoolMonitoringRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66ilter_flag\x18\x02 \x01(\x11\x12\x0f\n\x07seconds\x18\x03 \x01(\x11\"f\n\x15PoolAccountingRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66ilter_flag\x18\x02 \x01(\x11\x12\x12\n\nstart_time\x18\x03 \x01(\x03\x12\x10\n\x08\x65nd_time\x18\x04 \x01(\x03\"\x8c\x01\n\x13PoolShowbackRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66ilter_flag\x18\x02 \x01(\x11\x12\x13\n\x0bstart_month\x18\x03 \x01(\x05\x12\x12\n\nstart_year\x18\x04 \x01(\x05\x12\x11\n\tend_month\x18\x05 \x01(\x05\x12\x10\n\x08\x65nd_year\x18\x06 \x01(\x05\"\x80\x01\n\x1cPoolCalculateShowbackRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0bstart_month\x18\x02 \x01(\x05\x12\x12\n\nstart_year\x18\x03 \x01(\x05\x12\x11\n\tend_month\x18\x04 \x01(\x05\x12\x10\n\x08\x65nd_year\x18\x05 \x01(\x05\x32\xa8\x16\n\x15VirtualMachineService\x12\x34\n\x08\x41llocate\x12\x17.one.vm.AllocateRequest\x1a\x0f.one.ResponseID\x12-\n\x04Info\x12\x13.one.vm.InfoRequest\x1a\x10.one.ResponseXML\x12\x30\n\x06Update\x12\x15.one.vm.UpdateRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06Rename\x12\x15.one.vm.RenameRequest\x1a\x0f.one.ResponseID\x12.\n\x05\x43hmod\x12\x14.one.vm.ChmodRequest\x1a\x0f.one.ResponseID\x12.\n\x05\x43hown\x12\x14.one.vm.ChownRequest\x1a\x0f.one.ResponseID\x12,\n\x04Lock\x12\x13.one.vm.LockRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06Unlock\x12\x15.one.vm.UnlockRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06\x44\x65ploy\x12\x15.one.vm.DeployRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06\x41\x63tion\x12\x15.one.vm.ActionRequest\x1a\x0f.one.ResponseID\x12\x32\n\x07Migrate\x12\x16.one.vm.MigrateRequest\x1a\x0f.one.ResponseID\x12\x38\n\nDiskSaveAs\x12\x19.one.vm.DiskSaveAsRequest\x1a\x0f.one.ResponseID\x12H\n\x12\x44iskSnapshotCreate\x12!.one.vm.DiskSnapshotCreateRequest\x1a\x0f.one.ResponseID\x12H\n\x12\x44iskSnapshotDelete\x12!.one.vm.DiskSnapshotDeleteRequest\x1a\x0f.one.ResponseID\x12H\n\x12\x44iskSnapshotRevert\x12!.one.vm.DiskSnapshotRevertRequest\x1a\x0f.one.ResponseID\x12H\n\x12\x44iskSnapshotRename\x12!.one.vm.DiskSnapshotRenameRequest\x1a\x0f.one.ResponseID\x12\x38\n\nDiskAttach\x12\x19.one.vm.DiskAttachRequest\x1a\x0f.one.ResponseID\x12\x38\n\nDiskDetach\x12\x19.one.vm.DiskDetachRequest\x1a\x0f.one.ResponseID\x12\x38\n\nDiskResize\x12\x19.one.vm.DiskResizeRequest\x1a\x0f.one.ResponseID\x12\x36\n\tNicAttach\x12\x18.one.vm.NicAttachRequest\x1a\x0f.one.ResponseID\x12\x36\n\tNicDetach\x12\x18.one.vm.NicDetachRequest\x1a\x0f.one.ResponseID\x12\x36\n\tNicUpdate\x12\x18.one.vm.NicUpdateRequest\x1a\x0f.one.ResponseID\x12\x34\n\x08SGAttach\x12\x17.one.vm.SGAttachRequest\x1a\x0f.one.ResponseID\x12\x34\n\x08SGDetach\x12\x17.one.vm.SGDetachRequest\x1a\x0f.one.ResponseID\x12@\n\x0eSnapshotCreate\x12\x1d.one.vm.SnapshotCreateRequest\x1a\x0f.one.ResponseID\x12@\n\x0eSnapshotDelete\x12\x1d.one.vm.SnapshotDeleteRequest\x1a\x0f.one.ResponseID\x12@\n\x0eSnapshotRevert\x12\x1d.one.vm.SnapshotRevertRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06Resize\x12\x15.one.vm.ResizeRequest\x1a\x0f.one.ResponseID\x12\x38\n\nUpdateConf\x12\x19.one.vm.UpdateConfRequest\x1a\x0f.one.ResponseID\x12\x32\n\x07Recover\x12\x16.one.vm.RecoverRequest\x1a\x0f.one.ResponseID\x12\x39\n\nMonitoring\x12\x19.one.vm.MonitoringRequest\x1a\x10.one.ResponseXML\x12\x34\n\x08SchedAdd\x12\x17.one.vm.SchedAddRequest\x1a\x0f.one.ResponseID\x12:\n\x0bSchedUpdate\x12\x1a.one.vm.SchedUpdateRequest\x1a\x0f.one.ResponseID\x12:\n\x0bSchedDelete\x12\x1a.one.vm.SchedDeleteRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06\x42\x61\x63kup\x12\x15.one.vm.BackupRequest\x1a\x0f.one.ResponseID\x12<\n\x0c\x42\x61\x63kupCancel\x12\x1b.one.vm.BackupCancelRequest\x1a\x0f.one.ResponseID\x12\x32\n\x07Restore\x12\x16.one.vm.RestoreRequest\x1a\x0f.one.ResponseID\x12\x36\n\tPciAttach\x12\x18.one.vm.PciAttachRequest\x1a\x0f.one.ResponseID\x12\x36\n\tPciDetach\x12\x18.one.vm.PciDetachRequest\x1a\x0f.one.ResponseID\x12,\n\x04\x45xec\x12\x13.one.vm.ExecRequest\x1a\x0f.one.ResponseID\x12\x36\n\tExecRetry\x12\x18.one.vm.ExecRetryRequest\x1a\x0f.one.ResponseID\x12\x38\n\nExecCancel\x12\x19.one.vm.ExecCancelRequest\x1a\x0f.one.ResponseID\x12\x35\n\x08PoolInfo\x12\x17.one.vm.PoolInfoRequest\x1a\x10.one.ResponseXML\x12=\n\x10PoolInfoExtended\x12\x17.one.vm.PoolInfoRequest\x1a\x10.one.ResponseXML\x12;\n\x0bPoolInfoSet\x12\x1a.one.vm.PoolInfoSetRequest\x1a\x10.one.ResponseXML\x12\x41\n\x0ePoolMonitoring\x12\x1d.one.vm.PoolMonitoringRequest\x1a\x10.one.ResponseXML\x12\x41\n\x0ePoolAccounting\x12\x1d.one.vm.PoolAccountingRequest\x1a\x10.one.ResponseXML\x12=\n\x0cPoolShowback\x12\x1b.one.vm.PoolShowbackRequest\x1a\x10.one.ResponseXML\x12O\n\x15PoolCalculateShowback\x12$.one.vm.PoolCalculateShowbackRequest\x1a\x10.one.ResponseXMLB6Z4github.com/OpenNebula/one/src/oca/go/src/goca/api/vmb\x06proto3"
|
|
10
|
+
descriptor_data = "\n\x08vm.proto\x12\x06one.vm\x1a\x0cshared.proto\"E\n\x0f\x41llocateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x10\n\x08template\x18\x02 \x01(\t\x12\x0c\n\x04hold\x18\x03 \x01(\x08\"?\n\x0bInfoRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64\x65\x63rypt\x18\x03 \x01(\x08\"R\n\rUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\x12\x0e\n\x06\x61ppend\x18\x04 \x01(\x05\">\n\rRenameRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0c\n\x04name\x18\x03 \x01(\t\"\xe6\x01\n\x0c\x43hmodRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08user_use\x18\x03 \x01(\x11\x12\x13\n\x0buser_manage\x18\x04 \x01(\x11\x12\x12\n\nuser_admin\x18\x05 \x01(\x11\x12\x11\n\tgroup_use\x18\x06 \x01(\x11\x12\x14\n\x0cgroup_manage\x18\x07 \x01(\x11\x12\x13\n\x0bgroup_admin\x18\x08 \x01(\x11\x12\x11\n\tother_use\x18\t \x01(\x11\x12\x14\n\x0cother_manage\x18\n \x01(\x11\x12\x13\n\x0bother_admin\x18\x0b \x01(\x11\"R\n\x0c\x43hownRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07user_id\x18\x03 \x01(\x11\x12\x10\n\x08group_id\x18\x04 \x01(\x11\"K\n\x0bLockRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\r\n\x05level\x18\x03 \x01(\x05\x12\x0c\n\x04test\x18\x04 \x01(\x08\"0\n\rUnlockRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"y\n\rDeployRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0b\n\x03hid\x18\x03 \x01(\x05\x12\x15\n\rno_overcommit\x18\x04 \x01(\x08\x12\r\n\x05\x64s_id\x18\x05 \x01(\x11\x12\x14\n\x0cnic_template\x18\x06 \x01(\t\"E\n\rActionRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x61\x63tion_name\x18\x02 \x01(\t\x12\x0b\n\x03oid\x18\x03 \x01(\x05\"\x8a\x01\n\x0eMigrateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0b\n\x03hid\x18\x03 \x01(\x05\x12\x0c\n\x04live\x18\x04 \x01(\x08\x12\x15\n\rno_overcommit\x18\x05 \x01(\x08\x12\r\n\x05\x64s_id\x18\x06 \x01(\x11\x12\x16\n\x0emigration_type\x18\x07 \x01(\x05\"x\n\x11\x44iskSaveAsRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x12\n\nimage_type\x18\x05 \x01(\t\x12\x0f\n\x07snap_id\x18\x06 \x01(\x11\"[\n\x19\x44iskSnapshotCreateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0c\n\x04name\x18\x04 \x01(\t\"^\n\x19\x44iskSnapshotDeleteRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0f\n\x07snap_id\x18\x04 \x01(\x05\"^\n\x19\x44iskSnapshotRevertRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0f\n\x07snap_id\x18\x04 \x01(\x05\"l\n\x19\x44iskSnapshotRenameRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0f\n\x07snap_id\x18\x04 \x01(\x05\x12\x0c\n\x04name\x18\x05 \x01(\t\"F\n\x11\x44iskAttachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\"E\n\x11\x44iskDetachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\"S\n\x11\x44iskResizeRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x03 \x01(\x05\x12\x0c\n\x04size\x18\x04 \x01(\t\"E\n\x10NicAttachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\"C\n\x10NicDetachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06nic_id\x18\x03 \x01(\x05\"e\n\x10NicUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06nic_id\x18\x03 \x01(\x05\x12\x10\n\x08template\x18\x04 \x01(\t\x12\x0e\n\x06\x61ppend\x18\x05 \x01(\x05\"Q\n\x0fSGAttachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06nic_id\x18\x03 \x01(\x05\x12\r\n\x05sg_id\x18\x04 \x01(\x05\"Q\n\x0fSGDetachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06nic_id\x18\x03 \x01(\x05\x12\r\n\x05sg_id\x18\x04 \x01(\x05\"F\n\x15SnapshotCreateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0c\n\x04name\x18\x03 \x01(\t\"I\n\x15SnapshotDeleteRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07snap_id\x18\x03 \x01(\x05\"I\n\x15SnapshotRevertRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0f\n\x07snap_id\x18\x03 \x01(\x05\"Y\n\rResizeRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\x12\x15\n\rno_overcommit\x18\x04 \x01(\x08\"V\n\x11UpdateConfRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\x12\x0e\n\x06\x61ppend\x18\x04 \x01(\x05\"D\n\x0eRecoverRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x11\n\toperation\x18\x03 \x01(\x05\"4\n\x11MonitoringRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"D\n\x0fSchedAddRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\"Y\n\x12SchedUpdateRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08sched_id\x18\x03 \x01(\x05\x12\x10\n\x08template\x18\x04 \x01(\t\"G\n\x12SchedDeleteRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08sched_id\x18\x03 \x01(\x05\"N\n\rBackupRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\r\n\x05\x64s_id\x18\x03 \x01(\x05\x12\r\n\x05reset\x18\x04 \x01(\x08\"6\n\x13\x42\x61\x63kupCancelRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"j\n\x0eRestoreRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08image_id\x18\x03 \x01(\x05\x12\x14\n\x0cincrement_id\x18\x04 \x01(\x05\x12\x0f\n\x07\x64isk_id\x18\x05 \x01(\x05\"E\n\x10PciAttachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x10\n\x08template\x18\x03 \x01(\t\"C\n\x10PciDetachRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06pci_id\x18\x03 \x01(\x05\"N\n\x0b\x45xecRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0b\n\x03\x63md\x18\x03 \x01(\t\x12\x11\n\tcmd_stdin\x18\x04 \x01(\t\"3\n\x10\x45xecRetryRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"4\n\x11\x45xecCancelRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"R\n\x11VMGroupAddRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\x12\x0e\n\x06vmg_id\x18\x03 \x01(\x05\x12\x0c\n\x04role\x18\x04 \x01(\t\"4\n\x11VMGroupDelRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03oid\x18\x02 \x01(\x05\"u\n\x0fPoolInfoRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66ilter_flag\x18\x02 \x01(\x11\x12\r\n\x05start\x18\x03 \x01(\x11\x12\x0b\n\x03\x65nd\x18\x04 \x01(\x11\x12\r\n\x05state\x18\x05 \x01(\x11\x12\x0e\n\x06\x66ilter\x18\x06 \x01(\t\"G\n\x12PoolInfoSetRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x01(\t\x12\x10\n\x08\x65xtended\x18\x03 \x01(\x08\"Q\n\x15PoolMonitoringRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66ilter_flag\x18\x02 \x01(\x11\x12\x0f\n\x07seconds\x18\x03 \x01(\x11\"f\n\x15PoolAccountingRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66ilter_flag\x18\x02 \x01(\x11\x12\x12\n\nstart_time\x18\x03 \x01(\x03\x12\x10\n\x08\x65nd_time\x18\x04 \x01(\x03\"\x8c\x01\n\x13PoolShowbackRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0b\x66ilter_flag\x18\x02 \x01(\x11\x12\x13\n\x0bstart_month\x18\x03 \x01(\x05\x12\x12\n\nstart_year\x18\x04 \x01(\x05\x12\x11\n\tend_month\x18\x05 \x01(\x05\x12\x10\n\x08\x65nd_year\x18\x06 \x01(\x05\"\x80\x01\n\x1cPoolCalculateShowbackRequest\x12\x12\n\nsession_id\x18\x01 \x01(\t\x12\x13\n\x0bstart_month\x18\x02 \x01(\x05\x12\x12\n\nstart_year\x18\x03 \x01(\x05\x12\x11\n\tend_month\x18\x04 \x01(\x05\x12\x10\n\x08\x65nd_year\x18\x05 \x01(\x05\x32\x9c\x17\n\x15VirtualMachineService\x12\x34\n\x08\x41llocate\x12\x17.one.vm.AllocateRequest\x1a\x0f.one.ResponseID\x12-\n\x04Info\x12\x13.one.vm.InfoRequest\x1a\x10.one.ResponseXML\x12\x30\n\x06Update\x12\x15.one.vm.UpdateRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06Rename\x12\x15.one.vm.RenameRequest\x1a\x0f.one.ResponseID\x12.\n\x05\x43hmod\x12\x14.one.vm.ChmodRequest\x1a\x0f.one.ResponseID\x12.\n\x05\x43hown\x12\x14.one.vm.ChownRequest\x1a\x0f.one.ResponseID\x12,\n\x04Lock\x12\x13.one.vm.LockRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06Unlock\x12\x15.one.vm.UnlockRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06\x44\x65ploy\x12\x15.one.vm.DeployRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06\x41\x63tion\x12\x15.one.vm.ActionRequest\x1a\x0f.one.ResponseID\x12\x32\n\x07Migrate\x12\x16.one.vm.MigrateRequest\x1a\x0f.one.ResponseID\x12\x38\n\nDiskSaveAs\x12\x19.one.vm.DiskSaveAsRequest\x1a\x0f.one.ResponseID\x12H\n\x12\x44iskSnapshotCreate\x12!.one.vm.DiskSnapshotCreateRequest\x1a\x0f.one.ResponseID\x12H\n\x12\x44iskSnapshotDelete\x12!.one.vm.DiskSnapshotDeleteRequest\x1a\x0f.one.ResponseID\x12H\n\x12\x44iskSnapshotRevert\x12!.one.vm.DiskSnapshotRevertRequest\x1a\x0f.one.ResponseID\x12H\n\x12\x44iskSnapshotRename\x12!.one.vm.DiskSnapshotRenameRequest\x1a\x0f.one.ResponseID\x12\x38\n\nDiskAttach\x12\x19.one.vm.DiskAttachRequest\x1a\x0f.one.ResponseID\x12\x38\n\nDiskDetach\x12\x19.one.vm.DiskDetachRequest\x1a\x0f.one.ResponseID\x12\x38\n\nDiskResize\x12\x19.one.vm.DiskResizeRequest\x1a\x0f.one.ResponseID\x12\x36\n\tNicAttach\x12\x18.one.vm.NicAttachRequest\x1a\x0f.one.ResponseID\x12\x36\n\tNicDetach\x12\x18.one.vm.NicDetachRequest\x1a\x0f.one.ResponseID\x12\x36\n\tNicUpdate\x12\x18.one.vm.NicUpdateRequest\x1a\x0f.one.ResponseID\x12\x34\n\x08SGAttach\x12\x17.one.vm.SGAttachRequest\x1a\x0f.one.ResponseID\x12\x34\n\x08SGDetach\x12\x17.one.vm.SGDetachRequest\x1a\x0f.one.ResponseID\x12@\n\x0eSnapshotCreate\x12\x1d.one.vm.SnapshotCreateRequest\x1a\x0f.one.ResponseID\x12@\n\x0eSnapshotDelete\x12\x1d.one.vm.SnapshotDeleteRequest\x1a\x0f.one.ResponseID\x12@\n\x0eSnapshotRevert\x12\x1d.one.vm.SnapshotRevertRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06Resize\x12\x15.one.vm.ResizeRequest\x1a\x0f.one.ResponseID\x12\x38\n\nUpdateConf\x12\x19.one.vm.UpdateConfRequest\x1a\x0f.one.ResponseID\x12\x32\n\x07Recover\x12\x16.one.vm.RecoverRequest\x1a\x0f.one.ResponseID\x12\x39\n\nMonitoring\x12\x19.one.vm.MonitoringRequest\x1a\x10.one.ResponseXML\x12\x34\n\x08SchedAdd\x12\x17.one.vm.SchedAddRequest\x1a\x0f.one.ResponseID\x12:\n\x0bSchedUpdate\x12\x1a.one.vm.SchedUpdateRequest\x1a\x0f.one.ResponseID\x12:\n\x0bSchedDelete\x12\x1a.one.vm.SchedDeleteRequest\x1a\x0f.one.ResponseID\x12\x30\n\x06\x42\x61\x63kup\x12\x15.one.vm.BackupRequest\x1a\x0f.one.ResponseID\x12<\n\x0c\x42\x61\x63kupCancel\x12\x1b.one.vm.BackupCancelRequest\x1a\x0f.one.ResponseID\x12\x32\n\x07Restore\x12\x16.one.vm.RestoreRequest\x1a\x0f.one.ResponseID\x12\x36\n\tPciAttach\x12\x18.one.vm.PciAttachRequest\x1a\x0f.one.ResponseID\x12\x36\n\tPciDetach\x12\x18.one.vm.PciDetachRequest\x1a\x0f.one.ResponseID\x12,\n\x04\x45xec\x12\x13.one.vm.ExecRequest\x1a\x0f.one.ResponseID\x12\x36\n\tExecRetry\x12\x18.one.vm.ExecRetryRequest\x1a\x0f.one.ResponseID\x12\x38\n\nExecCancel\x12\x19.one.vm.ExecCancelRequest\x1a\x0f.one.ResponseID\x12\x38\n\nVMGroupAdd\x12\x19.one.vm.VMGroupAddRequest\x1a\x0f.one.ResponseID\x12\x38\n\nVMGroupDel\x12\x19.one.vm.VMGroupDelRequest\x1a\x0f.one.ResponseID\x12\x35\n\x08PoolInfo\x12\x17.one.vm.PoolInfoRequest\x1a\x10.one.ResponseXML\x12=\n\x10PoolInfoExtended\x12\x17.one.vm.PoolInfoRequest\x1a\x10.one.ResponseXML\x12;\n\x0bPoolInfoSet\x12\x1a.one.vm.PoolInfoSetRequest\x1a\x10.one.ResponseXML\x12\x41\n\x0ePoolMonitoring\x12\x1d.one.vm.PoolMonitoringRequest\x1a\x10.one.ResponseXML\x12\x41\n\x0ePoolAccounting\x12\x1d.one.vm.PoolAccountingRequest\x1a\x10.one.ResponseXML\x12=\n\x0cPoolShowback\x12\x1b.one.vm.PoolShowbackRequest\x1a\x10.one.ResponseXML\x12O\n\x15PoolCalculateShowback\x12$.one.vm.PoolCalculateShowbackRequest\x1a\x10.one.ResponseXMLB6Z4github.com/OpenNebula/one/src/oca/go/src/goca/api/vmb\x06proto3"
|
|
11
11
|
|
|
12
12
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -56,6 +56,8 @@ module One
|
|
|
56
56
|
ExecRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.vm.ExecRequest").msgclass
|
|
57
57
|
ExecRetryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.vm.ExecRetryRequest").msgclass
|
|
58
58
|
ExecCancelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.vm.ExecCancelRequest").msgclass
|
|
59
|
+
VMGroupAddRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.vm.VMGroupAddRequest").msgclass
|
|
60
|
+
VMGroupDelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.vm.VMGroupDelRequest").msgclass
|
|
59
61
|
PoolInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.vm.PoolInfoRequest").msgclass
|
|
60
62
|
PoolInfoSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.vm.PoolInfoSetRequest").msgclass
|
|
61
63
|
PoolMonitoringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("one.vm.PoolMonitoringRequest").msgclass
|
|
@@ -87,6 +87,8 @@ module One
|
|
|
87
87
|
rpc :Exec, ::One::Vm::ExecRequest, ::One::ResponseID
|
|
88
88
|
rpc :ExecRetry, ::One::Vm::ExecRetryRequest, ::One::ResponseID
|
|
89
89
|
rpc :ExecCancel, ::One::Vm::ExecCancelRequest, ::One::ResponseID
|
|
90
|
+
rpc :VMGroupAdd, ::One::Vm::VMGroupAddRequest, ::One::ResponseID
|
|
91
|
+
rpc :VMGroupDel, ::One::Vm::VMGroupDelRequest, ::One::ResponseID
|
|
90
92
|
rpc :PoolInfo, ::One::Vm::PoolInfoRequest, ::One::ResponseXML
|
|
91
93
|
rpc :PoolInfoExtended, ::One::Vm::PoolInfoRequest, ::One::ResponseXML
|
|
92
94
|
rpc :PoolInfoSet, ::One::Vm::PoolInfoSetRequest, ::One::ResponseXML
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------- #
|
|
2
|
+
# Copyright 2002-2026, 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
|
+
# rubocop:disable Style/Documentation
|
|
18
|
+
# rubocop:disable Style/ClassVars
|
|
19
|
+
# rubocop:disable Style/EnvHome
|
|
20
|
+
# rubocop:disable Naming/AccessorMethodName
|
|
21
|
+
module OpenNebula
|
|
22
|
+
|
|
23
|
+
DEFAULT_POOL_PAGE_SIZE = 200
|
|
24
|
+
size = ENV['ONE_POOL_PAGE_SIZE']
|
|
25
|
+
|
|
26
|
+
@@pool_page_size =
|
|
27
|
+
if size&.strip&.match?(/^\d+$/) && size.to_i >= 2
|
|
28
|
+
size.to_i
|
|
29
|
+
else
|
|
30
|
+
DEFAULT_POOL_PAGE_SIZE
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.pool_page_size
|
|
34
|
+
@@pool_page_size
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class Client
|
|
38
|
+
|
|
39
|
+
NO_ONE_AUTH_ERROR = 'ONE_AUTH file not present'
|
|
40
|
+
GRPC_NOT_SUPPORTED = 'gRPC API not supported'
|
|
41
|
+
|
|
42
|
+
attr_reader :client, :one_auth, :one_endpoint, :one_zmq
|
|
43
|
+
|
|
44
|
+
# Initialize an OpenNebula client
|
|
45
|
+
#
|
|
46
|
+
# @param [String, nil] secret user credentials ("user:password") or
|
|
47
|
+
# nil to get the credentials from user auth file
|
|
48
|
+
# @param [String, nil] endpoint OpenNebula server endpoint
|
|
49
|
+
# or nil to get it form the environment or use the default endpoint
|
|
50
|
+
# @param [Hash] options specific XML client options (see XMLClient
|
|
51
|
+
# and GRPCClient for details)
|
|
52
|
+
#
|
|
53
|
+
# @return [OpenNebula::XMLClient || OpenNebula::GRPCClient]
|
|
54
|
+
def initialize(secret = nil, endpoint = nil, options = {})
|
|
55
|
+
if options[:subscriber_endpoint]
|
|
56
|
+
@one_zmq = options[:subscriber_endpoint]
|
|
57
|
+
elsif ENV['ONE_ZMQ']
|
|
58
|
+
@one_zmq = ENV['ONE_ZMQ']
|
|
59
|
+
else
|
|
60
|
+
@one_zmq = 'tcp://localhost:2101'
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
auth_file = File.join(ENV['HOME'], '/.one/one_auth')
|
|
64
|
+
one_auth_file = '/var/lib/one/.one/one_auth'
|
|
65
|
+
|
|
66
|
+
@one_auth =
|
|
67
|
+
if secret
|
|
68
|
+
secret
|
|
69
|
+
elsif ENV['ONE_AUTH'] && File.file?(ENV['ONE_AUTH'])
|
|
70
|
+
File.read(ENV['ONE_AUTH'])
|
|
71
|
+
elsif File.file?(auth_file)
|
|
72
|
+
File.read(auth_file)
|
|
73
|
+
elsif File.file?(one_auth_file)
|
|
74
|
+
File.read(one_auth_file)
|
|
75
|
+
else
|
|
76
|
+
raise NO_ONE_AUTH_ERROR
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
@one_auth = @one_auth.rstrip
|
|
80
|
+
|
|
81
|
+
is_grpc = ENV['ONEAPI_PROTOCOL'] == 'grpc' || options.key?(:grpc)
|
|
82
|
+
|
|
83
|
+
# Override protocol from endpoint name, if endpoint is defined
|
|
84
|
+
is_grpc = !endpoint.include?('RPC2') if !endpoint.nil? && !endpoint.empty?
|
|
85
|
+
|
|
86
|
+
if is_grpc
|
|
87
|
+
begin
|
|
88
|
+
require_relative 'grpc_client'
|
|
89
|
+
rescue LoadError
|
|
90
|
+
raise GRPC_NOT_SUPPORTED
|
|
91
|
+
end
|
|
92
|
+
@one_endpoint = mk_endpoint(endpoint,
|
|
93
|
+
'ONE_GRPC',
|
|
94
|
+
'localhost:2634').rstrip
|
|
95
|
+
|
|
96
|
+
@client = GRPCClient.new(@one_auth, @one_endpoint, options)
|
|
97
|
+
else
|
|
98
|
+
require_relative 'xml_client'
|
|
99
|
+
@one_endpoint = mk_endpoint(endpoint,
|
|
100
|
+
'ONE_XMLRPC',
|
|
101
|
+
'http://localhost:2633/RPC2').rstrip
|
|
102
|
+
|
|
103
|
+
@client = XMLClient.new(@one_auth, @one_endpoint, options)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def call(action, *args)
|
|
108
|
+
@client.call(action, *args)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def get_version
|
|
112
|
+
call('system.version')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def mk_endpoint(endpoint, env_var, default)
|
|
116
|
+
ep_file = File.join(ENV['HOME'], '/.one/one_endpoint')
|
|
117
|
+
one_ep_file = '/var/lib/one/.one/one_endpoint'
|
|
118
|
+
|
|
119
|
+
if endpoint
|
|
120
|
+
endpoint
|
|
121
|
+
elsif ENV[env_var]
|
|
122
|
+
ENV[env_var]
|
|
123
|
+
elsif File.exist?(ep_file)
|
|
124
|
+
File.read(ep_file)
|
|
125
|
+
elsif File.exist?(one_ep_file)
|
|
126
|
+
File.read(one_ep_file)
|
|
127
|
+
else
|
|
128
|
+
default
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
end
|
|
135
|
+
# rubocop:enable Style/Documentation
|
|
136
|
+
# rubocop:enable Style/ClassVars
|
|
137
|
+
# rubocop:enable Style/EnvHome
|
|
138
|
+
# rubocop:enable Naming/AccessorMethodName
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------- #
|
|
2
|
+
# Copyright 2002-2026, 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 'grpc'
|
|
18
|
+
|
|
19
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'grpc')
|
|
20
|
+
|
|
21
|
+
require 'lib/grpc_map_loader'
|
|
22
|
+
|
|
23
|
+
# rubocop:disable Style/Documentation
|
|
24
|
+
module OpenNebula
|
|
25
|
+
|
|
26
|
+
class GRPCClient
|
|
27
|
+
|
|
28
|
+
# gRPC mappings from OpenNebula actions to gRPC actions
|
|
29
|
+
GRPC_MAP = GRPCMappings::MapLoader.load
|
|
30
|
+
|
|
31
|
+
# Creates a new gRPC client object that will be used to call OpenNebula
|
|
32
|
+
# functions.
|
|
33
|
+
#
|
|
34
|
+
# @param [String] secret user credentials ("user:password") or
|
|
35
|
+
# nil to get the credentials from user auth file
|
|
36
|
+
# @param [String] endpoint OpenNebula gRPC server endpoint
|
|
37
|
+
# (http://host:2634) or nil to get it from the environment
|
|
38
|
+
# variable ONE_GRPC or use the default endpoint
|
|
39
|
+
#
|
|
40
|
+
# @return [OpenNebula::GRPCClient]
|
|
41
|
+
def initialize(secret, endpoint, options = {})
|
|
42
|
+
@one_auth = secret
|
|
43
|
+
@one_endpoint = endpoint
|
|
44
|
+
@timeout = options[:timeout] || ENV['ONE_GRPC_TIMEOUT']&.to_i
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def call(action, *args)
|
|
48
|
+
handler = GRPC_MAP[action]
|
|
49
|
+
raise Error.new("Method 'one.#{action}' not defined", Error::EGRPC_CALL) unless handler
|
|
50
|
+
|
|
51
|
+
options = {}
|
|
52
|
+
options[:deadline] = Time.now.to_i + @timeout if @timeout
|
|
53
|
+
|
|
54
|
+
response = handler.call(@one_auth, @one_endpoint, *args, options)
|
|
55
|
+
|
|
56
|
+
if response.respond_to?(:oid)
|
|
57
|
+
response.oid
|
|
58
|
+
elsif response.respond_to?(:xml)
|
|
59
|
+
response.xml
|
|
60
|
+
else
|
|
61
|
+
Error.new("Unexpected response: #{response.inspect}", Error::EGRPC_CALL)
|
|
62
|
+
end
|
|
63
|
+
rescue GRPC::DeadlineExceeded
|
|
64
|
+
Error.new("Timeout exceeded for gRPC call '#{action}'", Error::ETIMEOUT)
|
|
65
|
+
rescue GRPC::Unavailable => e
|
|
66
|
+
Error.new("#{action}: #{clean_error_message(e.message)}", Error::EGRPC_CALL)
|
|
67
|
+
rescue GRPC::BadStatus => e
|
|
68
|
+
Error.new(clean_error_message(e.message), grpc_code_to_one(e.code))
|
|
69
|
+
rescue StandardError => e
|
|
70
|
+
Error.new("#{action}: #{e.message}", Error::EGRPC_CALL)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
private
|
|
74
|
+
|
|
75
|
+
def clean_error_message(msg)
|
|
76
|
+
cleaned = msg.sub(/\A\d+:/, '').strip
|
|
77
|
+
cleaned.sub(/debug_error_string:.*$/, '').strip
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Maps gRPC status codes to OpenNebula error codes
|
|
81
|
+
def grpc_code_to_one(grpc_code)
|
|
82
|
+
case grpc_code
|
|
83
|
+
when GRPC::Core::StatusCodes::UNAUTHENTICATED
|
|
84
|
+
Error::EAUTHENTICATION
|
|
85
|
+
when GRPC::Core::StatusCodes::PERMISSION_DENIED
|
|
86
|
+
Error::EAUTHORIZATION
|
|
87
|
+
when GRPC::Core::StatusCodes::NOT_FOUND
|
|
88
|
+
Error::ENO_EXISTS
|
|
89
|
+
when GRPC::Core::StatusCodes::INVALID_ARGUMENT
|
|
90
|
+
Error::ERPC_API
|
|
91
|
+
when GRPC::Core::StatusCodes::INTERNAL
|
|
92
|
+
Error::EINTERNAL
|
|
93
|
+
when GRPC::Core::StatusCodes::ALREADY_EXISTS
|
|
94
|
+
Error::EALLOCATE
|
|
95
|
+
when GRPC::Core::StatusCodes::UNIMPLEMENTED
|
|
96
|
+
Error::ENOTDEFINED
|
|
97
|
+
else
|
|
98
|
+
Error::EGRPC_CALL
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
end
|
|
105
|
+
# rubocop:enable Style/Documentation
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------- #
|
|
2
|
+
# Copyright 2002-2026, 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 'xmlrpc/client'
|
|
18
|
+
require 'bigdecimal'
|
|
19
|
+
require 'stringio'
|
|
20
|
+
require 'openssl'
|
|
21
|
+
require 'opennebula/xml_utils'
|
|
22
|
+
|
|
23
|
+
# rubocop:disable Style/Documentation
|
|
24
|
+
# rubocop:disable Lint/MissingSuper
|
|
25
|
+
module OpenNebula
|
|
26
|
+
|
|
27
|
+
if OpenNebula::OX
|
|
28
|
+
|
|
29
|
+
class OxStreamParser < XMLRPC::XMLParser::AbstractStreamParser
|
|
30
|
+
|
|
31
|
+
def initialize
|
|
32
|
+
@parser_class = OxParser
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class OxParser < Ox::Sax
|
|
36
|
+
|
|
37
|
+
include XMLRPC::XMLParser::StreamParserMixin
|
|
38
|
+
|
|
39
|
+
alias text character
|
|
40
|
+
alias end_element endElement
|
|
41
|
+
alias start_element startElement
|
|
42
|
+
|
|
43
|
+
def parse(str)
|
|
44
|
+
Ox.sax_parse(self,
|
|
45
|
+
StringIO.new(str),
|
|
46
|
+
:symbolize => false,
|
|
47
|
+
:convert_special => true,
|
|
48
|
+
:skip => :skip_none)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
elsif OpenNebula::NOKOGIRI
|
|
55
|
+
class NokogiriStreamParser < XMLRPC::XMLParser::AbstractStreamParser
|
|
56
|
+
|
|
57
|
+
def initialize
|
|
58
|
+
@parser_class = NokogiriParser
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
class NokogiriParser < Nokogiri::XML::SAX::Document
|
|
62
|
+
|
|
63
|
+
include XMLRPC::XMLParser::StreamParserMixin
|
|
64
|
+
|
|
65
|
+
alias cdata_block character
|
|
66
|
+
alias characters character
|
|
67
|
+
alias end_element endElement
|
|
68
|
+
alias start_element startElement
|
|
69
|
+
|
|
70
|
+
def parse(str)
|
|
71
|
+
parser = Nokogiri::XML::SAX::Parser.new(self)
|
|
72
|
+
parser.parse(str)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# The openNebula XMLRPC client class, represents the connection with the core
|
|
81
|
+
# and handles the xml-rpc calls.
|
|
82
|
+
class XMLClient
|
|
83
|
+
|
|
84
|
+
begin
|
|
85
|
+
require 'xmlparser'
|
|
86
|
+
XMLPARSER=true
|
|
87
|
+
rescue LoadError
|
|
88
|
+
XMLPARSER=false
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Creates a new XMLRPC client object that will be used to call OpenNebula
|
|
92
|
+
# functions.
|
|
93
|
+
#
|
|
94
|
+
# @param [String, nil] secret user credentials ("user:password") or
|
|
95
|
+
# nil to get the credentials from user auth file
|
|
96
|
+
# @param [String, nil] endpoint OpenNebula server endpoint
|
|
97
|
+
# (http://host:2633/RPC2) or nil to get it from the environment
|
|
98
|
+
# variable ONE_XMLRPC or use the default endpoint
|
|
99
|
+
# @param [Hash] options
|
|
100
|
+
# @option params [Integer] :timeout connection timeout in seconds,
|
|
101
|
+
# defaults to 30
|
|
102
|
+
# @option params [String] :http_proxy HTTP proxy string used for
|
|
103
|
+
# connecting to the endpoint; defaults to no proxy
|
|
104
|
+
# @option params [Boolean] :sync Use only one http connection for
|
|
105
|
+
# all calls. It should not be used for multithreaded programs.
|
|
106
|
+
# It's the only mode that can be used with :cert_dir and
|
|
107
|
+
# :disable_ssl_verify
|
|
108
|
+
# @option params [String] :cert_dir Extra directory where to import
|
|
109
|
+
# trusted issuer certificates. Use with :sync = true
|
|
110
|
+
# @option params [String] :disable_ssl_verify Disable SSL certificate
|
|
111
|
+
# verification. Use only for testing and with :sync = true
|
|
112
|
+
#
|
|
113
|
+
# @return [OpenNebula::XMLClient]
|
|
114
|
+
def initialize(secret, endpoint, options = {})
|
|
115
|
+
@one_auth = secret
|
|
116
|
+
@one_endpoint = endpoint
|
|
117
|
+
|
|
118
|
+
@async = !options[:sync]
|
|
119
|
+
|
|
120
|
+
http_proxy = options[:http_proxy]
|
|
121
|
+
timeout = options[:timeout] || ENV['ONE_XMLRPC_TIMEOUT']&.to_i
|
|
122
|
+
|
|
123
|
+
@server = XMLRPC::Client.new2(@one_endpoint, http_proxy, timeout)
|
|
124
|
+
@server.http_header_extra = { 'accept-encoding' => 'identity' }
|
|
125
|
+
|
|
126
|
+
http = @server.instance_variable_get('@http')
|
|
127
|
+
|
|
128
|
+
if options[:cert_dir] || ENV['ONE_CERT_DIR']
|
|
129
|
+
raise "SSL options don't work in async mode" if @async
|
|
130
|
+
|
|
131
|
+
cert_dir = options[:cert_dir] || ENV['ONE_CERT_DIR']
|
|
132
|
+
cert_files = Dir["#{cert_dir}/*"]
|
|
133
|
+
|
|
134
|
+
cert_store = OpenSSL::X509::Store.new
|
|
135
|
+
cert_store.set_default_paths
|
|
136
|
+
cert_files.each {|cert| cert_store.add_file(cert) }
|
|
137
|
+
|
|
138
|
+
http.cert_store = cert_store
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if options[:disable_ssl_verify] || ENV['ONE_DISABLE_SSL_VERIFY']
|
|
142
|
+
raise "SSL options don't work in async mode" if @async
|
|
143
|
+
|
|
144
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if defined?(OxStreamParser)
|
|
148
|
+
@server.set_parser(OxStreamParser.new)
|
|
149
|
+
elsif OpenNebula::NOKOGIRI
|
|
150
|
+
@server.set_parser(NokogiriStreamParser.new)
|
|
151
|
+
elsif XMLPARSER
|
|
152
|
+
@server.set_parser(XMLRPC::XMLParser::XMLStreamParser.new)
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def call(action, *args)
|
|
157
|
+
begin
|
|
158
|
+
if @async
|
|
159
|
+
response = @server.call_async("one.#{action}", @one_auth, *args)
|
|
160
|
+
else
|
|
161
|
+
response = @server.call("one.#{action}", @one_auth, *args)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if response[0] == false
|
|
165
|
+
Error.new(response[1], response[2])
|
|
166
|
+
else
|
|
167
|
+
response[1] # response[1..-1]
|
|
168
|
+
end
|
|
169
|
+
rescue StandardError => e
|
|
170
|
+
Error.new(e.message, Error::EXML_RPC_CALL)
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
end
|
|
177
|
+
# rubocop:enable Style/Documentation
|
|
178
|
+
# rubocop:enable Lint/MissingSuper
|
data/lib/opennebula/version.rb
CHANGED
|
@@ -67,7 +67,9 @@ module OpenNebula
|
|
|
67
67
|
:restore => 'vm.restore',
|
|
68
68
|
:exec => 'vm.exec',
|
|
69
69
|
:retryexec => 'vm.retryexec',
|
|
70
|
-
:cancelexec => 'vm.cancelexec'
|
|
70
|
+
:cancelexec => 'vm.cancelexec',
|
|
71
|
+
:vmgroupadd => 'vm.vmgroupadd',
|
|
72
|
+
:vmgroupdel => 'vm.vmgroupdel'
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
VM_STATE=['INIT', 'PENDING', 'HOLD', 'ACTIVE', 'STOPPED', 'SUSPENDED', 'DONE', 'FAILED',
|
|
@@ -926,6 +928,25 @@ module OpenNebula
|
|
|
926
928
|
@client.call(VM_METHODS[:cancelexec], @pe_id)
|
|
927
929
|
end
|
|
928
930
|
|
|
931
|
+
# Adds the VM to a VM group and role
|
|
932
|
+
#
|
|
933
|
+
# @param vmg_id [Integer] Id of the VM group
|
|
934
|
+
# @param role [String] Name of the role
|
|
935
|
+
#
|
|
936
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
|
937
|
+
# otherwise
|
|
938
|
+
def vmgroup_add(vmg_id, role)
|
|
939
|
+
call(VM_METHODS[:vmgroupadd], @pe_id, vmg_id, role)
|
|
940
|
+
end
|
|
941
|
+
|
|
942
|
+
# Removes the VM from its VM group
|
|
943
|
+
#
|
|
944
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
|
945
|
+
# otherwise
|
|
946
|
+
def vmgroup_del
|
|
947
|
+
call(VM_METHODS[:vmgroupdel], @pe_id)
|
|
948
|
+
end
|
|
949
|
+
|
|
929
950
|
########################################################################
|
|
930
951
|
# Helpers to get VirtualMachine information
|
|
931
952
|
########################################################################
|
|
@@ -348,7 +348,6 @@ module OpenNebula
|
|
|
348
348
|
#
|
|
349
349
|
# @return [String] the xml representing the accounting data
|
|
350
350
|
def accounting_xml(filter_flag=INFO_ALL, options={})
|
|
351
|
-
acct_hash = Hash.new
|
|
352
351
|
xml_str = "<HISTORY_RECORDS>\n"
|
|
353
352
|
|
|
354
353
|
rc = build_accounting(filter_flag, options) do |history|
|
|
@@ -139,26 +139,6 @@ module OpenNebula
|
|
|
139
139
|
return rc
|
|
140
140
|
end
|
|
141
141
|
|
|
142
|
-
# Simulates old addleases call
|
|
143
|
-
# @deprecated use {#add_ar}
|
|
144
|
-
def addleases(ip, mac=nil)
|
|
145
|
-
self.info
|
|
146
|
-
|
|
147
|
-
ar_id = self.retrieve_elements("AR_POOL/AR[IP='#{ip}' and SIZE='1']/AR_ID")
|
|
148
|
-
|
|
149
|
-
if !ar_id.nil?
|
|
150
|
-
return Error.new("IP Address Range found with IP #{ip}")
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
template = 'AR = [ '
|
|
154
|
-
template << 'TYPE = "IP4"'
|
|
155
|
-
template << ', IP = "' << ip << '"' if ip
|
|
156
|
-
template << ', MAC = "' << mac << '"' if mac
|
|
157
|
-
template << ', SIZE = 1 ]'
|
|
158
|
-
|
|
159
|
-
add_ar(template)
|
|
160
|
-
end
|
|
161
|
-
|
|
162
142
|
# Removes an Address Range from the VirtualNetwork
|
|
163
143
|
def rm_ar(ar_id, force = false)
|
|
164
144
|
return Error.new('ID not defined') if !@pe_id
|
|
@@ -169,22 +149,6 @@ module OpenNebula
|
|
|
169
149
|
return rc
|
|
170
150
|
end
|
|
171
151
|
|
|
172
|
-
# Simulates old rmleases call
|
|
173
|
-
# @deprecated use #{rm_ar}
|
|
174
|
-
def rmleases(ip)
|
|
175
|
-
self.info
|
|
176
|
-
|
|
177
|
-
ar_id = self.retrieve_elements("AR_POOL/AR[IP='#{ip}' and SIZE='1']/AR_ID")
|
|
178
|
-
|
|
179
|
-
if !ar_id
|
|
180
|
-
Error.new("No single IP Address Range found with IP #{ip}")
|
|
181
|
-
elsif ar_id.size > 1
|
|
182
|
-
Error.new("More than one Address Range found with IP #{ip} use rmar")
|
|
183
|
-
else
|
|
184
|
-
rm_ar(ar_id[0])
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
152
|
# Updates Address Ranges from the VirtualNetwork
|
|
189
153
|
def update_ar(ar_template)
|
|
190
154
|
return Error.new('ID not defined') if !@pe_id
|
data/lib/opennebula/zone_pool.rb
CHANGED
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: 7.
|
|
4
|
+
version: 7.3.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: 2026-
|
|
11
|
+
date: 2026-07-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|
|
@@ -185,6 +185,9 @@ files:
|
|
|
185
185
|
- lib/opennebula/image_pool.rb
|
|
186
186
|
- lib/opennebula/ldap_auth.rb
|
|
187
187
|
- lib/opennebula/ldap_auth_spec.rb
|
|
188
|
+
- lib/opennebula/lib/client.rb
|
|
189
|
+
- lib/opennebula/lib/grpc_client.rb
|
|
190
|
+
- lib/opennebula/lib/xml_client.rb
|
|
188
191
|
- lib/opennebula/lockable_ext.rb
|
|
189
192
|
- lib/opennebula/marketplace.rb
|
|
190
193
|
- lib/opennebula/marketplace_pool.rb
|
|
@@ -244,9 +247,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
244
247
|
version: '0'
|
|
245
248
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
249
|
requirements:
|
|
247
|
-
- - "
|
|
250
|
+
- - ">"
|
|
248
251
|
- !ruby/object:Gem::Version
|
|
249
|
-
version:
|
|
252
|
+
version: 1.3.1
|
|
250
253
|
requirements: []
|
|
251
254
|
rubygems_version: 3.3.5
|
|
252
255
|
signing_key:
|