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
@@ -22,7 +22,7 @@ class Morpheus::Cli::MonitoringContactsCommand
22
22
 
23
23
  def connect(opts)
24
24
  @api_client = establish_remote_appliance_connection(opts)
25
- @monitoring_interface = Morpheus::APIClient.new(@access_token,nil,nil, @appliance_url).monitoring
25
+ @monitoring_contacts_interface = Morpheus::APIClient.new(@access_token,nil,nil, @appliance_url).monitoring.contacts
26
26
  end
27
27
 
28
28
  def handle(args)
@@ -43,13 +43,13 @@ class Morpheus::Cli::MonitoringContactsCommand
43
43
  params[k] = options[k] unless options[k].nil?
44
44
  end
45
45
  # JD: lastUpdated 500ing, contacts don't have that property ? =o Fix it!
46
-
46
+ @monitoring_contacts_interface.setopts(options)
47
47
  if options[:dry_run]
48
- print_dry_run @monitoring_interface.contacts.dry.list(params)
48
+ print_dry_run @monitoring_contacts_interface.dry.list(params)
49
49
  return
50
50
  end
51
51
 
52
- json_response = @monitoring_interface.contacts.list(params)
52
+ json_response = @monitoring_contacts_interface.list(params)
53
53
  if options[:json]
54
54
  puts as_json(json_response, options, "contacts")
55
55
  return 0
@@ -108,11 +108,12 @@ class Morpheus::Cli::MonitoringContactsCommand
108
108
 
109
109
  begin
110
110
  contact = find_contact_by_name_or_id(id)
111
+ @monitoring_contacts_interface.setopts(options)
111
112
  if options[:dry_run]
112
- print_dry_run @monitoring_interface.contacts.dry.get(contact['id'])
113
+ print_dry_run @monitoring_contacts_interface.dry.get(contact['id'])
113
114
  return
114
115
  end
115
- json_response = @monitoring_interface.contacts.get(contact['id'])
116
+ json_response = @monitoring_contacts_interface.get(contact['id'])
116
117
  contact = json_response['contact']
117
118
 
118
119
  if options[:json]
@@ -183,13 +184,13 @@ class Morpheus::Cli::MonitoringContactsCommand
183
184
  'contact' => {}
184
185
  }
185
186
  payload['contact'].merge!(params)
186
-
187
+ @monitoring_contacts_interface.setopts(options)
187
188
  if options[:dry_run]
188
- print_dry_run @monitoring_interface.contacts.dry.create(payload)
189
+ print_dry_run @monitoring_contacts_interface.dry.create(payload)
189
190
  return
190
191
  end
191
192
 
192
- json_response = @monitoring_interface.contacts.create(payload)
193
+ json_response = @monitoring_contacts_interface.create(payload)
193
194
  contact = json_response['contact']
194
195
  if options[:json]
195
196
  puts as_json(json_response, options)
@@ -243,13 +244,13 @@ class Morpheus::Cli::MonitoringContactsCommand
243
244
  'contact' => {id: contact["id"]}
244
245
  }
245
246
  payload['contact'].merge!(params)
246
-
247
+ @monitoring_contacts_interface.setopts(options)
247
248
  if options[:dry_run]
248
- print_dry_run @monitoring_interface.contacts.dry.update(contact["id"], payload)
249
+ print_dry_run @monitoring_contacts_interface.dry.update(contact["id"], payload)
249
250
  return
250
251
  end
251
252
 
252
- json_response = @monitoring_interface.contacts.update(contact["id"], payload)
253
+ json_response = @monitoring_contacts_interface.update(contact["id"], payload)
253
254
  if options[:json]
254
255
  puts as_json(json_response, options)
255
256
  elsif !options[:quiet]
@@ -289,11 +290,12 @@ class Morpheus::Cli::MonitoringContactsCommand
289
290
 
290
291
  begin
291
292
  contact = find_contact_by_name_or_id(id)
293
+ @monitoring_contacts_interface.setopts(options)
292
294
  if options[:dry_run]
293
- print_dry_run @monitoring_interface.contacts.dry.destroy(contact['id'])
295
+ print_dry_run @monitoring_contacts_interface.dry.destroy(contact['id'])
294
296
  return
295
297
  end
