morpheus-cli 3.6.9 → 3.6.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/morpheus/api/api_client.rb +0 -4
  3. data/lib/morpheus/api/deploy_interface.rb +12 -8
  4. data/lib/morpheus/cli.rb +0 -1
  5. data/lib/morpheus/cli/access_token_command.rb +3 -4
  6. data/lib/morpheus/cli/account_groups_command.rb +8 -3
  7. data/lib/morpheus/cli/apps.rb +10 -5
  8. data/lib/morpheus/cli/archives_command.rb +20 -6
  9. data/lib/morpheus/cli/boot_scripts_command.rb +5 -2
  10. data/lib/morpheus/cli/change_password_command.rb +1 -1
  11. data/lib/morpheus/cli/cli_command.rb +2 -4
  12. data/lib/morpheus/cli/cloud_datastores_command.rb +3 -2
  13. data/lib/morpheus/cli/commands/standard/alias_command.rb +10 -14
  14. data/lib/morpheus/cli/commands/standard/history_command.rb +0 -20
  15. data/lib/morpheus/cli/commands/standard/man_command.rb +8 -8
  16. data/lib/morpheus/cli/containers_command.rb +9 -1
  17. data/lib/morpheus/cli/credentials.rb +2 -1
  18. data/lib/morpheus/cli/cypher_command.rb +10 -2
  19. data/lib/morpheus/cli/dashboard_command.rb +1 -0
  20. data/lib/morpheus/cli/deployments.rb +5 -1
  21. data/lib/morpheus/cli/deploys.rb +26 -9
  22. data/lib/morpheus/cli/execute_schedules_command.rb +9 -1
  23. data/lib/morpheus/cli/execution_request_command.rb +3 -2
  24. data/lib/morpheus/cli/file_copy_request_command.rb +3 -2
  25. data/lib/morpheus/cli/hosts.rb +8 -6
  26. data/lib/morpheus/cli/image_builder_command.rb +14 -10
  27. data/lib/morpheus/cli/instance_types.rb +2 -1
  28. data/lib/morpheus/cli/instances.rb +9 -4
  29. data/lib/morpheus/cli/key_pairs.rb +33 -21
  30. data/lib/morpheus/cli/library_container_scripts_command.rb +5 -2
  31. data/lib/morpheus/cli/library_container_templates_command.rb +5 -2
  32. data/lib/morpheus/cli/library_container_types_command.rb +5 -3
  33. data/lib/morpheus/cli/library_instance_types_command.rb +6 -2
  34. data/lib/morpheus/cli/library_layouts_command.rb +5 -3
  35. data/lib/morpheus/cli/library_option_lists_command.rb +5 -1
  36. data/lib/morpheus/cli/library_option_types_command.rb +5 -0
  37. data/lib/morpheus/cli/library_upgrades_command.rb +5 -3
  38. data/lib/morpheus/cli/license.rb +3 -0
  39. data/lib/morpheus/cli/load_balancers.rb +10 -1
  40. data/lib/morpheus/cli/mixins/processes_helper.rb +10 -4
  41. data/lib/morpheus/cli/monitoring_apps_command.rb +32 -26
  42. data/lib/morpheus/cli/monitoring_checks_command.rb +35 -27
  43. data/lib/morpheus/cli/monitoring_contacts_command.rb +19 -16
  44. data/lib/morpheus/cli/monitoring_groups_command.rb +32 -26
  45. data/lib/morpheus/cli/monitoring_incidents_command.rb +39 -30
  46. data/lib/morpheus/cli/network_domains_command.rb +5 -2
  47. data/lib/morpheus/cli/network_groups_command.rb +5 -2
  48. data/lib/morpheus/cli/network_pool_servers_command.rb +5 -2
  49. data/lib/morpheus/cli/network_pools_command.rb +5 -2
  50. data/lib/morpheus/cli/network_proxies_command.rb +5 -2
  51. data/lib/morpheus/cli/network_services_command.rb +1 -0
  52. data/lib/morpheus/cli/networks_command.rb +5 -2
  53. data/lib/morpheus/cli/packages_command.rb +6 -3
  54. data/lib/morpheus/cli/policies_command.rb +17 -3
  55. data/lib/morpheus/cli/power_schedules_command.rb +9 -1
  56. data/lib/morpheus/cli/preseed_scripts_command.rb +5 -2
  57. data/lib/morpheus/cli/processes_command.rb +17 -6
  58. data/lib/morpheus/cli/recent_activity_command.rb +1 -0
  59. data/lib/morpheus/cli/remote.rb +1 -0
  60. data/lib/morpheus/cli/roles.rb +14 -5
  61. data/lib/morpheus/cli/security_group_rules.rb +8 -4
  62. data/lib/morpheus/cli/security_groups.rb +4 -0
  63. data/lib/morpheus/cli/shell.rb +13 -23
  64. data/lib/morpheus/cli/storage_providers_command.rb +12 -6
  65. data/lib/morpheus/cli/tasks.rb +6 -0
  66. data/lib/morpheus/cli/tenants_command.rb +13 -9
  67. data/lib/morpheus/cli/user_groups_command.rb +7 -1
  68. data/lib/morpheus/cli/user_settings_command.rb +7 -1
  69. data/lib/morpheus/cli/user_sources_command.rb +10 -8
  70. data/lib/morpheus/cli/users.rb +7 -2
  71. data/lib/morpheus/cli/version.rb +1 -1
  72. data/lib/morpheus/cli/virtual_images.rb +8 -1
  73. data/lib/morpheus/cli/whoami.rb +34 -15
  74. data/lib/morpheus/cli/workflows.rb +5 -0
  75. data/lib/morpheus/formatters.rb +4 -0
  76. data/lib/morpheus/rest_client.rb +6 -1
  77. metadata +2 -4
  78. data/lib/morpheus/api/app_templates_interface.rb +0 -64
  79. data/lib/morpheus/cli/app_templates.rb +0 -2019
