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