296
- json_response = @monitoring_interface.contacts.destroy(contact['id'])
298
+ json_response = @monitoring_contacts_interface.destroy(contact['id'])
297
299
  if options[:json]
298
300
  puts as_json(json_response, options)
299
301
  elsif !options[:quiet]
@@ -335,11 +337,12 @@ class Morpheus::Cli::MonitoringContactsCommand
335
337
  print bold,yellow,"contact #{contact['id']} is already open",reset,"\n"
336
338
  return false
337
339
  end
340
+ @monitoring_contacts_interface.setopts(options)
338
341
  if options[:dry_run]
339
- print_dry_run @monitoring_interface.contacts.dry.reopen(contact['id'])
342
+ print_dry_run @monitoring_contacts_interface.dry.reopen(contact['id'])
340
343
  return
341
344
  end
342
- json_response = @monitoring_interface.contacts.reopen(contact['id'])
345
+ json_response = @monitoring_contacts_interface.reopen(contact['id'])
343
346
  if options[:json]
344
347
  print JSON.pretty_generate(json_response)
345
348
  print "\n"
@@ -13,7 +13,7 @@ class Morpheus::Cli::MonitoringGroupsCommand
13
13
 
14
14
  def connect(opts)
15
15
  @api_client = establish_remote_appliance_connection(opts)
16
- @monitoring_interface = Morpheus::APIClient.new(@access_token,nil,nil, @appliance_url).monitoring
16
+ @monitoring_groups_interface = Morpheus::APIClient.new(@access_token,nil,nil, @appliance_url).monitoring.groups
17
17
  end
18
18
 
19
19
  def handle(args)
@@ -35,13 +35,13 @@ class Morpheus::Cli::MonitoringGroupsCommand
35
35
  begin
36
36
  # construct payload
37
37
  params.merge!(parse_list_options(options))
38
-
38
+ @monitoring_groups_interface.setopts(options)
39
39
  if options[:dry_run]
40
- print_dry_run @monitoring_interface.groups.dry.list(params)
40
+ print_dry_run @monitoring_groups_interface.dry.list(params)
41
41
  return
42
42
  end
43
43
 
44
- json_response = @monitoring_interface.groups.list(params)
44
+ json_response = @monitoring_groups_interface.list(params)
45
45
 
46
46
  if options[:json]
47
47
  puts as_json(json_response, options, "checkGroups")
@@ -100,12 +100,12 @@ class Morpheus::Cli::MonitoringGroupsCommand
100
100
 
101
101
  begin
102
102
  check_group = find_check_group_by_name_or_id(id)
103
-
103
+ @monitoring_groups_interface.setopts(options)
104
104
  if options[:dry_run]
105
- print_dry_run @monitoring_interface.groups.dry.get(check_group['id'])
105
+ print_dry_run @monitoring_groups_interface.dry.get(check_group['id'])
106
106
  return
107
107
  end
108
- json_response = @monitoring_interface.groups.get(check_group['id'])
108
+ json_response = @monitoring_groups_interface.get(check_group['id'])
109
109
  check_group = json_response['checkGroup']
110
110
  if options[:json]
111
111
  puts as_json(json_response, options, "checkGroup")
@@ -166,7 +166,7 @@ class Morpheus::Cli::MonitoringGroupsCommand
166
166
  if options[:show_history]
167
167
  # history_items = json_response["history"]
168
168
  # gotta go get it
169
- history_json_response = @monitoring_interface.groups.history(check_group["id"], {})
169
+ history_json_response = @monitoring_groups_interface.history(check_group["id"], {})
170
170
  history_items = history_json_response["history"] || history_json_response["events"] || history_json_response["issues"]
171
171
  issues = history_items
172
172
  if history_items && !history_items.empty?
@@ -217,13 +217,13 @@ class Morpheus::Cli::MonitoringGroupsCommand
217
217
 
218
218
  # construct payload
219
219
  params.merge!(parse_list_options(options))
220
-
220
+ @monitoring_groups_interface.setopts(options)
221
221
  if options[:dry_run]
222
- print_dry_run @monitoring_interface.groups.dry.history(check_group['id'], params)
222
+ print_dry_run @monitoring_groups_interface.dry.history(check_group['id'], params)
223
223
  return
