Sha256: 12c82fbcad83a847f42e153a95a17b645d5974f5ec9dc6b51b53ff914de75eb8
Contents?: true
Size: 715 Bytes
Versions: 6
Compression:
Stored size: 715 Bytes
Contents
# frozen_string_literal: true module DatadogBackup # Monitor specific overrides for backup and restore. class Monitors < Resources def all get_all end def backup all.map do |monitor| id = monitor['id'] write_file(dump(get_by_id(id)), filename(id)) end end def get_by_id(id) monitor = all.select { |m| m['id'].to_s == id.to_s }.first monitor.nil? ? {} : except(monitor) end def initialize(options) super(options) @banlist = %w[overall_state overall_state_modified matching_downtimes modified].freeze end private def api_version 'v1' end def api_resource_name 'monitor' end end end
Version data entries
6 entries across 6 versions & 1 rubygems