opennebula-cli 6.6.3 → 6.8.0
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/bin/onebackupjob +373 -0
- data/bin/onedatastore +6 -3
- data/bin/oneflow-template +24 -6
- data/bin/oneimage +8 -3
- data/bin/onemarket +5 -3
- data/bin/onemarketapp +5 -1
- data/bin/onetemplate +15 -8
- data/bin/onevm +113 -144
- data/bin/onevmgroup +64 -1
- data/bin/onevnet +6 -3
- data/bin/onevrouter +21 -15
- data/lib/command_parser.rb +2 -9
- data/lib/one_helper/oneacl_helper.rb +6 -4
- data/lib/one_helper/onebackupjob_helper.rb +284 -0
- data/lib/one_helper/onevm_helper.rb +7 -188
- data/lib/one_helper/onevmgroup_helper.rb +15 -0
- data/lib/one_helper.rb +301 -0
- data/share/schemas/xsd/acct.xsd +2 -19
- data/share/schemas/xsd/backupjob.xsd +42 -0
- data/share/schemas/xsd/backupjob_pool.xsd +12 -0
- data/share/schemas/xsd/index.xsd +3 -0
- data/share/schemas/xsd/opennebula_configuration.xsd +3 -0
- data/share/schemas/xsd/shared.xsd +46 -0
- data/share/schemas/xsd/vm.xsd +18 -47
- data/share/schemas/xsd/vm_group.xsd +1 -0
- metadata +10 -4
data/lib/one_helper.rb
CHANGED
@@ -17,6 +17,8 @@
|
|
17
17
|
require 'cli_helper'
|
18
18
|
require 'open3'
|
19
19
|
require 'io/console'
|
20
|
+
require 'time'
|
21
|
+
require 'io/wait'
|
20
22
|
|
21
23
|
begin
|
22
24
|
require 'opennebula'
|
@@ -48,6 +50,9 @@ module OpenNebulaHelper
|
|
48
50
|
|
49
51
|
EDITOR_PATH='/usr/bin/vi'
|
50
52
|
|
53
|
+
TEMPLATE_INPUT = 'A template can be passed as a file with or the content via STDIN
|
54
|
+
Bash symbols must be escaped on STDIN passing'
|
55
|
+
|
51
56
|
########################################################################
|
52
57
|
# Options
|
53
58
|
########################################################################
|
@@ -102,6 +107,22 @@ module OpenNebulaHelper
|
|
102
107
|
:description => 'Append new attributes to the current template'
|
103
108
|
}
|
104
109
|
|
110
|
+
FILE = {
|
111
|
+
:name => 'file',
|
112
|
+
:short => '-f file',
|
113
|
+
:large => '--file file',
|
114
|
+
:description => 'Selects the template file',
|
115
|
+
:format => String,
|
116
|
+
:proc => lambda {|o, options|
|
117
|
+
if File.file?(o)
|
118
|
+
options[:file] = o
|
119
|
+
else
|
120
|
+
STDERR.puts "File `#{options[:file]}` doesn't exist"
|
121
|
+
exit(-1)
|
122
|
+
end
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
105
126
|
# Command line VM template options
|
106
127
|
TEMPLATE_NAME_VM={
|
107
128
|
:name => 'name',
|
@@ -418,6 +439,59 @@ module OpenNebulaHelper
|
|
418
439
|
options[:user_inputs] = o.join("\n")
|
419
440
|
end
|
420
441
|
},
|
442
|
+
{
|
443
|
+
:name => 'video',
|
444
|
+
:large => '--video type',
|
445
|
+
:format => String,
|
446
|
+
:description => 'Add a custom video device (none, vga, cirrus, virtio)'
|
447
|
+
},
|
448
|
+
{
|
449
|
+
:name => 'video_iommu',
|
450
|
+
:large => '--video-iommu',
|
451
|
+
:description => 'Enable IOMMU (I/O Memory Management Unit) for the video device'
|
452
|
+
},
|
453
|
+
{
|
454
|
+
:name => 'video_ats',
|
455
|
+
:large => '--video-ats',
|
456
|
+
:description => 'Enable ATS (Address Translation Services) for the video device'
|
457
|
+
},
|
458
|
+
{
|
459
|
+
:name => 'video_vram',
|
460
|
+
:large => '--video-vram vram',
|
461
|
+
:description => 'VRAM allocated to the video device. By default the ' +
|
462
|
+
"unit is megabytes. To use gigabytes add a 'g', floats " +
|
463
|
+
'can be used: 8g=8192, 0.5g=512',
|
464
|
+
:format => String,
|
465
|
+
:proc => lambda do |o, _options|
|
466
|
+
m=o.strip.match(/^(\d+(?:\.\d+)?)(m|mb|g|gb)?$/i)
|
467
|
+
|
468
|
+
if !m
|
469
|
+
[-1, 'VRAM value malformed']
|
470
|
+
else
|
471
|
+
multiplier=case m[2]
|
472
|
+
when /(g|gb)/i
|
473
|
+
1048576 # = 1024 * 1024
|
474
|
+
else
|
475
|
+
1024
|
476
|
+
end
|
477
|
+
|
478
|
+
value=m[1].to_f*multiplier
|
479
|
+
|
480
|
+
[0, value.floor]
|
481
|
+
end
|
482
|
+
end
|
483
|
+
},
|
484
|
+
{
|
485
|
+
:name => 'video_resolution',
|
486
|
+
:large => '--video-resolution resolution',
|
487
|
+
:format => String,
|
488
|
+
:description => 'Video resolution, in format like: 1280x720 or 1920x1080',
|
489
|
+
:proc => lambda do |_o, _options|
|
490
|
+
if !m.match?(/\d{3,4}x\d{3,4}/)
|
491
|
+
[-1, 'Video Resolution value malformed']
|
492
|
+
end
|
493
|
+
end
|
494
|
+
},
|
421
495
|
AS_GROUP,
|
422
496
|
AS_USER
|
423
497
|
]
|
@@ -440,6 +514,73 @@ module OpenNebulaHelper
|
|
440
514
|
:description => 'Get decrypted attributes'
|
441
515
|
}
|
442
516
|
|
517
|
+
SCHEDULE_OPTIONS=[
|
518
|
+
SCHEDULE = {
|
519
|
+
:name => 'schedule',
|
520
|
+
:large => '--schedule TIME',
|
521
|
+
:description => 'Schedules this action to be executed after' \
|
522
|
+
'the given time. For example: onevm resume 0 --schedule "09/23 14:15"',
|
523
|
+
:format => String,
|
524
|
+
:proc => lambda {|o, options|
|
525
|
+
if o[0] == '+'
|
526
|
+
options[:schedule] = o
|
527
|
+
elsif o == 'now'
|
528
|
+
options[:schedule] = Time.now.to_i
|
529
|
+
else
|
530
|
+
begin
|
531
|
+
options[:schedule] = Time.parse(o).to_i
|
532
|
+
rescue StandardError
|
533
|
+
STDERR.puts "Error parsing time spec: #{o}"
|
534
|
+
exit(-1)
|
535
|
+
end
|
536
|
+
end
|
537
|
+
}
|
538
|
+
},
|
539
|
+
|
540
|
+
WEEKLY = {
|
541
|
+
:name => 'weekly',
|
542
|
+
:large => '--weekly days',
|
543
|
+
:description => 'Repeats the schedule action the days of the week ' \
|
544
|
+
'specified, it can be a number between 0 (Sunday) to 6 (Saturday) ' \
|
545
|
+
'separated with commas. ' \
|
546
|
+
'For example: onevm resume 0 --schedule "09/23 14:15" --weekly 0,2,4',
|
547
|
+
:format => String
|
548
|
+
},
|
549
|
+
|
550
|
+
MONTHLY = {
|
551
|
+
:name => 'monthly',
|
552
|
+
:large => '--monthly days',
|
553
|
+
:description => 'Repeats the schedule action the days of the month ' \
|
554
|
+
'specified, it can be a number between 1,31 separated with commas. ' \
|
555
|
+
'For example: onevm resume 0 --schedule "09/23 14:15" --monthly 1,14',
|
556
|
+
:format => String
|
557
|
+
},
|
558
|
+
|
559
|
+
YEARLY = {
|
560
|
+
:name => 'yearly',
|
561
|
+
:large => '--yearly days',
|
562
|
+
:description => 'Repeats the schedule action the days of the year ' \
|
563
|
+
'specified, it can be a number between 0,365 separated with commas. ' \
|
564
|
+
'For example: onevm resume 0 --schedule "09/23 14:15" --yearly 30,60',
|
565
|
+
:format => String
|
566
|
+
},
|
567
|
+
|
568
|
+
HOURLY = {
|
569
|
+
:name => 'hourly',
|
570
|
+
:large => '--hourly hour',
|
571
|
+
:description => 'Repeats the schedule action with the given hourly frequency. ' \
|
572
|
+
'For example (every 5 hours): onevm resume 0 --schedule "09/23 14:15" --hourly 5',
|
573
|
+
:format => Numeric
|
574
|
+
},
|
575
|
+
|
576
|
+
END_TIME = {
|
577
|
+
:name => 'end',
|
578
|
+
:large => '--end number|TIME',
|
579
|
+
:description => '----',
|
580
|
+
:format => String
|
581
|
+
}
|
582
|
+
]
|
583
|
+
|
443
584
|
TEMPLATE_OPTIONS_VM = [TEMPLATE_NAME_VM] + TEMPLATE_OPTIONS + [DRY]
|
444
585
|
|
445
586
|
CAPACITY_OPTIONS_VM = [TEMPLATE_OPTIONS[0], TEMPLATE_OPTIONS[1],
|
@@ -546,6 +687,10 @@ module OpenNebulaHelper
|
|
546
687
|
"The default columns and their layout can be configured in #{conf_file}"
|
547
688
|
end
|
548
689
|
|
690
|
+
def self.template_input_help(object_name)
|
691
|
+
"#{TEMPLATE_INPUT}\nWhen using a template add only one #{object_name} instance."
|
692
|
+
end
|
693
|
+
|
549
694
|
def initialize(_secret = nil, _endpoint = nil)
|
550
695
|
@client=nil
|
551
696
|
|
@@ -1260,6 +1405,7 @@ module OpenNebulaHelper
|
|
1260
1405
|
#
|
1261
1406
|
# @return [Hash] XSD in hash format, nil if not found
|
1262
1407
|
def read_xsd(ename)
|
1408
|
+
require 'active_support'
|
1263
1409
|
require 'active_support/core_ext/hash/conversions'
|
1264
1410
|
|
1265
1411
|
# Try GEM directory
|
@@ -1556,6 +1702,8 @@ module OpenNebulaHelper
|
|
1556
1702
|
def self.update_template_helper(append, _id, resource, path, xpath, update = true)
|
1557
1703
|
if path
|
1558
1704
|
File.read(path)
|
1705
|
+
elsif STDIN.wait_readable(0)
|
1706
|
+
STDIN.read
|
1559
1707
|
elsif append
|
1560
1708
|
editor_input
|
1561
1709
|
else
|
@@ -1831,6 +1979,15 @@ module OpenNebulaHelper
|
|
1831
1979
|
template<<' ]' << "\n"
|
1832
1980
|
end
|
1833
1981
|
|
1982
|
+
if options[:video]
|
1983
|
+
template<<"VIDEO=[ TYPE=\"#{options[:video]}\""
|
1984
|
+
template<<', IOMMU="YES"' if options[:video_iommu]
|
1985
|
+
template<<', ATS="YES"' if options[:video_ats]
|
1986
|
+
template<<", VRAM=\"#{options[:video_vram]}\"" if options[:video_vram]
|
1987
|
+
template<<", RESOLUTION=\"#{options[:video_resolution]}\""
|
1988
|
+
template<<' ]' << "\n"
|
1989
|
+
end
|
1990
|
+
|
1834
1991
|
template<<"VCENTER_VM_FOLDER=#{options[:vcenter_vm_folder]}\n" if options[:vcenter_vm_folder]
|
1835
1992
|
|
1836
1993
|
context=create_context(options)
|
@@ -2349,4 +2506,148 @@ module OpenNebulaHelper
|
|
2349
2506
|
end
|
2350
2507
|
end
|
2351
2508
|
|
2509
|
+
def self.schedule_action_tmpl(options, action, warning = nil)
|
2510
|
+
str_periodic = ''
|
2511
|
+
|
2512
|
+
if options.key?(:weekly)
|
2513
|
+
str_periodic << ", REPEAT = 0, DAYS = \"#{options[:weekly]}\""
|
2514
|
+
elsif options.key?(:monthly)
|
2515
|
+
str_periodic << ", REPEAT = 1, DAYS = \"#{options[:monthly]}\""
|
2516
|
+
elsif options.key?(:yearly)
|
2517
|
+
str_periodic << ", REPEAT = 2, DAYS = \"#{options[:yearly]}\""
|
2518
|
+
elsif options.key?(:hourly)
|
2519
|
+
str_periodic << ", REPEAT = 3, DAYS = \"#{options[:hourly]}\""
|
2520
|
+
end
|
2521
|
+
|
2522
|
+
if options.key?(:end)
|
2523
|
+
begin
|
2524
|
+
end_date = Date.parse(options[:end])
|
2525
|
+
str_periodic << ", END_TYPE = 2, END_VALUE = #{end_date.to_time.to_i}"
|
2526
|
+
rescue ArgumentError
|
2527
|
+
if options[:end].to_i > 0
|
2528
|
+
str_periodic << ", END_TYPE = 1, END_VALUE = #{options[:end].to_i}"
|
2529
|
+
end
|
2530
|
+
end
|
2531
|
+
elsif str_periodic != ''
|
2532
|
+
str_periodic << ', END_TYPE = 0'
|
2533
|
+
end
|
2534
|
+
|
2535
|
+
tmp_str = 'SCHED_ACTION = ['
|
2536
|
+
tmp_str << "ACTION = #{action}, " if action
|
2537
|
+
tmp_str << "WARNING = #{warning}," if warning
|
2538
|
+
tmp_str << "ARGS = \"#{options[:args]}\"," if options[:args]
|
2539
|
+
tmp_str << "TIME = #{options[:schedule]}"
|
2540
|
+
tmp_str << str_periodic << ']'
|
2541
|
+
|
2542
|
+
tmp_str
|
2543
|
+
end
|
2544
|
+
|
2545
|
+
def self.scheduled_action_table(object)
|
2546
|
+
CLIHelper::ShowTable.new(nil, object) do
|
2547
|
+
column :ID, '', :adjust => true do |d|
|
2548
|
+
d['ID']
|
2549
|
+
end
|
2550
|
+
|
2551
|
+
column :ACTION, '', :adjust => true do |d|
|
2552
|
+
d['ACTION']
|
2553
|
+
end
|
2554
|
+
|
2555
|
+
column :ARGS, '', :adjust => true do |d|
|
2556
|
+
d['ARGS'] && !d['ARGS'].empty? ? d['ARGS'] : '-'
|
2557
|
+
end
|
2558
|
+
|
2559
|
+
column :SCHEDULED, '', :adjust => true do |d|
|
2560
|
+
t = d['TIME'].to_i
|
2561
|
+
|
2562
|
+
# relative action for VMs
|
2563
|
+
if d['TIME'] !~ /^[0-9].*/ && !object['STIME'].nil?
|
2564
|
+
t += object['STIME'].to_i
|
2565
|
+
end
|
2566
|
+
|
2567
|
+
OpenNebulaHelper.time_to_str(t, false) unless d.nil?
|
2568
|
+
end
|
2569
|
+
|
2570
|
+
column :REPEAT, '', :adjust => true do |d|
|
2571
|
+
begin
|
2572
|
+
str_rep = ''
|
2573
|
+
|
2574
|
+
case d['REPEAT']
|
2575
|
+
when '0'
|
2576
|
+
str_rep << 'Weekly '
|
2577
|
+
when '1'
|
2578
|
+
str_rep << 'Monthly '
|
2579
|
+
when '2'
|
2580
|
+
str_rep << 'Yearly '
|
2581
|
+
when '3'
|
2582
|
+
str_rep << 'Each ' << d['DAYS'] << ' hours'
|
2583
|
+
end
|
2584
|
+
|
2585
|
+
if d['REPEAT'] != '3'
|
2586
|
+
str_rep << d['DAYS']
|
2587
|
+
end
|
2588
|
+
|
2589
|
+
str_rep
|
2590
|
+
rescue StandardError
|
2591
|
+
''
|
2592
|
+
end
|
2593
|
+
end
|
2594
|
+
|
2595
|
+
column :END, '', :adjust => true do |d|
|
2596
|
+
begin
|
2597
|
+
str_end = ''
|
2598
|
+
|
2599
|
+
case d['END_TYPE']
|
2600
|
+
when '0'
|
2601
|
+
str_end << 'None'
|
2602
|
+
when '1'
|
2603
|
+
str_end << 'After ' << d['END_VALUE'] << ' times'
|
2604
|
+
when '2'
|
2605
|
+
str_end << 'On ' << \
|
2606
|
+
OpenNebulaHelper.time_to_str(d['END_VALUE'], false, false, true)
|
2607
|
+
end
|
2608
|
+
|
2609
|
+
str_end
|
2610
|
+
rescue StandardError
|
2611
|
+
''
|
2612
|
+
end
|
2613
|
+
end
|
2614
|
+
|
2615
|
+
column :STATUS, '', :left, :size => 50 do |d|
|
2616
|
+
begin
|
2617
|
+
if d['DONE'].to_i > 0 && d['REPEAT'].to_i < 0
|
2618
|
+
"Done on #{OpenNebulaHelper.time_to_str(d['DONE'], false)}"
|
2619
|
+
elsif d['MESSAGE'] && !d['MESSAGE'].empty?
|
2620
|
+
"Error! #{d['MESSAGE']}"
|
2621
|
+
else
|
2622
|
+
t1 = Time.now
|
2623
|
+
t2 = d['TIME'].to_i
|
2624
|
+
|
2625
|
+
# relative action for VMs
|
2626
|
+
if (d['TIME'] !~ /^[0-9].*/) && !object['STIME'].nil?
|
2627
|
+
t2 += object['STIME'].to_i
|
2628
|
+
end
|
2629
|
+
|
2630
|
+
t2 = Time.at(t2)
|
2631
|
+
|
2632
|
+
days = ((t2 - t1) / (24 * 3600)).round(2)
|
2633
|
+
hours = ((t2 - t1) / 3600).round(2)
|
2634
|
+
minutes = ((t2 - t1) / 60).round(2)
|
2635
|
+
|
2636
|
+
if days > 1
|
2637
|
+
"Next in #{days} days"
|
2638
|
+
elsif days <= 1 && hours > 1
|
2639
|
+
"Next in #{hours} hours"
|
2640
|
+
elsif minutes > 0
|
2641
|
+
"Next in #{minutes} minutes"
|
2642
|
+
else
|
2643
|
+
'Overdue!'
|
2644
|
+
end
|
2645
|
+
end
|
2646
|
+
rescue StandardError
|
2647
|
+
''
|
2648
|
+
end
|
2649
|
+
end
|
2650
|
+
end
|
2651
|
+
end
|
2652
|
+
|
2352
2653
|
end
|
data/share/schemas/xsd/acct.xsd
CHANGED
@@ -124,25 +124,8 @@
|
|
124
124
|
<xs:element name="STIME" type="xs:integer"/>
|
125
125
|
<xs:element name="ETIME" type="xs:integer"/>
|
126
126
|
<xs:element name="DEPLOY_ID" type="xs:string"/>
|
127
|
-
<xs:element name="MONITORING"
|
128
|
-
|
129
|
-
<xs:complexType>
|
130
|
-
<xs:all>
|
131
|
-
<- Percentage of 1 CPU consumed (two fully consumed cpu is 200) ->
|
132
|
-
<xs:element name="CPU" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
|
133
|
-
|
134
|
-
<- MEMORY consumption in kilobytes ->
|
135
|
-
<xs:element name="MEMORY" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
136
|
-
|
137
|
-
<- NETTX: Sent bytes to the network ->
|
138
|
-
<xs:element name="NETTX" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
139
|
-
|
140
|
-
<- NETRX: Received bytes from the network ->
|
141
|
-
<xs:element name="NETRX" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
142
|
-
</xs:all>
|
143
|
-
</xs:complexType>
|
144
|
-
-->
|
145
|
-
</xs:element>
|
127
|
+
<xs:element name="MONITORING"/>
|
128
|
+
<xs:element name="SCHED_ACTIONS" type="xs:anyType"/>
|
146
129
|
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
147
130
|
<xs:element name="USER_TEMPLATE" type="xs:anyType"/>
|
148
131
|
<xs:element name="HISTORY_RECORDS">
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
3
|
+
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
4
|
+
<xs:include schemaLocation="shared.xsd"/>
|
5
|
+
<xs:element name="BACKUPJOB">
|
6
|
+
<xs:complexType>
|
7
|
+
<xs:sequence>
|
8
|
+
<xs:element name="ID" type="xs:integer"/>
|
9
|
+
<xs:element name="UID" type="xs:integer"/>
|
10
|
+
<xs:element name="GID" type="xs:integer"/>
|
11
|
+
<xs:element name="UNAME" type="xs:string"/>
|
12
|
+
<xs:element name="GNAME" type="xs:string"/>
|
13
|
+
<xs:element name="NAME" type="xs:string"/>
|
14
|
+
<xs:element name="LOCK" type="LOCK" minOccurs="0" maxOccurs="1"/>
|
15
|
+
<xs:element name="PERMISSIONS" type="PERMISSIONS"/>
|
16
|
+
<xs:element name="PRIORITY" type="xs:integer"/>
|
17
|
+
<xs:element name="LAST_BACKUP_TIME" type="xs:integer"/>
|
18
|
+
<xs:element name="LAST_BACKUP_DURATION" type="xs:integer"/>
|
19
|
+
<xs:element name="SCHED_ACTIONS" type="IDS"/>
|
20
|
+
<xs:element name="UPDATED_VMS" type="IDS"/>
|
21
|
+
<xs:element name="OUTDATED_VMS" type="IDS"/>
|
22
|
+
<xs:element name="BACKING_UP_VMS" type="IDS"/>
|
23
|
+
<xs:element name="ERROR_VMS" type="IDS"/>
|
24
|
+
<xs:element name="TEMPLATE">
|
25
|
+
<xs:complexType>
|
26
|
+
<xs:sequence>
|
27
|
+
<xs:element name="BACKUP_VMS" type="xs:string"/>
|
28
|
+
<xs:element name="BACKUP_VOLATILE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
29
|
+
<xs:element name="DATASTORE_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
30
|
+
<xs:element name="EXECUTION" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
31
|
+
<xs:element name="FS_FREEZE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
32
|
+
<xs:element name="KEEP_LAST" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
33
|
+
<xs:element name="MODE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
34
|
+
<xs:element name="RESET" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
35
|
+
<xs:element name="SCHED_ACTION" type="SCHED_ACTION" minOccurs="0" maxOccurs="unbounded"/>
|
36
|
+
</xs:sequence>
|
37
|
+
</xs:complexType>
|
38
|
+
</xs:element>
|
39
|
+
</xs:sequence>
|
40
|
+
</xs:complexType>
|
41
|
+
</xs:element>
|
42
|
+
</xs:schema>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
3
|
+
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
4
|
+
<xs:include schemaLocation="backupjob.xsd"/>
|
5
|
+
<xs:element name="BACKUPJOB_POOL">
|
6
|
+
<xs:complexType>
|
7
|
+
<xs:sequence maxOccurs="1" minOccurs="1">
|
8
|
+
<xs:element ref="BACKUPJOB" maxOccurs="unbounded" minOccurs="0"/>
|
9
|
+
</xs:sequence>
|
10
|
+
</xs:complexType>
|
11
|
+
</xs:element>
|
12
|
+
</xs:schema>
|
data/share/schemas/xsd/index.xsd
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
<xs:include schemaLocation="acct.xsd"/>
|
5
5
|
<xs:include schemaLocation="acl_pool.xsd"/>
|
6
6
|
<xs:include schemaLocation="api_info.xsd"/>
|
7
|
+
<xs:include schemaLocation="backupjob_pool.xsd"/>
|
8
|
+
<xs:include schemaLocation="backupjob.xsd"/>
|
7
9
|
<xs:include schemaLocation="cluster_pool.xsd"/>
|
8
10
|
<xs:include schemaLocation="cluster.xsd"/>
|
9
11
|
<xs:include schemaLocation="datastore_pool.xsd"/>
|
@@ -28,6 +30,7 @@
|
|
28
30
|
<xs:include schemaLocation="raftstatus.xsd"/>
|
29
31
|
<xs:include schemaLocation="security_group_pool.xsd"/>
|
30
32
|
<xs:include schemaLocation="security_group.xsd"/>
|
33
|
+
<xs:include schemaLocation="shared.xsd"/>
|
31
34
|
<xs:include schemaLocation="showback.xsd"/>
|
32
35
|
<xs:include schemaLocation="user_pool.xsd"/>
|
33
36
|
<xs:include schemaLocation="user.xsd"/>
|
@@ -244,6 +244,8 @@
|
|
244
244
|
</xs:complexType>
|
245
245
|
</xs:element>
|
246
246
|
|
247
|
+
<xs:element name="MAX_BACKUPS" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
248
|
+
<xs:element name="MAX_BACKUPS_HOST" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
247
249
|
<xs:element name="MAX_CONN" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
248
250
|
<xs:element name="MAX_CONN_BACKLOG" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
249
251
|
<xs:element name="MESSAGE_SIZE" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
@@ -293,6 +295,7 @@
|
|
293
295
|
<xs:element name="CLONE_TARGET" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
294
296
|
<xs:element name="CLONE_TARGET_SHARED" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
295
297
|
<xs:element name="CLONE_TARGET_SSH" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
298
|
+
<xs:element name="DISK_TYPE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
296
299
|
<xs:element name="DISK_TYPE_SHARED" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
297
300
|
<xs:element name="DISK_TYPE_SSH" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
298
301
|
<xs:element name="DRIVER" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
3
|
+
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
4
|
+
<xs:complexType name="LOCK">
|
5
|
+
<xs:sequence>
|
6
|
+
<xs:element name="LOCKED" type="xs:integer"/>
|
7
|
+
<xs:element name="OWNER" type="xs:integer"/>
|
8
|
+
<xs:element name="TIME" type="xs:integer"/>
|
9
|
+
<xs:element name="REQ_ID" type="xs:integer"/>
|
10
|
+
</xs:sequence>
|
11
|
+
</xs:complexType>
|
12
|
+
<xs:complexType name="PERMISSIONS">
|
13
|
+
<xs:sequence>
|
14
|
+
<xs:element name="OWNER_U" type="xs:integer"/>
|
15
|
+
<xs:element name="OWNER_M" type="xs:integer"/>
|
16
|
+
<xs:element name="OWNER_A" type="xs:integer"/>
|
17
|
+
<xs:element name="GROUP_U" type="xs:integer"/>
|
18
|
+
<xs:element name="GROUP_M" type="xs:integer"/>
|
19
|
+
<xs:element name="GROUP_A" type="xs:integer"/>
|
20
|
+
<xs:element name="OTHER_U" type="xs:integer"/>
|
21
|
+
<xs:element name="OTHER_M" type="xs:integer"/>
|
22
|
+
<xs:element name="OTHER_A" type="xs:integer"/>
|
23
|
+
</xs:sequence>
|
24
|
+
</xs:complexType>
|
25
|
+
<xs:complexType name="IDS">
|
26
|
+
<xs:sequence>
|
27
|
+
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
|
28
|
+
</xs:sequence>
|
29
|
+
</xs:complexType>
|
30
|
+
<xs:complexType name="SCHED_ACTION">
|
31
|
+
<xs:sequence>
|
32
|
+
<xs:element name="ID" type="xs:integer"/>
|
33
|
+
<xs:element name="PARENT_ID" type="xs:integer"/>
|
34
|
+
<xs:element name="TYPE" type="xs:string"/>
|
35
|
+
<xs:element name="ACTION" type="xs:string"/>
|
36
|
+
<xs:element name="ARGS" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
37
|
+
<xs:element name="TIME" type="xs:string"/>
|
38
|
+
<xs:element name="REPEAT" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
39
|
+
<xs:element name="DAYS" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
40
|
+
<xs:element name="END_TYPE" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
41
|
+
<xs:element name="END_VALUE" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
42
|
+
<xs:element name="DONE" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
43
|
+
<xs:element name="MESSAGE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
44
|
+
</xs:sequence>
|
45
|
+
</xs:complexType>
|
46
|
+
</xs:schema>
|
data/share/schemas/xsd/vm.xsd
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
3
3
|
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
4
|
+
<xs:include schemaLocation="shared.xsd"/>
|
4
5
|
<xs:element name="VM">
|
5
6
|
<xs:complexType>
|
6
7
|
<xs:sequence>
|
@@ -10,21 +11,7 @@
|
|
10
11
|
<xs:element name="UNAME" type="xs:string"/>
|
11
12
|
<xs:element name="GNAME" type="xs:string"/>
|
12
13
|
<xs:element name="NAME" type="xs:string"/>
|
13
|
-
<xs:element name="PERMISSIONS"
|
14
|
-
<xs:complexType>
|
15
|
-
<xs:sequence>
|
16
|
-
<xs:element name="OWNER_U" type="xs:integer"/>
|
17
|
-
<xs:element name="OWNER_M" type="xs:integer"/>
|
18
|
-
<xs:element name="OWNER_A" type="xs:integer"/>
|
19
|
-
<xs:element name="GROUP_U" type="xs:integer"/>
|
20
|
-
<xs:element name="GROUP_M" type="xs:integer"/>
|
21
|
-
<xs:element name="GROUP_A" type="xs:integer"/>
|
22
|
-
<xs:element name="OTHER_U" type="xs:integer"/>
|
23
|
-
<xs:element name="OTHER_M" type="xs:integer"/>
|
24
|
-
<xs:element name="OTHER_A" type="xs:integer"/>
|
25
|
-
</xs:sequence>
|
26
|
-
</xs:complexType>
|
27
|
-
</xs:element>
|
14
|
+
<xs:element name="PERMISSIONS" type="PERMISSIONS"/>
|
28
15
|
<xs:element name="LAST_POLL" type="xs:integer"/>
|
29
16
|
|
30
17
|
<!-- STATE and LCM_STATE values,
|
@@ -38,16 +25,7 @@
|
|
38
25
|
<xs:element name="STIME" type="xs:integer"/>
|
39
26
|
<xs:element name="ETIME" type="xs:integer"/>
|
40
27
|
<xs:element name="DEPLOY_ID" type="xs:string"/>
|
41
|
-
<xs:element name="LOCK" minOccurs="0" maxOccurs="1"
|
42
|
-
<xs:complexType>
|
43
|
-
<xs:sequence>
|
44
|
-
<xs:element name="LOCKED" type="xs:integer"/>
|
45
|
-
<xs:element name="OWNER" type="xs:integer"/>
|
46
|
-
<xs:element name="TIME" type="xs:integer"/>
|
47
|
-
<xs:element name="REQ_ID" type="xs:integer"/>
|
48
|
-
</xs:sequence>
|
49
|
-
</xs:complexType>
|
50
|
-
</xs:element>
|
28
|
+
<xs:element name="LOCK" type="LOCK" minOccurs="0" maxOccurs="1"/>
|
51
29
|
<xs:element name="MONITORING">
|
52
30
|
<xs:complexType>
|
53
31
|
<xs:sequence>
|
@@ -91,6 +69,7 @@
|
|
91
69
|
</xs:sequence>
|
92
70
|
</xs:complexType>
|
93
71
|
</xs:element>
|
72
|
+
<xs:element name="SCHED_ACTIONS" type="IDS"/>
|
94
73
|
<xs:element name="TEMPLATE">
|
95
74
|
<xs:complexType>
|
96
75
|
<xs:sequence>
|
@@ -116,6 +95,17 @@
|
|
116
95
|
<xs:element name="FEATURES" minOccurs="0" maxOccurs="1"/>
|
117
96
|
<xs:element name="HYPERV_OPTIONS" minOccurs="0" maxOccurs="1"/>
|
118
97
|
<xs:element name="GRAPHICS" minOccurs="0" maxOccurs="1"/>
|
98
|
+
<xs:element name="VIDEO" minOccurs="0" maxOccurs="1">
|
99
|
+
<xs:complexType>
|
100
|
+
<xs:sequence>
|
101
|
+
<xs:element name="TYPE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
102
|
+
<xs:element name="IOMMU" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
103
|
+
<xs:element name="ATS" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
104
|
+
<xs:element name="VRAM" type="xs:integer" minOccurs="0" maxOccurs="1"/>
|
105
|
+
<xs:element name="RESOLUTION" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
106
|
+
</xs:sequence>
|
107
|
+
</xs:complexType>
|
108
|
+
</xs:element>
|
119
109
|
<xs:element name="IMPORTED" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
120
110
|
<xs:element name="INPUT" minOccurs="0" maxOccurs="1"/>
|
121
111
|
<xs:element name="MEMORY" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
@@ -152,21 +142,6 @@
|
|
152
142
|
<xs:element name="OS" minOccurs="0" maxOccurs="1"/>
|
153
143
|
<xs:element name="PCI" minOccurs="0" maxOccurs="1"/>
|
154
144
|
<xs:element name="RAW" minOccurs="0" maxOccurs="1"/>
|
155
|
-
<xs:element name="SCHED_ACTION" minOccurs="0" maxOccurs="unbounded">
|
156
|
-
<xs:complexType>
|
157
|
-
<xs:sequence>
|
158
|
-
<xs:element name="ACTION" type="xs:string"/>
|
159
|
-
<xs:element name="ARGS" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
160
|
-
<xs:element name="DAYS" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
161
|
-
<xs:element name="END_TYPE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
162
|
-
<xs:element name="END_VALUE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
163
|
-
<xs:element name="ID" type="xs:string"/>
|
164
|
-
<xs:element name="REPEAT" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
165
|
-
<xs:element name="TIME" type="xs:string"/>
|
166
|
-
<xs:element name="WARNING" type="xs:string"/>
|
167
|
-
</xs:sequence>
|
168
|
-
</xs:complexType>
|
169
|
-
</xs:element>
|
170
145
|
<xs:element name="SECURITY_GROUP_RULE" minOccurs="0" maxOccurs="unbounded"/>
|
171
146
|
<xs:element name="SNAPSHOT" minOccurs="0" maxOccurs="unbounded">
|
172
147
|
<xs:complexType>
|
@@ -193,6 +168,7 @@
|
|
193
168
|
<xs:element name="VROUTER_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
194
169
|
<xs:element name="VROUTER_KEEPALIVED_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
195
170
|
<xs:element name="VROUTER_KEEPALIVED_PASSWORD" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
171
|
+
<xs:element name="SCHED_ACTION" type="SCHED_ACTION" minOccurs="0" maxOccurs="unbounded"/>
|
196
172
|
</xs:sequence>
|
197
173
|
</xs:complexType>
|
198
174
|
</xs:element>
|
@@ -319,6 +295,7 @@
|
|
319
295
|
<xs:element name="BACKUP_CONFIG" minOccurs="1" maxOccurs="1">
|
320
296
|
<xs:complexType>
|
321
297
|
<xs:sequence>
|
298
|
+
<xs:element name="BACKUP_JOB_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
322
299
|
<xs:element name="BACKUP_VOLATILE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
323
300
|
<xs:element name="FS_FREEZE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
324
301
|
<xs:element name="INCREMENTAL_BACKUP_ID" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
@@ -331,13 +308,7 @@
|
|
331
308
|
</xs:sequence>
|
332
309
|
</xs:complexType>
|
333
310
|
</xs:element>
|
334
|
-
<xs:element name="BACKUP_IDS"
|
335
|
-
<xs:complexType>
|
336
|
-
<xs:sequence>
|
337
|
-
<xs:element name="ID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
|
338
|
-
</xs:sequence>
|
339
|
-
</xs:complexType>
|
340
|
-
</xs:element>
|
311
|
+
<xs:element name="BACKUP_IDS" type="IDS"/>
|
341
312
|
</xs:sequence>
|
342
313
|
</xs:complexType>
|
343
314
|
</xs:element>
|