224
224
  end
225
225
 
226
- json_response = @monitoring_interface.groups.history(check_group['id'], params)
226
+ json_response = @monitoring_groups_interface.history(check_group['id'], params)
227
227
  if options[:json]
228
228
  puts as_json(json_response, options, "history")
229
229
  return 0
@@ -308,11 +308,12 @@ class Morpheus::Cli::MonitoringGroupsCommand
308
308
  # todo: prompt?
309
309
  payload = {'checkGroup' => params}
310
310
  end
311
+ @monitoring_groups_interface.setopts(options)
311
312
  if options[:dry_run]
312
- print_dry_run @monitoring_interface.groups.dry.create(payload)
313
+ print_dry_run @monitoring_groups_interface.dry.create(payload)
313
314
  return
314
315
  end
315
- json_response = @monitoring_interface.groups.create(payload)
316
+ json_response = @monitoring_groups_interface.create(payload)
316
317
  if options[:json]
317
318
  puts as_json(json_response, options)
318
319
  elsif !options[:quiet]
@@ -381,11 +382,12 @@ class Morpheus::Cli::MonitoringGroupsCommand
381
382
  # todo: prompt?
382
383
  payload = {'checkGroup' => params}
383
384
  end
385
+ @monitoring_groups_interface.setopts(options)
384
386
  if options[:dry_run]
385
- print_dry_run @monitoring_interface.groups.dry.update(check_group["id"], payload)
387
+ print_dry_run @monitoring_groups_interface.dry.update(check_group["id"], payload)
386
388
  return
387
389
  end
388
- json_response = @monitoring_interface.groups.update(check_group["id"], payload)
390
+ json_response = @monitoring_groups_interface.update(check_group["id"], payload)
389
391
  if options[:json]
390
392
  puts as_json(json_response, options)
391
393
  elsif !options[:quiet]
@@ -426,11 +428,12 @@ class Morpheus::Cli::MonitoringGroupsCommand
426
428
  else
427
429
  payload = params
428
430
  end
431
+ @monitoring_groups_interface.setopts(options)
429
432
  if options[:dry_run]
430
- print_dry_run @monitoring_interface.groups.dry.quarantine(check_group["id"], payload)
433
+ print_dry_run @monitoring_groups_interface.dry.quarantine(check_group["id"], payload)
431
434
  return 0
432
435
  end
433
- json_response = @monitoring_interface.groups.quarantine(check_group["id"], payload)
436
+ json_response = @monitoring_groups_interface.quarantine(check_group["id"], payload)
434
437
  if options[:json]
435
438
  puts as_json(json_response, options)
436
439
  elsif !options[:quiet]
@@ -473,11 +476,12 @@ class Morpheus::Cli::MonitoringGroupsCommand
473
476
  else
474
477
  payload = params
475
478
  end
479
+ @monitoring_groups_interface.setopts(options)
476
480
  if options[:dry_run]
477
- print_dry_run @monitoring_interface.groups.dry.quarantine(check_group["id"], payload)
481
+ print_dry_run @monitoring_groups_interface.dry.quarantine(check_group["id"], payload)
478
482
  return 0
479
483
  end
480
- json_response = @monitoring_interface.groups.quarantine(check_group["id"], payload)
484
+ json_response = @monitoring_groups_interface.quarantine(check_group["id"], payload)
481
485
  if options[:json]
482
486
  puts as_json(json_response, options)
483
487
  elsif !options[:quiet]
@@ -516,11 +520,12 @@ class Morpheus::Cli::MonitoringGroupsCommand
516
520
  else
517
521
  payload = params
518
522
  end
523
+ @monitoring_groups_interface.setopts(options)
519
524
  if options[:dry_run]
520
- print_dry_run @monitoring_interface.groups.dry.quarantine_all(payload)
525
+ print_dry_run @monitoring_groups_interface.dry.quarantine_all(payload)
521
526
  return 0
522
527
  end
523
- json_response = @monitoring_interface.groups.quarantine_all(payload)
528
+ json_response = @monitoring_groups_interface.quarantine_all(payload)
524
529
  if options[:json]
525
530
  puts as_json(json_response, options)
526
531
  elsif !options[:quiet]
