How to create a Discovery profile using REST API

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

Problem :

Create a discovery profile using REST client responds with a Error 500.

<Message>Tenant is not specified for IP domain 809.</Message>

Steps to reproduce :

After a look at the API documentation in order to find the correct URL and XML code to POST through REST.

1) The API documentation says: 

       Creates an item of the specified type with the provided values.
       URL: http://hostname:8581/rest/discoveryprofiles/
       HTTP method = POST
       XSD for provided XML: http://hostname:8581/rest/discoveryprofiles/xsd/create.xsd 

2)   Open the REST client and perform a POST operation using the above URL (ttp://hostname:8581/rest/discoveryprofiles/)
      Use the following XML code inside the PAYLOAD of the request. 

       <DiscoveryProfile version="1.0.0">
          <Item version="1.0.0">
          <IPDomainMember version="1.0.0">

Environment :
CA-Performance Management 2.3.4 /2.3.5

Resolution :
The URL must contain the tenantID, as the following sample ../rest/tenant/<tenantID>/discoverprofiles

It is important to know what ID the tenant has and also the IPDomain.
IPDoman: /rest/ipdomains
Tenants: /rest/tenants 

To get the Tenant ID use the following url in the Browser:
- shows a list of the known tenants with detailed information.
- shows a list of the known domains with detailed information.