cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SVM API "List Scan Result for Each Host"

I’m using the API and I noticed that with the “List Scan Result for Each Host” query (https://docs.flexera.com/csi/api/Content/helplibrary/List_Scan_Result_for_Each_Host.htm#svm_api_completed_scan_3551738620_1219696) only allows us to search by “device_id”. Is there a way we are able to search by device name?

or some way to determine what the "device_id" is from the device name? or would this be an enhancement request?

(1) Solution

Hi, 

To get device id from device name, use the following API. This is "All Hosts" smartgroup API. From the API response, 'nsi_device_id' json node have device id

api/?action=smart_groups&which=getSmartGroupContents&smartGroupTextType=host&smartGroupId=<1>&?_dc=1663230490412&host_name=<Device Name>&page=1&start=0&limit=30&sorters=[{"field":"host_name","direction":"ASC"}]

Pass smartGroupId and host_name as required.

A sample code to get device details from device id is listed here - https://docs.flexera.com/csi/api/Content/helplibrary/Sample_PowerShell_Code_to_Get_Host_Details.htm

 

Thanks,

Anish Mohan

View solution in original post

(1) Reply

Hi, 

To get device id from device name, use the following API. This is "All Hosts" smartgroup API. From the API response, 'nsi_device_id' json node have device id

api/?action=smart_groups&which=getSmartGroupContents&smartGroupTextType=host&smartGroupId=<1>&?_dc=1663230490412&host_name=<Device Name>&page=1&start=0&limit=30&sorters=[{"field":"host_name","direction":"ASC"}]

Pass smartGroupId and host_name as required.

A sample code to get device details from device id is listed here - https://docs.flexera.com/csi/api/Content/helplibrary/Sample_PowerShell_Code_to_Get_Host_Details.htm

 

Thanks,

Anish Mohan