Assets APIs


This topic describes the REST APIs for the assets.

The base URL for the Assets API is: https://<serverName>/api/v1

POST/api/v1/violations/reports/targets/{type}

Creates all assets.

Request body

Parameter

Description

type

Specifies the name of type for the asset. This field is optional.

Default value: managed

Available values: managed, scanned

Sample request 

{
 "filters": [
   {
     "os": [
       "Windows"
      ]
   },
   {
     "asset_name_multi": [
       "clm-pun-05.bmc.com"
      ]
   },
   {
     "asset_search": "clm-pun-05|172.25.156.33|Windows"
   },
   {
     "violation_id": "d41cedbb-a981-4a46-b658-1111"
   }
  ],
 "pagesize": 1,
 "limit": 100
}

Responses

Code

Description

200

OK

204


401

Unauthorized

500

Internal Server Error


Sample response

{
 "details": [
   {
     "asset_name": "clm-pun-tifm01",
     "os": "Windows",
     "os_platform": "Windows",
     "ip_address": [
       "172.25.153.52"
      ],
     "violation_count": "105",
     "source": [
       "QUALYS"
      ],
     "mapped_ip_address": [
       "172.25.153.52"
      ],
     "vendor": "string",
     "os_release": "string",
     "os_version": "Windows Server 2008 R2 Enterprise 64 bit Edition Service Pack 1",
     "id": "0332230c-2102-4f54-90b9-f14355529d91",
     "state": "Mapped",
     "mapped_scan_host": "clm-aus-008486.bmc.com"
   }
  ],
 "total_record": "1000"
}

put/api/v1/violations/asset/manual-map/{resourceId}

Maps the scanner asset to the endpoint targets manually.

Request body

Parameter

Description

resourceID


Sample request 

{
 "sources": [
   {
     "resource_id": "string"
   }
  ]
}

Responses

Code

Description

200

OK

401

Unauthorized

404

Data Not Available

500

Internal Server Error

501

Feature not supported

put/api/v1/violations/asset/unmap

Unmaps the scanner asset to the endpoint targets.

Request body: No parameters

Responses

Code

Description

200

OK

401

Unauthorized

404

Data Not Available

500

Internal Server Error

501

Feature not supported

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*