opennebula-cli 5.10.4 → 5.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/bin/oneacct +2 -1
  3. data/bin/oneacl +2 -1
  4. data/bin/onecluster +2 -1
  5. data/bin/onedatastore +2 -1
  6. data/bin/oneflow +149 -551
  7. data/bin/oneflow-template +171 -292
  8. data/bin/onegroup +2 -1
  9. data/bin/onehook +2 -1
  10. data/bin/onehost +76 -9
  11. data/bin/oneimage +2 -1
  12. data/bin/onemarket +2 -1
  13. data/bin/onemarketapp +15 -3
  14. data/bin/onesecgroup +2 -1
  15. data/bin/oneshowback +2 -1
  16. data/bin/onetemplate +2 -1
  17. data/bin/oneuser +2 -1
  18. data/bin/onevcenter +2 -1
  19. data/bin/onevdc +2 -1
  20. data/bin/onevm +88 -16
  21. data/bin/onevmgroup +2 -1
  22. data/bin/onevnet +11 -3
  23. data/bin/onevntemplate +2 -1
  24. data/bin/onevrouter +2 -1
  25. data/bin/onezone +5 -1
  26. data/lib/cli_helper.rb +54 -30
  27. data/lib/command_parser.rb +33 -14
  28. data/lib/one_helper.rb +258 -6
  29. data/lib/one_helper/oneacct_helper.rb +1 -1
  30. data/lib/one_helper/oneacl_helper.rb +1 -1
  31. data/lib/one_helper/onecluster_helper.rb +4 -4
  32. data/lib/one_helper/onedatastore_helper.rb +1 -1
  33. data/lib/one_helper/oneflow_helper.rb +419 -0
  34. data/lib/one_helper/oneflowtemplate_helper.rb +312 -0
  35. data/lib/one_helper/onegroup_helper.rb +1 -1
  36. data/lib/one_helper/onehook_helper.rb +1 -1
  37. data/lib/one_helper/onehost_helper.rb +148 -68
  38. data/lib/one_helper/oneimage_helper.rb +2 -2
  39. data/lib/one_helper/onemarket_helper.rb +1 -1
  40. data/lib/one_helper/onemarketapp_helper.rb +1 -1
  41. data/lib/one_helper/oneprovision_helper.rb +104 -60
  42. data/lib/one_helper/onequota_helper.rb +1 -1
  43. data/lib/one_helper/onesecgroup_helper.rb +1 -1
  44. data/lib/one_helper/onetemplate_helper.rb +9 -180
  45. data/lib/one_helper/oneuser_helper.rb +1 -1
  46. data/lib/one_helper/onevcenter_helper.rb +2 -1
  47. data/lib/one_helper/onevdc_helper.rb +1 -1
  48. data/lib/one_helper/onevm_helper.rb +11 -6
  49. data/lib/one_helper/onevmgroup_helper.rb +1 -1
  50. data/lib/one_helper/onevnet_helper.rb +1 -1
  51. data/lib/one_helper/onevntemplate_helper.rb +1 -1
  52. data/lib/one_helper/onevrouter_helper.rb +1 -1
  53. data/lib/one_helper/onezone_helper.rb +3 -1
  54. metadata +8 -6
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -30,6 +30,7 @@ end
30
30
 
31
31
  if File.directory?(GEMS_LOCATION)
32
32
  Gem.use_paths(GEMS_LOCATION)
33
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
33
34
  end
34
35
 
35
36
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -77,13 +78,12 @@ CommandParser::CmdParser.new(ARGV) do
77
78
  :description => 'Force probe upgrade in onehost sync'
78
79
  }
79
80
 
