Sha256: 2c6714357dcedd317570d12581157b9e18097a617b6ac07034a1d66f20bdef8b

Contents?: true

Size: 535 Bytes

Versions: 2

Compression:

Stored size: 535 Bytes

Contents

module Dd2tf
  module Import
    class Timeboard < Base
      def resource_type
        "datadog_timeboard"
      end

      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dd2tf-0.2.1 lib/dd2tf/import/timeboard.rb
dd2tf-0.2.0 lib/dd2tf/import/timeboard.rb