| 1 |
syntax = "proto2"; |
| 2 |
|
| 3 |
package biomaj.download; |
| 4 |
|
| 5 |
message File { |
| 6 |
// Name of the file |
| 7 |
required string name = 1; |
| 8 |
// Location on remote server, defaults to root directory |
| 9 |
optional string root = 2; |
| 10 |
// Save file under different name |
| 11 |
optional string save_as = 3; |
| 12 |
// Specific file url |
| 13 |
optional string url = 4; |
| 14 |
|
| 15 |
message MetaData { |
| 16 |
optional string permissions = 1; |
| 17 |
optional string group = 2; |
| 18 |
optional int64 size = 3; |
| 19 |
optional string hash = 4; |
| 20 |
optional int32 year = 5; |
| 21 |
optional int32 month = 6; |
| 22 |
optional int32 day = 7; |
| 23 |
optional string format = 8; |
| 24 |
optional string md5 = 9; |
| 25 |
optional int64 download_time = 10; |
| 26 |
} |
| 27 |
|
| 28 |
optional MetaData metadata = 5; |
| 29 |
|
| 30 |
} |
| 31 |
|
| 32 |
message FileList { |
| 33 |
repeated File files = 1; |
| 34 |
} |
| 35 |
|
| 36 |
message Operation { |
| 37 |
|
| 38 |
enum OPERATION { |
| 39 |
LIST = 0; |
| 40 |
DOWNLOAD = 1; |
| 41 |
PROCESS = 2; |
| 42 |
} |
| 43 |
|
| 44 |
required OPERATION type = 1; |
| 45 |
optional DownloadFile download = 2; |
| 46 |
optional Process process = 3; |
| 47 |
message Trace { |
| 48 |
required string trace_id = 1; |
| 49 |
required string span_id = 2; |
| 50 |
} |
| 51 |
|
| 52 |
optional Trace trace = 4; |
| 53 |
} |
| 54 |
|
| 55 |
message Process { |
| 56 |
required string exec = 1; |
| 57 |
} |
| 58 |
|
| 59 |
message DownloadFile { |
| 60 |
required string bank = 1; |
| 61 |
required string session = 2; |
| 62 |
|
| 63 |
required string local_dir = 3; |
| 64 |
|
| 65 |
optional int32 timeout_download = 4; |
| 66 |
|
| 67 |
enum Protocol { |
| 68 |
FTP = 0; |
| 69 |
FTPS = 1; |
| 70 |
HTTP = 2; |
| 71 |
HTTPS = 3; |
| 72 |
DIRECTFTP = 4; |
| 73 |
DIRECTHTTP = 5; |
| 74 |
DIRECTHTTPS = 6; |
| 75 |
LOCAL = 7; |
| 76 |
RSYNC = 8; |
| 77 |
IRODS = 9; |
| 78 |
DIRECTFTPS = 10; |
| 79 |
} |
| 80 |
|
| 81 |
message Param { |
| 82 |
required string name = 1; |
| 83 |
required string value = 2; |
| 84 |
} |
| 85 |
|
| 86 |
message HttpParse { |
| 87 |
required string dir_line = 1 [default = '<img[\\s]+src="[\\S]+"[\\s]+alt="\\[DIR\\]"[\\s]*/?>[\\s]*<a[\\s]+href="([\\S]+)/"[\\s]*>.*([\\d]{2}-[\\w\\d]{2,5}-[\\d]{4}\\s[\\d]{2}:[\\d]{2})']; |
| 88 |
required string file_line = 2 [default = '<img[\\s]+src="[\\S]+"[\\s]+alt="\\[[\\s]+\\]"[\\s]*/?>[\\s]<a[\\s]+href="([\\S]+)".*([\\d]{2}-[\\w\\d]{2,5}-[\\d]{4}\\s[\\d]{2}:[\\d]{2})[\\s]+([\\d\\.]+[MKG]{0,1})']; |
| 89 |
required int32 dir_name = 3 [default = 1]; |
| 90 |
required int32 dir_date = 4 [default = 2]; |
| 91 |
required int32 file_name = 5 [default = 1]; |
| 92 |
required int32 file_date = 6 [default = 2]; |
| 93 |
optional string file_date_format = 7; |
| 94 |
required int32 file_size = 8 [default = 3]; |
| 95 |
} |
| 96 |
|
| 97 |
enum HTTP_METHOD { |
| 98 |
GET = 0; |
| 99 |
POST = 1; |
| 100 |
} |
| 101 |
|
| 102 |
message RemoteFile { |
| 103 |
repeated File files = 1; |
| 104 |
required Protocol protocol = 2; |
| 105 |
required string server = 3; |
| 106 |
required string remote_dir = 4; |
| 107 |
optional string save_as = 5; |
| 108 |
repeated Param param = 6; |
| 109 |
optional HttpParse http_parse = 7; |
| 110 |
optional string credentials = 8; |
| 111 |
repeated string matches = 9; |
| 112 |
} |
| 113 |
|
| 114 |
required RemoteFile remote_file = 5; |
| 115 |
|
| 116 |
|
| 117 |
message Proxy { |
| 118 |
required string proxy = 1; |
| 119 |
optional string proxy_auth = 2; |
| 120 |
} |
| 121 |
|
| 122 |
optional Proxy proxy = 6; |
| 123 |
|
| 124 |
optional HTTP_METHOD http_method = 8 [ default = GET]; |
| 125 |
|
| 126 |
map<string, string> options = 9; |
| 127 |
|
| 128 |
} |