80
- RSYNC = {
81
- :name => 'rsync',
82
- :large => '--rsync',
83
- :description => 'Use rsync to synchronize remotes. In case some '\
84
- 'probes are no longer in the fronted ithey will be '\
85
- 'deleted in the hosts. rsync command must be '\
86
- 'installed in the frontend and nodes.'
81
+ SSH = {
82
+ :name => 'ssh',
83
+ :large => '--ssh',
84
+ :description => 'Use SSH to synchronize remotes. In case some '\
85
+ 'probes are no longer in the fronted they will be '\
86
+ 'deleted in the hosts.'
87
87
  }
88
88
 
89
89
  TYPE = {
@@ -95,7 +95,53 @@ CommandParser::CmdParser.new(ARGV) do
95
95
  }
96
96
 
97
97
  CREAT_OPTIONS = [IM, VMM, OneClusterHelper::CLUSTER, TYPE]
98
- SYNC_OPTIONS = [OneClusterHelper::CLUSTER, FORCE, RSYNC]
98
+ SYNC_OPTIONS = [OneClusterHelper::CLUSTER, FORCE, SSH]
99
+
100
+ ########################################################################
101
+ # Monitoring PLOT options
102
+ ########################################################################
103
+ START_T = {
104
+ :name => 'start',
105
+ :large => '--start date',
106
+ :description => 'Start date to show data',
107
+ :format => String
108
+ }
109
+
110
+ END_T = {
111
+ :name => 'end',
112
+ :large => '--end date',
113
+ :description => 'End date to show data',
114
+ :format => String
115
+ }
116
+
117
+ UNIT = {
118
+ :name => 'unit',
119
+ :large => '--unit unit',
120
+ :description => 'Unit to format data',
121
+ :format => String
122
+ }
123
+
124
+ TABLE = {
125
+ :name => 'table',
126
+ :large => '--table',
127
+ :description => 'Show monitoring information in table format'
128
+ }
129
+
130
+ N_ELEMS = {
131
+ :name => 'n_elems',
132
+ :large => '--n elements',
133
+ :description => 'Number of records to show',
134
+ :format => Integer
135
+ }
136
+
137
+ CSV_WITH_SEP = {
138
+ :name => 'csv',
139
+ :large => '--csv separator',
140
+ :description => 'Show data in CSV format',
141
+ :format => String
142
+ }
143
+
144
+ PLOT_OPTS = [START_T, END_T, UNIT, TABLE, N_ELEMS, CSV_WITH_SEP]
99
145
 
100
146
  ########################################################################
101
147
  # Formatters for arguments
@@ -304,4 +350,25 @@ CommandParser::CmdParser.new(ARGV) do
304
350
  :options => [OneClusterHelper::CLUSTER] do
305
351
  helper.forceupdate(args[0], options)
306
352
  end
353
+
354
+ monitoring_desc = <<-EOT.unindent
355
+ Show monitoring metrics in a graphic
356
+ EOT
357
+
358
+ command :monitoring,
359
+ monitoring_desc,
360
+ :hostid,
361
+ :attr,
362
+ :options => PLOT_OPTS do
363
+ helper.perform_action(args[0], options, 'monitoring') do |host|
364
+ rc = host.info
365
+
366
+ if OpenNebula.is_error?(rc)
367
+ STDERR.puts rc.message
368
+ exit(-1)
369
+ end
370
+
371
+ helper.monitoring(host, args[1], options)
372
+ end
373
+ end
307
374
  end
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -30,6 +30,7 @@ end
30
30
 
31
31
  if File.directory?(GEMS_LOCATION)
32
32
  Gem.use_paths(GEMS_LOCATION)
33
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
33
34
  end
34
35
 
35
36
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -74,6 +75,13 @@ CommandParser::CmdParser.new(ARGV) do
74
75
  :description => 'lock all actions'
75
76
  }
76
77
 
78
+ TAG = {
79
+ :name => 'tag',
80
+ :large => '--tag tag',
81
+ :format => String,
82
+ :description => 'DockerHub image tag (default latest)'
83
+ }
84
+
77
85
  ########################################################################
78
86
  # Global Options
79
87
  ########################################################################
@@ -86,7 +94,8 @@ CommandParser::CmdParser.new(ARGV) do
86
94
 
87
95
  CREATE_OPTIONS = [OneMarketPlaceHelper::MARKETPLACE]
88
96
  EXPORT_OPTIONS = [OneDatastoreHelper::DATASTORE,
89
- OneMarketPlaceAppHelper::VMNAME]
97
+ OneMarketPlaceAppHelper::VMNAME,
98
+ TAG]
90
99
 
91
100
  ########################################################################
92
101
  # Formatters for arguments
@@ -171,10 +180,13 @@ CommandParser::CmdParser.new(ARGV) do
171
180
 
172
181
  command :export, export_desc, :appid, :name, :options => EXPORT_OPTIONS do
