Creating a discovery profile through REST

Document ID : KB000044175
Last Modified Date : 14/02/2018
Show Technical Document Details


This KB article shows how to create a discovery profile through REST and kick it off



Can I create and start a discovery profile through REST?






Yes you can.  In the example below, we create a discovery profile called Paris


Create a discovery profile 

A discovery profile needs an Tenant ID, IP domain ID, and SNMP Profile ID. Let’s find those first. 

1. Issue an HTTP GET to http://<dahost>:8581/rest/tenants. This will fetch the list of tenants from the DA. Make a note of the Default Tenant’s ID. We’ll call this “daTenantId” 

2. Issue a HTTP GET to http://<dahost>:8581/rest/ipdomains for a list of IP domains. (To scope the list by tenant, see the reference guide.) 

3. From the list, make a note of the IP Domain ID of the Default Domain. We’ll call this “daIpDomainId”. 

4. Find the parisSnmpProfileItemId from above. This is PC’s SNMP Profile Item ID. We need to translate it to the DA’s representation of the same thing. 

5. Run the following MySQL command on the PC’s host: 

mysql -D netqosportal -e 'select * from item_identifiers where ItemID=<parisSnmpProfileId> and SourceId=<daDataSourceId>' 

6. Make a note of the LocalID (call it “daParisSnmpProfileId”). You’ll refer to it later. 

7. Issue a HTTP POST to http://<dahost>:8581/rest/tenant/<daTenantId>/discoveryprofiles with the following content: 

(Must scope by tenant – POST’s to http://<dahost>:8581/rest/discoveryprofiles will not work!) 

Body (successful result): 

<DiscoveryProfile version="1.0.0"> 

<Item version="1.0.0"> 



<!-- IPRangesList can be omitted if empty --> 




<!-- IPListList can be omitted if empty --> 





<!-- HostNamesList can be omitted if empty --> 





<!-- If omitted, use all SNMP Profiles in Tenant --> 


<!-- These ID’s are DA Item ID’s for the profiles --> 



<!-- ActivationStatus is required (true/false) --> 


<!-- IcmpDiscoveryEnabled is optional --> 


<IPDomainMember version="1.0.0"> 

<!-- DA's IP Domain ID --> 





Running the discovery profile 

1. Issue a HTTP PUT to http://<dahost>8581/rest/tenant/<daTenantId>/discoveryprofiles/<daDiscoveryProfileId> with the following content: 


<DiscoveryProfile version="1.0.0">