DownloadMissingPatches
Will download a specified subset of missing patches previously returned by GetMissingPatches. Behavior differs by platform:
• Windows (WUA, sig 1103): Delegates to the Windows Update Agent (WUA) API. Patches are downloaded and cached by WUA; OESIS does not manage the cache.
• Linux (apt, sig 200041): Delegates to the apt CLI. Packages are cached at /var/cache/apt/archives, managed by apt and is not controlled by OESIS.
Syntax
Method ID
#define WAAPI_MID_DOWNLOAD_MISSING_PATCHES 1016
JSON Input Structure
{
"input": {
"method": 1016,
"signature": number,
"threads": number,
"retry_internet_services": boolean,
"patches": [
{
"title": string,
"product": string,
"vendor": string
},
...
]
}
}
Input Properties
| Parameter | Type | Description |
|---|---|---|
threads | number | (optional) The number of threads using to download patches, equal to number of patches can be downloaded at the same time. Default value = 4. |
retry_internet_services | boolean | (optional) (Windows Update Agent only) If true, will retry with the internet services when failed with managed servers (if they are configured, such as WSUS, Configuration Server). Default value is true |
patches | array<object> | An array of missing patches to be downloaded. |
patches.title | string | The title of a missing patch, this value should be got from the return of GetMissingPatches. |
patches.product | string | The product a missing patch will be downloaded for, this value should be got from the return of GetMissingPatches. |
patches.vendor | string | (optional) The vendor of the product a missing patch will be downloaded for, this value should be got from the return of GetMissingPatches. |
JSON Output Structure
{
"result": {
"method": 1016,
"code": number,
"timing": number,
"timestamp": string,
"patches": [
{
"title": string,
"product": string,
"vendor": string,
"state": string
},
...
],
"patches_source": string
}
}
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.patches | array<object> | An array of missing patches that input by user. |
result.patches.title | string | The title of a patch. |
result.patches.product | string | The product of this patch. |
result.patches.vendor | string | (optional) The vendor of the product a missing patch. Only available if user input it in json_in. |
result.patches.state | string | The state of a patch after this method completed. It can be: 'not_found' - if patch was not found in result of GetMissingPatches, 'not_found_in_cache' - if patch was not found in cache, only available when install_from_cache = true, 'download_failed' - if patch failed in download phase, 'cache_failed' - if patch was downloaded but can not move it to OESIS Framework cache location, 'downloaded' - patch was downloaded and cached successful, 'canceled' - the request was canceled by CancelAsyncRequest before this patch was downloaded. |
result.patches_source | string | (optional) (Windows Update Agent only) The source supplying patches: 'Windows Update', 'Microsoft Update', 'WSUS or Configuration Manager', 'Unknown', or the file path to the wsusscn2.cab in case WUA works in offline mode |
Result Codes
| Code | Name | Description |
|---|---|---|
| 0 | WAAPI_OK | The operation completed successfully. |
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