URL

GET https://{api-url}/api/v2/tenants/{tenantId}/resources/patches

Sample URLs

To retrieve the list of patches on all resources:

https://{api-url}/api/v2/tenants/client_14/resources/patches

To retrieve the list of patches on all resources with a pagination in descending and alphabetical order:

https://{api-url}/api/v2/tenants/client_14/resources/patches?pageNo=1&pageSize=10&isDescendingOrder=true&sortName=name

To retrieve the list of patches installed within a certain time frame:

https://{api-url}/api/v2/tenants/client_14/resources/patches?queryString=startInstalledTime:2015-08-10T00:00:00 0000+endInstalledTime:2015-08-11T00:00:00 0000

Parameters

All parameters are optional:

FieldDefault Value
pageNo={pageNo}1
pageSize={pageSize}100
isDescendingOrder={true/false}true
sortName={field}name
queryString={queryString}NA

Query variables

Query VariablesValuesDescription
resourceUUIDNAUnique ID of a resource.
Example: d5bce6fe-d19f-4ad7-8c50-5f639f2dd321. Use the Search Resources API to fetch the list of resources.
startInstalledTimeyyyy-MM-ddTHH:mm: ssZSearch for patches installed within a certain time frame. The startInstalledTime variable indicates the from time.
Example: 2018-10-10T09:20:00 0000
endInstalledTimeyyyy-MM-ddTHH:mm: ssZThe endInstalledTime variable indicates the to time.
Example:  2018-10-15T10:30:00 0000
startScanTimeyyyy-MM-ddTHH:mm: ssZStarting time of searching the scan for patches.
The startScanTime variable indicates the from time.
Example: 2018-10-10T09:20:00 0000
endScanTimeyyyy-MM-ddTHH:mm: ssZEnd/Closing time of searching the scan for patches.
The endScanTime variable indicates the to time.
Example: 2018-10-15T10:30:00 0000
installedStatusINPROGRESS, COMPLETED, FAILED, EXCLUDED, NEED_TO_INSTALLInstalled status of a patch.For example, to search for patches failed to install, provide installedStatus: FAILED.
patchStatusMISSING, INSTALLEDSearch for missing patches or patches installed on the resources.
categoryCRITICAL, SECURITYCategory to which the patches belong.
patchNameNASearch for patches with the patch name.
patchIdNAUnique ID of a patch. To retrieve the list of patches along with their unique Id, use the Search Patches API.
Example: PATCH-1fde1043-0d9c-4f3f-8a34-2d0afc3a137a.
externalIdNAExternal ID of a patch.
severityNASeverity of a patch.
approvalStatusAPPROVED, NOT_APPROVEDApproval status of a patch.For example, to search for approved patches, provide approvalStatus: APPROVED.

Status code

  • NULL - The NULL value in the file indicates that the Agent did not trigger any installation job.
  • 0x0 - This value indicates that the patch is installed successfully.

The following are error codes that identify installation failures when patching the device:

| 0x80240020       |
| 0x80070643       |
| 0x80070490       |
| 0x800b0100       |
| 0x80246007       |
| 0x80070663       |
| 0x80070652       |
| 0x80246013       |
| 0x80070005       |
| 0x240006         |
| 0x800f0831       |
| 0x80092004       |
| 0x8024000b       |
| 0x80073701       |
| 0x8024002d       |
| 0x800f083f       |
| 0x80070002       |
| 0x80071a90       |
| 0x8024200d       |
| 0x8007371c       |
| 0x800f082f       |
| 0x80070308       |
| 0x80070070       |
| 0x80246012       |
| 0x8000ffff       |
| 0x8007006e       |
| 0x80080005       |
| 0x80240017       |
| 0x800f0902       |
| 0x80070020       |
| 0x800700a1       |
| 0x800705aa       |
| 0x80004005       |
| 0x800736b3       |
| 0x80240009       |
| 0x80070570       |
| 0x80070570       |

Sample responses

A sample response if a patch is missing (and hasn’t been installed):

{
    "results": [
        {
            "approvalStatus": "APPROVED",
            "patchStatus": "INSTALLED",
            "installedStatus": "COMPLETED",
            "scanTime": "2019-10-29T08:56:11+0000",
            "installedTime": "",
            "approvedTime": "",
            "installedApplicationId": "OpsRamp Agent",
            "installedResult": "0x0",
            "patch": {
                "id": "PATCH-6ca40150-56b1-12ca-2b15-22a6ea787790",
                "name": "Dummy Patch Name0",
                "externalId": "10000",
                "category": "Critical Updates - Windows 7",
                "releaseTime": "2019-05-29T08:53:22+0000",
                "type": "WINDOWS",
                "rebootRequired": false,
                "rating": {
                    "rating": "TESTING"
                }
            },
            "resource": {
                "id": "bae45962-981e-4611-bfef-b272c8d8aa87",
                "hostName": "",
                "ipAddress": "172.31.26.40",
                "type": "Windows",
                "aliasName": "alias name",
                "resourceName": "172.31.26.40",
                "consoles": [],
                "resourceType": "Windows",
                "frequency": 0,
                "paused": false,
                "deleted": false,
                "validateSSL": false,
                "port": 0,
                "encrypted": false,
                "timeout": 0,
                "days": 0,
                "ts": 0,
                "clientId": 0,
                "locationOffset": 0,
                "totalLocations": 0,
                "receiverHostPort": 0
            }
        }
    ],
    "totalResults": 1,
    "orderBy": "id",
    "pageNo": 1,
    "pageSize": 100,
    "totalPages": 1,
    "nextPage": false,
    "previousPageNo": 0,
    "descendingOrder": true
}
}

A sample response if a patch is installed:

{
    "results": [
        {
            "approvalStatus": "APPROVED",
            "patchStatus": "INSTALLED",
            "installedStatus": "COMPLETED",
            "scanTime": "2019-10-29T08:56:11+0000",
            "installedTime": "",
            "approvedTime": "",
            "installedApplicationId": "OpsRamp Agent",
            "installedResult": "0x0",
            "patch": {
                "id": "PATCH-6ca40150-56b1-12ca-2b15-22a6ea787790",
                "name": "Dummy Patch Name0",
                "externalId": "10000",
                "category": "Critical Updates - Windows 7",
                "releaseTime": "2019-05-29T08:53:22+0000",
                "type": "WINDOWS",
                "rebootRequired": false,
                "rating": {
                    "rating": "TESTING"
                }
            },
            "resource": {
                "id": "bae45962-981e-4611-bfef-b272c8d8aa87",
                "hostName": "",
                "ipAddress": "172.31.26.40",
                "type": "Windows",
                "aliasName": "alias name",
                "resourceName": "172.31.26.40",
                "consoles": [],
                "resourceType": "Windows",
                "frequency": 0,
                "paused": false,
                "deleted": false,
                "validateSSL": false,
                "port": 0,
                "encrypted": false,
                "timeout": 0,
                "days": 0,
                "ts": 0,
                "clientId": 0,
                "locationOffset": 0,
                "totalLocations": 0,
                "receiverHostPort": 0
            }
        }
    ],
    "totalResults": 1,
    "orderBy": "id",
    "pageNo": 1,
    "pageSize": 100,
    "totalPages": 1,
    "nextPage": false,
    "previousPageNo": 0,
    "descendingOrder": true
}
}