Class: Superset::Dashboard::BulkDelete
- Defined in:
- lib/superset/dashboard/bulk_delete.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#dashboard_ids ⇒ Object
readonly
Returns the value of attribute dashboard_ids.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(dashboard_ids: []) ⇒ BulkDelete
constructor
A new instance of BulkDelete.
- #perform ⇒ Object
- #response ⇒ Object
Methods inherited from Request
call, #query_params, #result, #superset_host
Methods included from Superset::Display
#display_headers, #headings, #list, #list_attributes, #result, #rows, #table, #title
Constructor Details
#initialize(dashboard_ids: []) ⇒ BulkDelete
Returns a new instance of BulkDelete.
15 16 17 |
# File 'lib/superset/dashboard/bulk_delete.rb', line 15 def initialize(dashboard_ids: []) @dashboard_ids = dashboard_ids end |
Instance Attribute Details
#dashboard_ids ⇒ Object (readonly)
Returns the value of attribute dashboard_ids.
13 14 15 |
# File 'lib/superset/dashboard/bulk_delete.rb', line 13 def dashboard_ids @dashboard_ids end |
Instance Method Details
#perform ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/superset/dashboard/bulk_delete.rb', line 19 def perform raise InvalidParameterError, "dashboard_ids array of integers expected" unless dashboard_ids.is_a?(Array) raise InvalidParameterError, "dashboard_ids array must contain Integer only values" unless dashboard_ids.all? { |item| item.is_a?(Integer) } logger.info("Attempting to delete dashboards with id: #{dashboard_ids.join(', ')}") response end |
#response ⇒ Object
27 28 29 |
# File 'lib/superset/dashboard/bulk_delete.rb', line 27 def response @response ||= client.delete(route, params) end |