@@ -37,6 +37,14 @@ class Morpheus::Cli::Processes
37
37
  opts.on( nil, '--output', "Display process output." ) do
38
38
  options[:show_output] = true
39
39
  end
40
+ opts.on(nil, '--details', "Display all details. Includes sub processes, output and error data is not truncated." ) do
41
+ options[:show_events] = true
42
+ options[:show_output] = true
43
+ options[:details] = true
44
+ end
45
+ opts.on('--app ID', String, "Limit results to specific app(s).") do |val|
46
+ params['appIds'] = val.split(',').collect {|it| it.to_s.strip }.reject { |it| it.empty? }
47
+ end
40
48
  opts.on('--instance ID', String, "Limit results to specific instance(s).") do |val|
41
49
  params['instanceIds'] = val.split(',').collect {|it| it.to_s.strip }.reject { |it| it.empty? }
42
50
  end
@@ -103,8 +111,8 @@ class Morpheus::Cli::Processes
103
111
  startDate: format_local_dt(process['startDate']),
104
112
  duration: format_process_duration(process),
105
113
  status: format_process_status(process),
106
- error: format_process_error(process),
107
- output: format_process_output(process)
114
+ error: format_process_error(process, options[:details] ? nil : 20),
115
+ output: format_process_output(process, options[:details] ? nil : 20)
108
116
  }
109
117
  history_records << row
110
118
  process_events = process['events'] || process['processEvents']
@@ -122,8 +130,8 @@ class Morpheus::Cli::Processes
122
130
  startDate: format_local_dt(process_event['startDate']),
123
131
  duration: format_process_duration(process_event),
124
132
  status: format_process_status(process_event),
125
- error: format_process_error(process_event),
126
- output: format_process_output(process_event)
133
+ error: format_process_error(process_event, options[:details] ? nil : 20),
134
+ output: format_process_output(process_event, options[:details] ? nil : 20)
127
135
  }
128
136
  history_records << event_row
129
137
  end
@@ -177,6 +185,9 @@ class Morpheus::Cli::Processes
177
185
  process_id = nil
178
186
  optparse = Morpheus::Cli::OptionParser.new do |opts|
179
187
  opts.banner = subcommand_usage("[id]")