173
182
  helper.perform_action(args[0], options, 'exported') do |obj|
183
+ tag ="tag=#{options[:tag]}" if options[:tag]
184
+
174
185
  rc = obj.export(
175
186
  :dsid => options[:datastore],
176
187
  :name => args[1],
177
- :vmtemplate_name => options[:vmname]
188
+ :vmtemplate_name => options[:vmname],
189
+ :url_args => tag
178
190
  )
179
191
 
180
192
  next rc if OpenNebula.is_error?(rc)
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -30,6 +30,7 @@ end
30
30
 
31
31
  if File.directory?(GEMS_LOCATION)
32
32
  Gem.use_paths(GEMS_LOCATION)
33
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
33
34
  end
34
35
 
35
36
  $LOAD_PATH << RUBY_LIB_LOCATION
data/bin/onevdc CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
data/bin/onevm CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  # -------------------------------------------------------------------------- #
4
- # Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
4
+ # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems #
5
5
  # #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
7
7
  # not use this file except in compliance with the License. You may obtain #
@@ -28,6 +28,7 @@ end
28
28
 
29
29
  if File.directory?(GEMS_LOCATION)
30
30
  Gem.use_paths(GEMS_LOCATION)
31
+ $LOAD_PATH.reject! {|l| l =~ /(vendor|site)_ruby/ }
31
32
  end
32
33
 
33
34
  $LOAD_PATH << RUBY_LIB_LOCATION
@@ -927,6 +928,9 @@ CommandParser::CmdParser.new(ARGV) do
927
928
  OneVMHelper::HOURLY,
928
929
  OneVMHelper::END_TIME] do
929
930
  if !options[:schedule].nil?
931
+ # add name as an argument
932
+ options[:args] = args[1]
933
+
930
934
  helper.schedule_actions(args[0], options, @comm_name)
931
935
  else
932
936
  helper.perform_actions(args[0], options, 'snapshot created') do |o|
@@ -940,9 +944,22 @@ CommandParser::CmdParser.new(ARGV) do
940
944
  Reverts a VM to a saved snapshot
941
945
  EOT
942
946
 
943
- command :"snapshot-revert", snapshot_revert_desc, :vmid, :snapshot_id do
944
- helper.perform_action(args[0], options, 'snapshot reverted') do |o|
945
- o.snapshot_revert(args[1].to_i)
947
+ command :"snapshot-revert", snapshot_revert_desc, :vmid, :snapshot_id,
948
+ :options => [OneVMHelper::SCHEDULE,
949
+ OneVMHelper::WEEKLY,
950
+ OneVMHelper::MONTHLY,
951
+ OneVMHelper::YEARLY,
952
+ OneVMHelper::HOURLY,
953
+ OneVMHelper::END_TIME] do
954
+ if !options[:schedule].nil?
955
+ # add snap ID as an argument
956
+ options[:args] = args[1]
957
+
958
+ helper.schedule_actions([args[0]], options, @comm_name)
959
+ else
960
+ helper.perform_action(args[0], options, 'snapshot reverted') do |o|
961
+ o.snapshot_revert(args[1].to_i)
962
+ end
946
963
  end
947
964
  end
948
965
 
@@ -951,9 +968,22 @@ CommandParser::CmdParser.new(ARGV) do
951
968
  Delets a snapshot of a VM
952
969
  EOT
953
970
 
954
- command :"snapshot-delete", snapshot_delete_desc, :vmid, :snapshot_id do
955
- helper.perform_action(args[0], options, 'snapshot deleted') do |o|
956
- o.snapshot_delete(args[1])
971
+ command :"snapshot-delete", snapshot_delete_desc, :vmid, :snapshot_id,
972
+ :options => [OneVMHelper::SCHEDULE,
973
+ OneVMHelper::WEEKLY,
974
+ OneVMHelper::MONTHLY,
975
+ OneVMHelper::YEARLY,
976
+ OneVMHelper::HOURLY,
977
+ OneVMHelper::END_TIME] do
978
+ if !options[:schedule].nil?
979
+ # add snap ID as an argument
980
+ options[:args] = args[1]
981
+
982
+ helper.schedule_actions([args[0]], options, @comm_name)
983
+ else
984
+ helper.perform_action(args[0], options, 'snapshot deleted') do |o|
985
+ o.snapshot_delete(args[1])
986
+ end
957
987
  end
