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

Configuration API for Service naming rules?

sureshKumarK
Helper

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.

10 REPLIES 10

ChadTurner
DynaMight Legend
DynaMight Legend

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

-Chad

thanks @Chad T. I am not looking for metrics, I am looking for renaming the Services with rules using API

Julius_Loman
DynaMight Legend
DynaMight Legend

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.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

alonso_decosio
Inactive

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

Hi Alonso, looks like this API is useful for process groups not for each service

thanks Alonso, conditional naming API gave a good lead for the solution

sureshKumarK
Helper

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.


sureshKumarK
Helper

If I know how to GET the HOST group IDs using API, simply i can replace that in the payload and do POST.

sureshKumarK
Helper

sureshKumarK
Helper

Here is the solution:

  1. Using ConditionalNaming rule API GET the Services and their IDs’ where all the Service naming rules are created {{tenant}}/api/config/v1/conditionalNaming/:type
  2. GET the properties of each Id {{tenant}}/api/config/v1/conditionalNaming/:type/:id
  3. GET the host group ID of the host group of the the enviornment where you are planning to create the rule using API {{tenant}}/api/v1/entity/infrastructure/hosts
  4. Take the meId from #3, modify the #2 response and POST the payload using {{tenant}}/api/config/v1/conditionalNaming/:type

Hope this helps!

Thanks for your inputs @Alonso de Cosio F. @Július L. and @Chad T.

Thanks, Suresh.

Featured Posts