188
+ opts.on(nil, '--details', "Display more details. Shows everything, untruncated." ) do
189
+ options[:details] = true
190
+ end
180
191
  build_common_options(opts, options, [:query, :json, :yaml, :csv, :fields, :dry_run, :remote])
181
192
  opts.footer = "Display details for a specific process.\n"
182
193
  "[id] is required. This is the id of the process."
@@ -233,8 +244,8 @@ class Morpheus::Cli::Processes
233
244
  startDate: format_local_dt(process_event['startDate']),
234
245
  duration: format_process_duration(process_event),
235
246
  status: format_process_status(process_event),
236
- error: format_process_error(process_event),
237
- output: format_process_output(process_event)
247
+ error: format_process_error(process_event, options[:details] ? nil : 20),
248
+ output: format_process_output(process_event, options[:details] ? nil : 20)
238
249
  }
239
250
  history_records << event_row
240
251
  end
@@ -45,6 +45,7 @@ class Morpheus::Cli::RecentActivityCommand
45
45
  account_id = account ? account['id'] : nil
46
46
  params = {}
47
47
  params.merge!(parse_list_options(options))
48
+ @dashboard_interface.setopts(options)
48
49
  if options[:dry_run]
49
50
  print_dry_run @dashboard_interface.dry.recent_activity(account_id, params)
50
51
  return
@@ -786,6 +786,7 @@ EOT
786
786
  payload.merge!(v_prompt)
787
787
 
788
788
  begin
789
+ @setup_interface.setopts(options)
789
790
  if options[:dry_run]
790
791
  print_dry_run @setup_interface.dry.init(payload)
791
792
  return
@@ -48,7 +48,7 @@ class Morpheus::Cli::Roles
48
48
 
49
49
  params = {}
50
50
  params.merge!(parse_list_options(options))
51
-
51
+ @roles_interface.setopts(options)
52
52
  if options[:dry_run]
53
53
  print_dry_run @roles_interface.dry.list(account_id, params), options
54
54
  return
@@ -125,6 +125,7 @@ class Morpheus::Cli::Roles
125
125
  begin
126
126
  account = find_account_from_options(options)
127
127
  account_id = account ? account['id'] : nil
128
+ @roles_interface.setopts(options)
128
129
  if options[:dry_run]
129
130
  if args[0].to_s =~ /\A\d{1,}\Z/
130
131
  print_dry_run @roles_interface.dry.get(account_id, args[0].to_i)
@@ -344,7 +345,7 @@ class Morpheus::Cli::Roles
344
345
  end
345
346
 
346
347
  payload = {role: role_payload}
347
-
348
+ @roles_interface.setopts(options)
348
349
  if options[:dry_run]
349
350
  print_dry_run @roles_interface.dry.create(account_id, payload)
350
351
  return
@@ -432,6 +433,7 @@ class Morpheus::Cli::Roles
432
433
  role_payload['multitenant'] = ['on','true'].include?(params['multitenant'].to_s)
433
434
  end
434
435
  payload = {role: role_payload}
436
+ @roles_interface.setopts(options)
435
437
  if options[:dry_run]
436
438
  print_dry_run @roles_interface.dry.update(account_id, role['id'], payload)
437
439
  return
@@ -481,6 +483,7 @@ class Morpheus::Cli::Roles
481
483
  unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the role #{role['authority']}?")
482
484
  exit
483
485
  end
486
+ @roles_interface.setopts(options)
484
487
  if options[:dry_run]
485
488
  print_dry_run @roles_interface.dry.destroy(account_id, role['id'])
486
489
  return
@@ -528,6 +531,7 @@ class Morpheus::Cli::Roles
528
531
  exit 1 if role.nil?
529
532
 
530
533
  params = {permissionCode: permission_code, access: access_value}
534
+ @roles_interface.setopts(options)
531
535
  if options[:dry_run]
532
536
  print_dry_run @roles_interface.dry.update_permission(account_id, role['id'], params)
533
537
  return
@@ -574,6 +578,7 @@ class Morpheus::Cli::Roles
574
578
  exit 1 if role.nil?
575
579
 
576
580
  params = {permissionCode: 'ComputeSite', access: access_value}