958
988
  end
959
989
 
@@ -965,9 +995,23 @@ CommandParser::CmdParser.new(ARGV) do
965
995
  EOT
966
996
 
967
997
  command :"disk-snapshot-create", disk_snapshot_create_desc,
968
- :vmid, :diskid, :name do
969
- helper.perform_action(args[0], options, 'disk snapshot created') do |o|
970
- o.disk_snapshot_create(args[1].to_i, args[2])
998
+ :vmid, :diskid, :name,
999
+ :options => [OneVMHelper::SCHEDULE,
1000
+ OneVMHelper::WEEKLY,
1001
+ OneVMHelper::MONTHLY,
1002
+ OneVMHelper::YEARLY,
1003
+ OneVMHelper::HOURLY,
1004
+ OneVMHelper::END_TIME] do
1005
+ if !options[:schedule].nil?
1006
+ # add disk ID and name as arguments
1007
+ options[:args] = "#{args[1]},#{args[2]}"
1008
+
1009
+ helper.schedule_actions([args[0]], options, @comm_name)
1010
+ else
1011
+ helper.perform_action(args[0], options,
1012
+ 'disk snapshot created') do |o|
1013
+ o.disk_snapshot_create(args[1].to_i, args[2])
1014
+ end
971
1015
  end
972
1016
  end
973
1017
 
@@ -978,9 +1022,23 @@ CommandParser::CmdParser.new(ARGV) do
978
1022
  EOT
979
1023
 
980
1024
  command :"disk-snapshot-revert", disk_snapshot_revert_desc,
981
- :vmid, :diskid, :disk_snapshot_id do
982
- helper.perform_action(args[0], options, 'disk snapshot reverted') do |o|
983
- o.disk_snapshot_revert(args[1].to_i, args[2].to_i)
1025
+ :vmid, :diskid, :disk_snapshot_id,
1026
+ :options => [OneVMHelper::SCHEDULE,
1027
+ OneVMHelper::WEEKLY,
1028
+ OneVMHelper::MONTHLY,
1029
+ OneVMHelper::YEARLY,
1030
+ OneVMHelper::HOURLY,
1031
+ OneVMHelper::END_TIME] do
1032
+ if !options[:schedule].nil?
1033
+ # add disk ID and snap ID as arguments
1034
+ options[:args] = "#{args[1]},#{args[2]}"
1035
+
1036
+ helper.schedule_actions([args[0]], options, @comm_name)
1037
+ else
1038
+ helper.perform_action(args[0], options,
1039
+ 'disk snapshot reverted') do |o|
1040
+ o.disk_snapshot_revert(args[1].to_i, args[2].to_i)
1041
+ end
984
1042
  end
985
1043
  end
986
1044
 
@@ -991,9 +1049,23 @@ CommandParser::CmdParser.new(ARGV) do
991
1049
  EOT
992
1050
 
993
1051
  command :"disk-snapshot-delete", disk_snapshot_delete_desc,
994
- :vmid, :diskid, :disk_snapshot_id do
995
- helper.perform_action(args[0], options, 'disk snapshot deleted') do |o|
996
- o.disk_snapshot_delete(args[1].to_i, args[2].to_i)
1052
+ :vmid, :diskid, :disk_snapshot_id,
1053
+ :options => [OneVMHelper::SCHEDULE,
1054
+ OneVMHelper::WEEKLY,
1055
+ OneVMHelper::MONTHLY,
1056
+ OneVMHelper::YEARLY,
1057
+ OneVMHelper::HOURLY,
1058
+ OneVMHelper::END_TIME] do
1059
+ if !options[:schedule].nil?
1060
+ # add disk ID and snap ID as arguments
1061
+ options[:args] = "#{args[1]},#{args[2]}"
1062
+
1063
+ helper.schedule_actions([args[0]], options, @comm_name)
1064
+ else
1065
+ helper.perform_action(args[0], options,
1066
+ 'disk snapshot deleted') do |o|
1067
+ o.disk_snapshot_delete(args[1].to_i, args[2].to_i)
1068
+ end
997
1069
  end
998
1070
  end
999
1071