File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Will export the zip file to /tmp/superset_dashboards with zip filename adjusted to include the dashboard_id
2
2
# Example zipfile: dashboard_#{dashboard_id}_export_#{datestamp}.zip
3
+ # Will then unzip and copy the files into the destination_path with the dashboard_id as a subfolder
3
4
#
4
5
# Usage
5
6
# Superset::Dashboard::Export.new(dashboard_id: 15, destination_path: '/tmp/superset_dashboard_backups/').perform
@@ -28,7 +29,6 @@ def perform
28
29
copy_export_files_to_destination_path if destination_path
29
30
end
30
31
31
- # overriding the current happi get request as the returned packet is as string, ie not the usual hash
32
32
def response
33
33
@response ||= client . call (
34
34
:get ,
@@ -37,10 +37,6 @@ def response
37
37
)
38
38
end
39
39
40
- def download_folder
41
- File . dirname ( extracted_files [ 0 ] )
42
- end
43
-
44
40
private
45
41
46
42
def params
@@ -55,6 +51,10 @@ def unzip_files
55
51
@extracted_files = unzip_file ( zip_file_name , tmp_uniq_dashboard_path )
56
52
end
57
53
54
+ def download_folder
55
+ File . dirname ( extracted_files [ 0 ] )
56
+ end
57
+
58
58
def copy_export_files_to_destination_path
59
59
path_with_dash_id = File . join ( destination_path , dashboard_id . to_s )
60
60
FileUtils . mkdir_p ( path_with_dash_id ) unless File . directory? ( path_with_dash_id )
You can’t perform that action at this time.
0 commit comments