581
+ @roles_interface.setopts(options)
577
582
  if options[:dry_run]
578
583
  print_dry_run @roles_interface.dry.update_permission(account_id, role['id'], params)
579
584
  return
@@ -669,7 +674,7 @@ class Morpheus::Cli::Roles
669
674
  params['groupId'] = group_id
670
675
  end
671
676
  params['access'] = access_value
672
-
677
+ @roles_interface.setopts(options)
673
678
  if options[:dry_run]
674
679
  print_dry_run @roles_interface.dry.update_group(account_id, role['id'], params)
675
680
  return
@@ -721,6 +726,7 @@ class Morpheus::Cli::Roles
721
726
  exit 1 if role.nil?
722
727
 
723
728
  params = {permissionCode: 'ComputeZone', access: access_value}
729
+ @roles_interface.setopts(options)
724
730
  if options[:dry_run]
725
731
  print_dry_run @roles_interface.dry.update_permission(account_id, role['id'], params)
726
732
  return
@@ -831,6 +837,7 @@ class Morpheus::Cli::Roles
831
837
  params['cloudId'] = cloud_id
832
838
  end
833
839
  params['access'] = access_value
840
+ @roles_interface.setopts(options)
834
841
  if options[:dry_run]
835
842
  print_dry_run @roles_interface.dry.update_cloud(account_id, role['id'], params)
836
843
  return
@@ -883,6 +890,7 @@ class Morpheus::Cli::Roles
883
890
  exit 1 if role.nil?
884
891
 
885
892
  params = {permissionCode: 'InstanceType', access: access_value}
893
+ @roles_interface.setopts(options)
886
894
  if options[:dry_run]
887
895
  print_dry_run @roles_interface.dry.update_permission(account_id, role['id'], params)
888
896
  return
@@ -974,7 +982,7 @@ class Morpheus::Cli::Roles
974
982
  params['instanceTypeId'] = instance_type['id']
975
983
  end
976
984
  params['access'] = access_value
977
-
985
+ @roles_interface.setopts(options)
978
986
  if options[:dry_run]
979
987
  print_dry_run @roles_interface.dry.update_instance_type(account_id, role['id'], params)
980
988
  return
@@ -1027,6 +1035,7 @@ class Morpheus::Cli::Roles
1027
1035
  exit 1 if role.nil?
1028
1036
 
1029
1037
  params = {permissionCode: 'AppTemplate', access: access_value}
1038
+ @roles_interface.setopts(options)
1030
1039
  if options[:dry_run]
1031
1040
  print_dry_run @roles_interface.dry.update_permission(account_id, role['id'], params)
1032
1041
  return
@@ -1130,7 +1139,7 @@ class Morpheus::Cli::Roles
1130
1139
  # params['blueprintId'] = blueprint['id']
1131
1140
  end
1132
1141
  params['access'] = access_value
1133
-
1142
+ @roles_interface.setopts(options)
1134
1143
  if options[:dry_run]
1135
1144
  print_dry_run @roles_interface.dry.update_blueprint(account_id, role['id'], params)
1136
1145
  return
@@ -36,7 +36,7 @@ EOT
36
36
  opts.on( '-s', '--secgroup SECGROUP', "Security Group ID (Use will use security as set with 'security-groups use id'" ) do |id|
37
37
  security_group_id = id
38
38
  end
39
- build_common_options(opts, options, [:json, :dry_run])
39
+ build_common_options(opts, options, [:json, :dry_run, :remote])
40
40
  end
41
41
  optparse.parse!(args)
42
42
 
@@ -64,6 +64,7 @@ EOT
64
64
  }
65
65
  connect(options)
66
66
  begin
67
+ @security_group_rules_interface.setopts(options)
67
68
  if options[:dry_run]
68
69
  print_dry_run @security_group_rules_interface.dry.create(security_group_id, params)
69
70
  return
@@ -95,7 +96,7 @@ EOT
95
96
  opts.on( '-s', '--secgroup secgroup', "Security Group ID (Use will use security as set with 'security-groups use id'" ) do |id|
96
97
  security_group_id = id
97
98
  end
