DownloadDatabase
Download data files according to input. It tries to download all specified files even if one fails.
Note that it always returns success code and reports status code for each downloaded file in 'details' field.
Temporary files start with 'tmp_' may be created during delta updating and be deleted after that.
Syntax
Method ID
#define WA_VMOD_DOWNLOAD_DATABASE 50200
JSON Input Structure
{
"input": {
"method": 50200,
"token": string,
"dat_download_info": [
{
"dat_name": string,
"dat_output_source_file": string,
"delta_update": number
},
...
]
}
}
Input Properties
| Parameter | Type | Description |
|---|---|---|
token | string | Token string to download files. |
dat_download_info | array<object> | Array that lists all data files to download and where to save them. Each file is downloaded in a separate thread and the stack trace contains separate error for each file in case any error happened. |
dat_download_info.dat_name | string | Name of requested database file to download. Value can be one of the following (bold font), grouped by type: • Vulnerability Assessment: vmod.dat (vulnerability information, anti-malware definition, remediation database). • Anti-malware Definition Checking: vmod-om.dat (anti-malware definition database), • File-based Vulnerability Assessment: vhsh.dat (file database). • Patch Management: patch.dat (patch management database), ap_support_chart.json (support chart in JSON format), ap_support_chart.xml (support chart in XML format). |
dat_download_info.dat_output_source_file | string | Path to save downloaded file. Please use either one forward slash (Unix path) or 4 backward slashes (Windows path) to separate path components. |
dat_download_info.delta_update | number | (optional) Delta update modes: • 0 means downloading full file. • 1 means using delta mechanism if possible; otherwise, downloading full file (default value). • 2 means forcefully using delta mechanism and return error if it is not possible. |
JSON Output Structure
{
"result": {
"method": 50200,
"code": number,
"timing": number,
"timestamp": string,
"details": [
{
"dat_name": string,
"dat_timestamp": string,
"path": string,
"code": number,
"errors": number,
"description": number,
"define": number
},
...
]
}
}
Output Properties
| Property | Type | Description |
|---|---|---|
result.method | number | The method ID that generated this result. |
result.code | number | The result code. See Result Codes. |
result.timing | number | The measured time for the method call in milliseconds. |
result.timestamp | string | The timestamp in seconds of when the call was made. |
result.details | array<object> | Array contains result for each file specified in input. Each input file has one output object in this array. The order of files in input is retained. |
result.details.dat_name | string | Name of the file. |
result.details.dat_timestamp | string | (optional) Timestamp in seconds of when the data file was published on server. This field only exist if the file can be retrieved from server. |
result.details.path | string | The path the file was saved to (from dat_output_source_file field in input). |
result.details.code | number | Result code when downloading the file. |
result.details.errors | number | (optional) Recursively shows the error stack. |
result.details.description | number | (optional) The print friendly description of the error code. |
result.details.define | number | (optional) The print friendly error define, e.g. WAAPI_ERROR_GENERAL. |
Result Codes
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | The operation completed successfully. |
note
Other codes may be returned. See the full Result Codes reference for the complete list.
Remarks
Error Handling
The results of this function are determined by the error code returned by the call. If successful, WAAPI_OK or a special success code will be returned. Always check both the function return value and the result.code field in the output JSON.
Examples
Examples will be added here demonstrating the usage of this method.
See Also
Last updated: 2026-10-01