@@ -561,11 +566,12 @@ class Morpheus::Cli::MonitoringGroupsCommand
561
566
  else
562
567
  payload = params
563
568
  end
569
+ @monitoring_groups_interface.setopts(options)
564
570
  if options[:dry_run]
565
- print_dry_run @monitoring_interface.groups.dry.quarantine_all(payload)
571
+ print_dry_run @monitoring_groups_interface.dry.quarantine_all(payload)
566
572
  return 0
567
573
  end
568
- json_response = @monitoring_interface.groups.quarantine_all(payload)
574
+ json_response = @monitoring_groups_interface.quarantine_all(payload)
569
575
  if options[:json]
570
576
  puts as_json(json_response, options)
571
577
  elsif !options[:quiet]
@@ -605,13 +611,13 @@ class Morpheus::Cli::MonitoringGroupsCommand
605
611
  # }
606
612
  # payload['checkGroup'].merge!(check_group)
607
613
  payload = params
608
-
614
+ @monitoring_groups_interface.setopts(options)
609
615
  if options[:dry_run]
610
- print_dry_run @monitoring_interface.groups.dry.destroy(check_group["id"])
616
+ print_dry_run @monitoring_groups_interface.dry.destroy(check_group["id"])
611
617
  return
612
618
  end
613
619
 
614
- json_response = @monitoring_interface.groups.destroy(check_group["id"])
620
+ json_response = @monitoring_groups_interface.destroy(check_group["id"])
615
621
  if options[:json]
616
622
  puts as_json(json_response, options)
617
623
  elsif !options[:quiet]
@@ -12,7 +12,7 @@ class Morpheus::Cli::MonitoringIncidentsCommand
12
12
 
13
13
  def connect(opts)
14
14
  @api_client = establish_remote_appliance_connection(opts)
15
- @monitoring_interface = Morpheus::APIClient.new(@access_token,nil,nil, @appliance_url).monitoring
15
+ @monitoring_incidents_interface = Morpheus::APIClient.new(@access_token,nil,nil, @appliance_url).monitoring.incidents
16
16
  end
17
17
 
18
18
  def handle(args)
@@ -36,11 +36,12 @@ class Morpheus::Cli::MonitoringIncidentsCommand
36
36
  connect(options)
37
37
  begin
38
38
  params.merge!(parse_list_options(options))
39
+ @monitoring_incidents_interface.setopts(options)
39
40
  if options[:dry_run]
40
- print_dry_run @monitoring_interface.incidents.dry.list(params)
41
+ print_dry_run @monitoring_incidents_interface.dry.list(params)
41
42
  return
42
43
  end
43
- json_response = @monitoring_interface.incidents.list(params)
44
+ json_response = @monitoring_incidents_interface.list(params)
44
45
  if options[:json]
45
46
  puts as_json(json_response, options, "incidents")
46
47
  return 0
@@ -94,11 +95,12 @@ class Morpheus::Cli::MonitoringIncidentsCommand
94
95
  begin
95
96
  params = {}
96
97
  params.merge!(parse_list_options(options))
98
+ @monitoring_incidents_interface.setopts(options)
97
99
  if options[:dry_run]
98
- print_dry_run @monitoring_interface.incidents.dry.stats(params)
100
+ print_dry_run @monitoring_incidents_interface.dry.stats(params)
99
101
  return
100
102
  end
101
- json_response = @monitoring_interface.incidents.stats(params)
103
+ json_response = @monitoring_incidents_interface.stats(params)
102
104
  if options[:json]
103
105
  puts as_json(json_response, options, "openIncidents")
104
106
  return 0
@@ -185,11 +187,12 @@ class Morpheus::Cli::MonitoringIncidentsCommand
185
187
 
186
188
  begin
187
189
  incident = find_incident_by_id(id)
190
+ @monitoring_incidents_interface.setopts(options)
188
191
  if options[:dry_run]
189
- print_dry_run @monitoring_interface.incidents.dry.get(incident['id'])
192
+ print_dry_run @monitoring_incidents_interface.dry.get(incident['id'])
190
193
  return
191
194
  end
192
- json_response = @monitoring_interface.incidents.get(incident['id'])
195
+ json_response = @monitoring_incidents_interface.get(incident['id'])
193
196
  incident = json_response['incident']