98
- build_common_options(opts, options, [:json, :dry_run])
99
+ build_common_options(opts, options, [:json, :dry_run, :remote])
99
100
  end
100
101
  optparse.parse!(args)
101
102
  if args.count < 2
@@ -119,6 +120,7 @@ EOT
119
120
  }
120
121
  connect(options)
121
122
  begin
123
+ @security_group_rules_interface.setopts(options)
122
124
  if options[:dry_run]
123
125
  print_dry_run @security_group_rules_interface.dry.create(security_group_id, params)
124
126
  return
@@ -141,7 +143,7 @@ EOT
141
143
  security_group_id = nil
142
144
  optparse = Morpheus::Cli::OptionParser.new do |opts|
143
145
  opts.banner = subcommand_usage("[id]")
144
- build_common_options(opts, options, [:json, :dry_run])
146
+ build_common_options(opts, options, [:json, :dry_run, :remote])
145
147
  end
146
148
  optparse.parse!(args)
147
149
  security_group_id = args[0]
@@ -156,6 +158,7 @@ EOT
156
158
  connect(options)
157
159
  begin
158
160
  params = {}
161
+ @security_group_rules_interface.setopts(options)
159
162
  if options[:dry_run]
160
163
  print_dry_run @security_group_rules_interface.dry.get(security_group_id, params)
161
164
  return
@@ -191,7 +194,7 @@ EOT
191
194
  opts.on( '-s', '--secgroup secgroup', "Security Group ID (Use will use security as set with 'security-groups use id'" ) do |id|
192
195
  security_group_id = id
193
196
  end
194
- build_common_options(opts, options, [:json, :dry_run])
197
+ build_common_options(opts, options, [:json, :dry_run, :remote])
195
198
  end
196
199
  optparse.parse!(args)
197
200
  if args.count < 1
@@ -208,6 +211,7 @@ EOT
208
211
  end
209
212
  connect(options)
210
213
  begin
214
+ @security_group_rules_interface.setopts(options)
211
215
  if options[:dry_run]
212
216
  print_dry_run @security_group_rules_interface.dry.delete(security_group_id, args[0])
213
217
  return
@@ -34,6 +34,7 @@ class Morpheus::Cli::SecurityGroups
34
34
  begin
35
35
  params = {}
36
36
  params.merge!(parse_list_options(options))
37
+ @security_groups_interface.setopts(options)
37
38
  if options[:dry_run]
38
39
  print_dry_run @security_groups_interface.dry.list(params)
39
40
  return
@@ -110,6 +111,7 @@ class Morpheus::Cli::SecurityGroups
110
111
  end
111
112
  connect(options)
112
113
  begin
114
+ @security_groups_interface.setopts(options)
113
115
  if options[:dry_run]
114
116
  print_dry_run @security_groups_interface.dry.get({id: args[0]})
115
117
  return
@@ -155,6 +157,7 @@ class Morpheus::Cli::SecurityGroups
155
157
  params[:securityGroup][:name] = args[0]
156
158
  connect(options)
157
159
  begin
160
+ @security_groups_interface.setopts(options)
158
161
  if options[:dry_run]
159
162
  print_dry_run @security_groups_interface.dry.create(params)
160
163
  return
@@ -191,6 +194,7 @@ class Morpheus::Cli::SecurityGroups
191
194
  puts "Security Group not found by id #{args[0]}"
192
195
  return
193
196
  end
197
+ @security_groups_interface.setopts(options)
194
198
  if options[:dry_run]
195
199
  print_dry_run @security_groups_interface.dry.delete(security_group['id'])
196
200
  return
@@ -90,7 +90,7 @@ class Morpheus::Cli::Shell
90
90
 
91
91
  def recalculate_auto_complete_commands
92
92
  @morpheus_commands = Morpheus::Cli::CliRegistry.all.keys.reject {|k| [:shell].include?(k) }
93
- @shell_commands = [:clear, :history, :reload!, :help, :exit]
93
+ @shell_commands = [:clear, :history, :reload, :help, :exit]
94
94
  @alias_commands = Morpheus::Cli::CliRegistry.all_aliases.keys
