Class: Morpheus::MonitoringIncidentsInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::MonitoringIncidentsInterface
show all
- Defined in:
- lib/morpheus/api/monitoring_incidents_interface.rb
Instance Method Summary
collapse
-
#close(id) ⇒ Object
-
#create(options) ⇒ Object
-
#destroy(id, payload = {}) ⇒ Object
-
#events(id, params = {}) ⇒ Object
-
#get(id, params = {}) ⇒ Object
-
#history(id, params = {}) ⇒ Object
-
#initialize(access_token, refresh_token, expires_at = nil, base_url = nil) ⇒ MonitoringIncidentsInterface
constructor
A new instance of MonitoringIncidentsInterface.
-
#list(params = {}) ⇒ Object
-
#notifications(id, params = {}) ⇒ Object
-
#quarantine(id, options = {}) ⇒ Object
-
#quarantine_all(payload = {}) ⇒ Object
-
#reopen(id, options = {}) ⇒ Object
-
#stats(params = {}) ⇒ Object
-
#update(id, options) ⇒ Object
Methods inherited from APIClient
#account_groups, #accounts, #app_templates, #apps, #archive_buckets, #archive_files, #auth, #blueprints, #cloud_datastores, #cloud_policies, #clouds, #containers, #custom_instance_types, #cypher, #dashboard, #deploy, #deployments, #dry, #dry_run, #execute, #execute_schedules, #execution_request, #file_copy_request, #group_policies, #groups, #image_builder, #instance_types, #instances, #key_pairs, #library_container_scripts, #library_container_templates, #library_container_types, #library_container_upgrades, #library_instance_types, #library_layouts, #license, #load_balancers, #logs, #monitoring, #network_domains, #network_groups, #network_pool_servers, #network_pools, #network_proxies, #network_services, #networks, #option_type_lists, #option_types, #options, #packages, #policies, #power_schedules, #processes, #provision_types, #roles, #security_group_rules, #security_groups, #servers, #set_ssl_verification_enabled, #setup, #ssl_verification_enabled?, #storage_providers, #task_sets, #tasks, #user_groups, #user_settings, #user_sources, #users, #virtual_images, #whoami
Constructor Details
#initialize(access_token, refresh_token, expires_at = nil, base_url = nil) ⇒ MonitoringIncidentsInterface
Returns a new instance of MonitoringIncidentsInterface.
4
5
6
7
8
9
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 4
def initialize(access_token, refresh_token,expires_at = nil, base_url=nil)
@access_token = access_token
@refresh_token = refresh_token
@base_url = base_url
@expires_at = expires_at
end
|
Instance Method Details
#close(id) ⇒ Object
56
57
58
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 56
def close(id)
destroy(id)
end
|
#create(options) ⇒ Object
33
34
35
36
37
38
39
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 33
def create(options)
url = "#{@base_url}/api/monitoring/incidents"
= { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
payload = options
opts = {method: :post, url: url, headers: , payload: payload.to_json}
execute(opts)
end
|
#destroy(id, payload = {}) ⇒ Object
49
50
51
52
53
54
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 49
def destroy(id, payload={})
url = "#{@base_url}/api/monitoring/incidents/#{id}"
= { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
opts = {method: :delete, url: url, headers: , payload: payload.to_json}
execute(opts)
end
|
#events(id, params = {}) ⇒ Object
96
97
98
99
100
101
102
103
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 96
def events(id, params={})
url = "#{@base_url}/api/monitoring/incident-events/#{id}"
= { params: params, authorization: "Bearer #{@access_token}" }
opts = {method: :get, url: url, headers: }
execute(opts)
end
|
#get(id, params = {}) ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 11
def get(id, params={})
raise "#{self.class}.get() passed a blank id!" if id.to_s == ''
url = "#{@base_url}/api/monitoring/incidents/#{id}"
= { params: params, authorization: "Bearer #{@access_token}" }
opts = {method: :get, url: url, headers: }
execute(opts)
end
|
#history(id, params = {}) ⇒ Object
82
83
84
85
86
87
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 82
def history(id, params={})
url = "#{@base_url}/api/monitoring/incidents/#{id}/history"
= { params: params, authorization: "Bearer #{@access_token}" }
opts = {method: :get, url: url, headers: }
execute(opts)
end
|
#list(params = {}) ⇒ Object
19
20
21
22
23
24
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 19
def list(params={})
url = "#{@base_url}/api/monitoring/incidents"
= { params: params, authorization: "Bearer #{@access_token}" }
opts = {method: :get, url: url, headers: }
execute(opts)
end
|
#notifications(id, params = {}) ⇒ Object
89
90
91
92
93
94
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 89
def notifications(id, params={})
url = "#{@base_url}/api/monitoring/incidents/#{id}/notifications"
= { params: params, authorization: "Bearer #{@access_token}" }
opts = {method: :get, url: url, headers: }
execute(opts)
end
|
#quarantine(id, options = {}) ⇒ Object
67
68
69
70
71
72
73
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 67
def quarantine(id, options={})
url = "#{@base_url}/api/monitoring/incidents/#{id}/quarantine"
= { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
payload = options
opts = {method: :put, url: url, headers: , payload: payload.to_json}
execute(opts)
end
|
#quarantine_all(payload = {}) ⇒ Object
75
76
77
78
79
80
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 75
def quarantine_all(payload={})
url = "#{@base_url}/api/monitoring/incidents/quarantine-all"
= { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
opts = {method: :put, url: url, headers: , payload: payload.to_json}
execute(opts)
end
|
#reopen(id, options = {}) ⇒ Object
60
61
62
63
64
65
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 60
def reopen(id, options={})
url = "#{@base_url}/api/monitoring/incidents/#{id}/reopen"
= { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
opts = {method: :put, url: url, headers: , payload: options.to_json}
execute(opts)
end
|
#stats(params = {}) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 26
def stats(params={})
url = "#{@base_url}/api/monitoring/incidents/stats"
= { params: params, authorization: "Bearer #{@access_token}" }
opts = {method: :get, url: url, headers: }
execute(opts)
end
|
#update(id, options) ⇒ Object
41
42
43
44
45
46
47
|
# File 'lib/morpheus/api/monitoring_incidents_interface.rb', line 41
def update(id, options)
url = "#{@base_url}/api/monitoring/incidents/#{id}"
= { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
payload = options
opts = {method: :put, url: url, headers: , payload: payload.to_json}
execute(opts)
end
|