-
Notifications
You must be signed in to change notification settings - Fork 0
/
System.VFS.DownloadFile.yaml
34 lines (28 loc) · 1.12 KB
/
System.VFS.DownloadFile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: System.VFS.DownloadFile
description: |
This is an internal artifact is launched by the GUI when the user
clicks the "Collect from client" or the "Recursively download this
directory from the client" buttons in the VFS browser.
We are hijacking the latter button. For the single-file option the
normal upload function will still be run.
parameters:
- name: Path
description: The path of the file to download.
default: /
- name: Accessor
default: file
- name: Recursively
type: bool
resources:
timeout: 3600
sources:
- query: |
LET download_one_file = SELECT FullPath AS Path, Accessor,
Size, upload(file=FullPath, accessor=Accessor) AS Upload
FROM stat(filename=Path, accessor=Accessor)
LET download_recursive = SELECT *
FROM Artifact.Custom.Client.FindByMagics(search_root=Path,
search_depth=20,
file_accessor=Accessor)
SELECT * FROM if(condition=Recursively, then=download_recursive,
else=download_one_file)