Class: Superset::Dashboard::Export
- Includes:
- FileUtilities
- Defined in:
- lib/superset/dashboard/export.rb
Constant Summary collapse
- TMP_SUPERSET_DASHBOARD_PATH =
'/tmp/superset_dashboards'
Constants inherited from Request
Instance Attribute Summary collapse
-
#dashboard_id ⇒ Object
readonly
Returns the value of attribute dashboard_id.
-
#destination_path ⇒ Object
readonly
Returns the value of attribute destination_path.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(dashboard_id:, destination_path:) ⇒ Export
constructor
A new instance of Export.
- #perform ⇒ Object
- #response ⇒ Object
Methods included from FileUtilities
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_id:, destination_path:) ⇒ Export
Returns a new instance of Export.
20 21 22 23 |
# File 'lib/superset/dashboard/export.rb', line 20 def initialize(dashboard_id: , destination_path: ) @dashboard_id = dashboard_id @destination_path = destination_path.chomp('/') end |
Instance Attribute Details
#dashboard_id ⇒ Object (readonly)
Returns the value of attribute dashboard_id.
18 19 20 |
# File 'lib/superset/dashboard/export.rb', line 18 def dashboard_id @dashboard_id end |
#destination_path ⇒ Object (readonly)
Returns the value of attribute destination_path.
18 19 20 |
# File 'lib/superset/dashboard/export.rb', line 18 def destination_path @destination_path end |
Instance Method Details
#perform ⇒ Object
25 26 27 28 29 30 |
# File 'lib/superset/dashboard/export.rb', line 25 def perform create_tmp_dir save_exported_zip_file unzip_files copy_export_files_to_destination_path if destination_path end |
#response ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/superset/dashboard/export.rb', line 32 def response @response ||= client.call( :get, client.url(route), client.param_check(params) ) end |