194
197
 
195
198
  if options[:json]
@@ -242,7 +245,7 @@ class Morpheus::Cli::MonitoringIncidentsCommand
242
245
  if options[:show_history]
243
246
  # history_items = json_response["history"]
244
247
  # gotta go get it
245
- history_json_response = @monitoring_interface.incidents.history(incident["id"], {})
248
+ history_json_response = @monitoring_incidents_interface.history(incident["id"], {})
246
249
  history_items = history_json_response["history"] || history_json_response["events"] || history_json_response["issues"]
247
250
  issues = history_items
248
251
  if history_items && !history_items.empty?
@@ -259,7 +262,7 @@ class Morpheus::Cli::MonitoringIncidentsCommand
259
262
  if options[:show_notifications]
260
263
  # history_items = json_response["history"]
261
264
  # gotta go get it
262
- notifications_json_response = @monitoring_interface.incidents.notifications(incident["id"], {max: 10})
265
+ notifications_json_response = @monitoring_incidents_interface.notifications(incident["id"], {max: 10})
263
266
  notification_items = notifications_json_response["notifications"]
264
267
  if notification_items && notification_items.empty?
265
268
  print_h2 "Notifications"
@@ -300,13 +303,13 @@ class Morpheus::Cli::MonitoringIncidentsCommand
300
303
  return 1 if incident.nil?
301
304
 
302
305
  params.merge!(parse_list_options(options))
303
-
306
+ @monitoring_incidents_interface.setopts(options)
304
307
  if options[:dry_run]
305
- print_dry_run @monitoring_interface.incidents.dry.history(incident['id'], params)
308
+ print_dry_run @monitoring_incidents_interface.dry.history(incident['id'], params)
306
309
  return
307
310
  end
308
311
 
309
- json_response = @monitoring_interface.incidents.history(incident['id'], params)
312
+ json_response = @monitoring_incidents_interface.history(incident['id'], params)
310
313
  if options[:json]
311
314
  puts as_json(json_response, options, "history")
312
315
  return 0
@@ -352,13 +355,13 @@ class Morpheus::Cli::MonitoringIncidentsCommand
352
355
  # return false if incident.nil?
353
356
  params = {}
354
357
  params.merge!(parse_list_options(options))
355
-
358
+ @monitoring_incidents_interface.setopts(options)
356
359
  if options[:dry_run]
357
- print_dry_run @monitoring_interface.incidents.dry.notifications(incident['id'], params)
360
+ print_dry_run @monitoring_incidents_interface.dry.notifications(incident['id'], params)
358
361
  return
359
362
  end
360
363
 
361
- json_response = @monitoring_interface.incidents.notifications(incident['id'], params)
364
+ json_response = @monitoring_incidents_interface.notifications(incident['id'], params)
362
365
  if options[:json]
363
366
  puts as_json(json_response, options, "notifications")
364
367
  return 0
@@ -452,13 +455,13 @@ class Morpheus::Cli::MonitoringIncidentsCommand
452
455
  'incident' => {id: incident["id"]}
453
456
  }
454
457
  payload['incident'].merge!(params)
455
-
458
+ @monitoring_incidents_interface.setopts(options)
456
459
  if options[:dry_run]
457
- print_dry_run @monitoring_interface.incidents.dry.update(incident["id"], payload)
460
+ print_dry_run @monitoring_incidents_interface.dry.update(incident["id"], payload)
458
461
  return
459
462
  end
460
463
 
461
- json_response = @monitoring_interface.incidents.update(incident["id"], payload)
464
+ json_response = @monitoring_incidents_interface.update(incident["id"], payload)
462
465
  if options[:json]
463
466
  puts as_json(json_response, options)
464
467
  elsif !options[:quiet]
@@ -500,11 +503,12 @@ class Morpheus::Cli::MonitoringIncidentsCommand
500
503
  else
501
504
  payload = params
502
505
  end
506
+ @monitoring_incidents_interface.setopts(options)
503
507
  if options[:dry_run]
504
- print_dry_run @monitoring_interface.incidents.dry.quarantine(incident["id"], payload)
508
+ print_dry_run @monitoring_incidents_interface.dry.quarantine(incident["id"], payload)
505
509
  return 0
506
510
  end
