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

API to list Service Methods of a given Service

shreyas_shivapr
Frequent Guest

I'm trying to list Service Methods (entityId and name) of a given Service ID using API. I tried v2/entities API but it lists the Service Method Group ID and not Service Methods. Looking for assistance on this. 
Example: 

/api/v2/entities?entitySelector=entityId%28%22SERVICE-****%22%29&fields=fromRelationships%2C%20toRelationships

 

4 REPLIES 4

mark_bley
Dynatrace Champion
Dynatrace Champion

Hi @shreyas_shivapr ,

that should be possible with e.g. following selector using Service ID

 

type(service_method),fromRelationships.isServiceMethodOf(type(service_method_group),fromRelationships.isGroupOf(type(service),entityId("SERVICE-008E1A2A04B8303E")))

 

Best,

Mark

Hi  mark_bley
I tried the same approach but for me the results were coming to be empty, can you help here. I replaced the enitityId wrt my application 
type(service_method),fromRelationships.isServiceMethodOf(type(service_method_group),fromRelationships.isGroupOf(type(service),entityId("SERVICE-E497A5840A6A5468")))

mark_bley
Dynatrace Champion
Dynatrace Champion

Hi @Harsh,

please try the query bit by bit, i.e. starting with 

 

type(service),entityId("SERVICE-008E1A2A04B8303E")

 

and then

type(service_method_group),fromRelationships.isGroupOf(type(service),entityId("SERVICE-008E1A2A04B8303E"))

and check when you are not getting any more results.

 

Tried the above approach but still now able to get the results. can you suggest the right metric selector that would help
type(SERVICE_METHOD),fromRelationships.isServiceMethodOf(type(service_method_group)
till the above selector i am able to see all service_methods , how can we sort further using the EnitiyID - if i add that then result comes to be empty

Featured Posts