95
95
  @exploded_commands = []
96
96
  Morpheus::Cli::CliRegistry.all.each do |cmd, klass|
@@ -247,7 +247,7 @@ class Morpheus::Cli::Shell
247
247
  # logging is skipped for certain commands: exit, !, !!
248
248
  def execute(input)
249
249
  result = execute_commands_as_expression(input)
250
- unless input.strip.empty? || (["exit", "history"].include?(input.strip)) || input.strip[0].to_s.chr == "!"
250
+ unless input.strip.empty? || (["exit"].include?(input.strip)) || input.strip[0].to_s.chr == "!"
251
251
  log_history_command(input.strip)
252
252
  end
253
253
  return result
@@ -661,31 +661,25 @@ class Morpheus::Cli::Shell
661
661
  def log_history_command(cmd)
662
662
  @history ||= {}
663
663
  @last_command_number ||= 0
664
+ previous_cmd = @history[@last_command_number]
665
+ # skip logging consecutive history commands.
666
+ if previous_cmd && previous_cmd =~ /history/ && previous_cmd == cmd
667
+ return @last_command_number
668
+ end
664
669
  @last_command_number += 1
665
670
  @history[@last_command_number] = cmd
666
671
  if @history_logger
667
672
  @history_logger.info "#{@current_username}@#{@appliance_name} -- : (cmd #{@last_command_number}) #{cmd}"
668
673
  end
674
+ return @last_command_number
669
675
  end
670
676
 
671
677
  def last_command(n=25)
672
- return list_history_commands(max:1)[0]
673
- end
674
-
675
- # list the N most recent commands, sorted oldest -> newest
676
- # todo: support sort and order options..
677
- def list_history_commands(options={})
678
- history_records = []
679
- max = options[:max] ? options[:max].to_i : 25
680
- max = 50
681
- load_history_from_log_file if !@history
682
- cmd_numbers = @history.keys.last(max.to_i)
683
- history_records = cmd_numbers.collect { |cmd_number| {command_number: cmd_number, command: @history[cmd_number]} }
684
- last_cmd = cmd_numbers.last ? @history[cmd_numbers.last] : nil
685
- # if input != last_cmd # no consecutive
686
- # log_history_command(input)
687
- # end
688
- return history_records
678
+ if @history && @last_command_number
679
+ @history[@last_command_number]
680
+ else
681
+ nil
682
+ end
689
683
  end
690
684
 
691
685
  def print_history(n)
@@ -703,10 +697,6 @@ class Morpheus::Cli::Shell
703
697
  puts "#{cmd_number.to_s.rjust(3, ' ')} #{cmd}"
704
698
  end
705
699
  print reset
706
- #last_cmd = cmd_numbers.last ? @history[cmd_numbers.last] : nil
707
- # if input != last_cmd # no consecutive
708
- # log_history_command(input)
709
- # end
710
700
  return 0
711
701
  end
712
702
 
@@ -57,6 +57,7 @@ class Morpheus::Cli::StorageProvidersCommand
57
57
  connect(options)
58
58
  begin
59
59
  params.merge!(parse_list_options(options))
60
+ @storage_providers_interface.setopts(options)
60
61
  if options[:dry_run]
61
62
  print_dry_run @storage_providers_interface.dry.list(params)
62
63
  return
@@ -126,6 +127,7 @@ class Morpheus::Cli::StorageProvidersCommand
126
127
  end
127
128
  connect(options)
128
129
  begin
130
+ @storage_providers_interface.setopts(options)
129
131
  if options[:dry_run]
130
132
  if args[0].to_s =~ /\A\d{1,}\Z/
131
133
  print_dry_run @storage_providers_interface.dry.get(args[0].to_i)
@@ -371,7 +373,7 @@ class Morpheus::Cli::StorageProvidersCommand
371
373
  end
372
374
  end
373
375
 
374
-
376
+ @storage_providers_interface.setopts(options)
375
377
  if options[:dry_run]
376
378
  print_dry_run @storage_providers_interface.dry.create(payload)
377
379
  return