507
- json_response = @monitoring_interface.incidents.quarantine(incident["id"], payload)
511
+ json_response = @monitoring_incidents_interface.quarantine(incident["id"], payload)
508
512
  if options[:json]
509
513
  puts as_json(json_response, options)
510
514
  elsif !options[:quiet]
@@ -547,11 +551,12 @@ class Morpheus::Cli::MonitoringIncidentsCommand
547
551
  else
548
552
  payload = params
549
553
  end
554
+ @monitoring_incidents_interface.setopts(options)
550
555
  if options[:dry_run]
551
- print_dry_run @monitoring_interface.incidents.dry.quarantine(incident["id"], payload)
556
+ print_dry_run @monitoring_incidents_interface.dry.quarantine(incident["id"], payload)
552
557
  return 0
553
558
  end
554
- json_response = @monitoring_interface.incidents.quarantine(incident["id"], payload)
559
+ json_response = @monitoring_incidents_interface.quarantine(incident["id"], payload)
555
560
  if options[:json]
556
561
  puts as_json(json_response, options)
557
562
  elsif !options[:quiet]
@@ -590,11 +595,12 @@ class Morpheus::Cli::MonitoringIncidentsCommand
590
595
  else
591
596
  payload = params
592
597
  end
598
+ @monitoring_incidents_interface.setopts(options)
593
599
  if options[:dry_run]
594
- print_dry_run @monitoring_interface.incidents.dry.quarantine_all(payload)
600
+ print_dry_run @monitoring_incidents_interface.dry.quarantine_all(payload)
595
601
  return 0
596
602
  end
597
- json_response = @monitoring_interface.incidents.quarantine_all(payload)
603
+ json_response = @monitoring_incidents_interface.quarantine_all(payload)
598
604
  if options[:json]
599
605
  puts as_json(json_response, options)
600
606
  elsif !options[:quiet]
@@ -635,11 +641,12 @@ class Morpheus::Cli::MonitoringIncidentsCommand
635
641
  else
636
642
  payload = params
637
643
  end
644
+ @monitoring_incidents_interface.setopts(options)
638
645
  if options[:dry_run]
639
- print_dry_run @monitoring_interface.incidents.dry.quarantine_all(payload)
646
+ print_dry_run @monitoring_incidents_interface.dry.quarantine_all(payload)
640
647
  return 0
641
648
  end
642
- json_response = @monitoring_interface.incidents.quarantine_all(payload)
649
+ json_response = @monitoring_incidents_interface.quarantine_all(payload)
643
650
  if options[:json]
644
651
  puts as_json(json_response, options)
645
652
  elsif !options[:quiet]
@@ -679,11 +686,12 @@ class Morpheus::Cli::MonitoringIncidentsCommand
679
686
  begin
680
687
  incident = find_incident_by_id(id)
681
688
  already_closed = incident['status'] == 'closed'
689
+ @monitoring_incidents_interface.setopts(options)
682
690
  if options[:dry_run]
683
- print_dry_run @monitoring_interface.incidents.dry.close(incident['id'])
691
+ print_dry_run @monitoring_incidents_interface.dry.close(incident['id'])
684
692
  return
685
693
  end
686
- json_response = @monitoring_interface.incidents.close(incident['id'])
694
+ json_response = @monitoring_incidents_interface.close(incident['id'])
687
695
  if options[:json]
688
696
  print JSON.pretty_generate(json_response)
689
697
  print "\n"
@@ -727,11 +735,12 @@ class Morpheus::Cli::MonitoringIncidentsCommand
727
735
  print bold,yellow,"Incident #{incident['id']} is already open",reset,"\n"
728
736
  return false
729
737
  end
738
+ @monitoring_incidents_interface.setopts(options)
730
739
  if options[:dry_run]
731
- print_dry_run @monitoring_interface.incidents.dry.reopen(incident['id'])
740
+ print_dry_run @monitoring_incidents_interface.dry.reopen(incident['id'])
732
741
  return
733
742
  end
734
- json_response = @monitoring_interface.incidents.reopen(incident['id'])
743
+ json_response = @monitoring_incidents_interface.reopen(incident['id'])
735
744
  if options[:json]
736
745
  print JSON.pretty_generate(json_response)
737
746
  print "\n"