05 Nov 2020 09:45 PM - last edited on 30 Aug 2022 11:22 AM by MaciejNeumann
Hi, I am trying to find whether there is an Configuration API available to define or copy the Service naming rules. In one environment I have defined the rules manually and I am trying to use Configuration API to GET, modify and POST the rules to a new Environment. Please let me know if there is an API available for this?
Thanks, Suresh.
Solved! Go to Solution.
06 Nov 2020 02:00 AM
Within the configuration API, you can pull the metrics on each rule and then post that into your new environment as shown here:
We had Dynatrace Support do the migration for us so it was apples to apples
10 Nov 2020 05:16 PM
thanks @Chad T. I am not looking for metrics, I am looking for renaming the Services with rules using API
06 Nov 2020 10:00 AM
At the moment, you cannot transfer service naming rules via API and you have to recreate them manually or maybe ask Dynatrace support to do that for you as @Chad T. mentions.
But it's likely your situation can be also covered by the Service detection rules. Those are for a different purpose. They can be migrated via API easily.
06 Nov 2020 02:58 PM
Hi Suresh,
To migrate the service naming rules, you can use the /conditionalNaming/{Type} endpoint.
In your case, the type will be "service", and as you said, first you need to do a GET and then do a POST in the second environment.
Alonso
10 Nov 2020 05:22 PM
Hi Alonso, looks like this API is useful for process groups not for each service
10 Nov 2020 07:45 PM
thanks Alonso, conditional naming API gave a good lead for the solution
10 Nov 2020 06:08 PM
Hi @Alonso de Cosio F., @Július L., and @Chad T. i have made some progress to get this done.
As Alonso mentioned, I can do the GET to pull all the services and their IDs using conditionalNaming API {{tenant}}/api/config/v1/conditionalNaming/:type
and do another GET on id to pull the properties of that service {{tenant}}/api/config/v1/conditionalNaming/:type/:id
now the question is, to do POST this in new environment where I want to modify and create as a new rule, I am not able to find how to GET the HOST_GROUP_ID values for new environment so that I can modify the Payload and POST to the new environment to create the rule(s)
fyi, this is the payload I am trying to POST in new Environment to get the rule created. Not sure how to get the HOST_GROUP_ID values of new Environment. if I get them, then should be easy to create. Please suggest.
10 Nov 2020 06:13 PM
If I know how to GET the HOST group IDs using API, simply i can replace that in the payload and do POST.
10 Nov 2020 06:49 PM
Seems using the following API we can find the host group ID
10 Nov 2020 08:11 PM
Here is the solution:
Hope this helps!
Thanks for your inputs @Alonso de Cosio F. @Július L. and @Chad T.
Thanks, Suresh.