How can a list of devices in each NCM policy be created via REST to report whether they are in compliance or not?
For e.g.
Policy Model Handle |
Policy Name |
Policy Type |
948528 |
DHCP relay agent check |
Single_Line(0) |
Policy Violator? |
Model Handle |
Hostname |
IP |
Model Type |
N |
92A552 |
Spectro01 |
xxx.xxx.xxx.xxx |
SwCiscoIOS |
N |
90334E |
spectro01 |
yyy.yyy.yyy.yyy |
HubCat29xx |
DX NetOps Spectrum 21.2 or later
Currently, Spectrum has REST API capability to get Associated Devices, Global Collections and Devices Families for NCM policies.
However, it doesn't have REST API to get combined list of device for NCM policies.
Instead, use the following REST API to get the desired result as per:
TechDocs : DX NetOps 22.2 - GET associations
So, the URL is:
http://<hostname><:portnumber>/spectrum/restful/associations/relation/<rel_handle>/model/<model_handle>?side=[left|right]
For Example, using the following parameters:
NCM Policy : Test_pol
Model Handle : 0x95d623
Relation Handle : 0x820007 (NCM_HAS_POLICY_REL_ID)
Run the following GET request:
http://<ONECLICK>:8080/spectrum/restful/associations/relation/0x820007/model/0x95d623?side=right
BODY:
<association-response-listxmlns-"http://www.ca.com/spectrum/restful/schema/response">
<association-responses>
<association rh="0x820007" leftmh="0x920a36" rightmh="0x95d623"/>
<association rh="8x820007" leftmh="0x94791f" rightmh="0x95d623"/>
</association-responses>
</association-response-list›
NOTE