@@ -482,7 +484,7 @@ class Morpheus::Cli::StorageProvidersCommand
482
484
  payload['storageBucket']['createBucket'] = true
483
485
  end
484
486
  end
485
-
487
+ @storage_providers_interface.setopts(options)
486
488
  if options[:dry_run]
487
489
  print_dry_run @storage_providers_interface.dry.update(storage_provider["id"], payload)
488
490
  return
@@ -526,6 +528,7 @@ class Morpheus::Cli::StorageProvidersCommand
526
528
  unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the storage bucket: #{storage_provider['name']}?")
527
529
  return 9, "aborted command"
528
530
  end
531
+ @storage_providers_interface.setopts(options)
529
532
  if options[:dry_run]
530
533
  print_dry_run @storage_providers_interface.dry.destroy(storage_provider['id'])
531
534
  return 0
@@ -571,6 +574,7 @@ class Morpheus::Cli::StorageProvidersCommand
571
574
  [:fullTree].each do |k|
572
575
  params[k] = options[k] unless options[k].nil?
573
576
  end
577
+ @storage_providers_interface.setopts(options)
574
578
  if options[:dry_run]
575
579
  print_dry_run @storage_providers_interface.dry.list_files(storage_provider['id'], search_file_path, params)
576
580
  return
@@ -667,6 +671,7 @@ class Morpheus::Cli::StorageProvidersCommand
667
671
  [:fullTree].each do |k|
668
672
  params[k] = options[k] unless options[k].nil?
669
673
  end
674
+ @storage_providers_interface.setopts(options)
670
675
  if options[:dry_run]
671
676
  print_dry_run @storage_providers_interface.dry.list_files(storage_provider['id'], search_file_path, params)
672
677
  return 0
@@ -911,7 +916,7 @@ class Morpheus::Cli::StorageProvidersCommand
911
916
  destination = file.sub(local_file_path, (remote_file_path || "")).squeeze('/')
912
917
  upload_file_list << {file: file, destination: destination}
913
918
  end
914
-
919
+ @storage_providers_interface.setopts(options)
915
920
  if options[:dry_run]
916
921
  # print_h1 "DRY RUN"
917
922
  print "\n",cyan, bold, "Uploading #{upload_file_list.size} Files...", reset, "\n"
@@ -973,7 +978,7 @@ class Morpheus::Cli::StorageProvidersCommand
973
978
  unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to upload #{local_file_path} to #{storage_provider['name']}:#{destination}?")
974
979
  return 9, "aborted command"
975
980
  end
976
-
981
+ @storage_providers_interface.setopts(options)
977
982
  if options[:dry_run]
978
983
  #print cyan,bold, " - Uploading #{file} to #{storage_provider_id}:#{destination} DRY RUN", reset, "\n"
979
984
  # print_h1 "DRY RUN"
@@ -1078,6 +1083,7 @@ class Morpheus::Cli::StorageProvidersCommand
1078
1083
  end
1079
1084
  end
1080
1085
  begin
1086
+ @storage_providers_interface.setopts(options)
1081
1087
  if options[:dry_run]
1082
1088
  print_dry_run @storage_providers_interface.dry.download_file_chunked(storage_provider['id'], file_path, outfile), full_command_string
1083
1089
  return 0
@@ -1150,7 +1156,7 @@ class Morpheus::Cli::StorageProvidersCommand
1150
1156
  return 1 if storage_provider.nil?
1151
1157
 
1152
1158
  file_path = file_path.squeeze('/')
1153
-
1159
+ @storage_providers_interface.setopts(options)
1154
1160
  if options[:dry_run]
1155
1161
  print_dry_run @storage_providers_interface.dry.download_file(storage_provider['id'], file_path), full_command_string
1156
1162
  return 1
@@ -1204,7 +1210,7 @@ class Morpheus::Cli::StorageProvidersCommand
1204
1210
  return 9, "aborted command"
1205
1211
  end
1206
1212
  end
1207
-
1213
+ @storage_providers_interface.setopts(options)
1208
1214
  if options[:dry_run]
1209
1215
  print_dry_run @storage_files_interface.dry.destroy(storage_file['id'], query_params)
1210
1216
  return 0