Get a List of All Patch Management Assets

Using this API, you can get a list of more than ten thousand assets enabled for your Patch Management subscription. 

POST/pm/v1/assets

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

searchAfter

Optional

string

Specify the searchAfter parameter to search for results after that. This is a combination of an asset_name and asset_id separated by a comma.

sortOrder

Optional

string

Specify the order to sort asset_name and asset_id.

pageSize

Optional

string

Specify the number of rows to be displayed per page.

platform

Optional

string

Specify the platform type.

Example: Windows and Linux

Sample - Get a List of all Patch Management Assets with Windows PlatformSample - Get a List of all Patch Management Assets with Windows Platform

API request

    
        curl -X 'POST' \
  '<qualys_base_url>/pm/v1/assets?sortOrder=ASC&platform=Windows' \
  -H 'accept: application/json' \
  -H 'searchAfter: PMUI_AUTOMATION_ASSET_WINDOWS_EXCLUSION,ecd86069-c015-4b0e-9488-8ef14a99026d' \
  -H 'Authorization: Bearer <Bearer_Token>' \
  -H 'Content-Type: application/json' \
  -d '{
"query": "installedPatchCount>1",
"havingQuery": "downloadMethod:AcquireFromVendor and rebootRequired:true",
"attributes": "name,id,platform"}' 

Response

    
        [
  {
    "platform": "Windows",
    "name": "PMUI_AUTOMATION_MOCK_ASSET_WINDOWS_1",
    "id": "e6eaf17a-3069-4c1e-a5dc-df0049cb9f60"
  },
  ...
  {
    "platform": "Windows",
    "name": "PMUI_AUTOMATION_MOCK_ASSET_WINDOWS_5",
    "id": "f87461bc-16ad-4621-97ef-c496676815da"
  }
]
    

Sample - Get a List of all Patch Management Assets with Linux PlatformSample - Get a List of all Patch Management Assets with Linux Platform

API request

    
        curl -X 'POST' \  '<qualys_base_url>/pm/v1/assets?sortOrder=ASC&pageSize=2&platform=Linux' \
  -H 'accept: application/json' \
  -H 'searchAfter: PMUI_AUTOMATION_MOCK_ASSET_LINUX_1,6af553e1-fc5a-4791-b339-44f71df5eb81' \
  -H 'Authorization: Bearer <Bearer_Token>' \
  -d '{
"query": "missingPatchCount>0",
"attributes": "name,id,platform"}'   

Response

    
        [
  {
    "platform": "Linux",
    "name": "PMUI_AUTOMATION_MOCK_ASSET_LINUX_2",
    "id": "b3ca4393-3daa-45df-b1c6-b5378d97a2e3"
  },
  {
    "platform": "Linux",
    "name": "PMUI_AUTOMATION_MOCK_ASSET_LINUX_3",
    "id": "144d85c6-a0d3-4b66-8d92-0609ea309aef"
  }
]