Class: Dd2tf::Import::Monitor
- Inherits:
-
Base
- Object
- Base
- Dd2tf::Import::Monitor
show all
- Defined in:
- lib/dd2tf/import/monitor.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #print
Instance Method Details
#resource_type ⇒ Object
4
5
6
|
# File 'lib/dd2tf/import/monitor.rb', line 4
def resource_type
"datadog_monitor"
end
|
#resources ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/dd2tf/import/monitor.rb', line 8
def resources
resources = []
monitors = @client.get_all_monitors[1]
monitors.each do |monitor|
monitor_name = monitor["name"].underscore.gsub(" ", "_").gsub(::Dd2tf::UNALLOWED_RESOURCE_TITLE_REGEXP, '')
resource_id = monitor["id"]
resources << { resource_id: resource_id, resource_name: monitor_name }
end
resources
end
|