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

Export Management Zones

nicemukesh
Contributor

Hi All,

Need your guidance on below Question:-

How to export Management Zone from Dynatrace. We have 800++ management zones.

Any idea to export Management Zones will be much appreciated

Mukesh 

14 REPLIES 14

islam_zidan
Champion

Hello,

You can use Dynatrace environment API v2, /settings/objects. and use builtin:management-zones in schemaIds.

This should help you export all your management zones.

 

Thanks,

Islam

Dynatrace Certified Professional - Dynatrace Partner - Yourcompass.ca

nicemukesh
Contributor

Thanks for your response.

Can you please tell what are steps we need to take it?

Mukesh

Hi,

curl -X 'GET' \
  'https://XXXXXXXX.live.dynatrace.com/api/v2/settings/objects?schemaIds=builtin%3Amanagement-zones&fields=objectId%2Cvalue&pageSize=500' \
  -H 'accept: application/json; charset=utf-8' \
  -H 'Authorization: Api-Token XXXXXXXX'

That will provide first chunk with 500 MZ in your tenant.

It would provide an ID, in the body, to make a similar call with next chunk. That API return 500 entities as maximum in one shot.

Bets regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

We have DY installed inside our network.  I replaced the URL with our environment URL.

 

https://apm-qa.xxxxx.net/

Getting this error :

404 {"error":{"code":404,"message":"failed to resolve tenant <apm-qa>"}}

Hi guys, 

Just to add to @AntonPineiro & @islam_zidan correct answers, you can always look for the ... at the top right 

Yosi_Neuman_2-1722009327609.png

Click on API button 

Yosi_Neuman_1-1722009266545.png

Which will help you  to get the right API you need in this case for read

Yosi_Neuman_3-1722009382293.png

HTH

Yos 

 

 

 

dynatrace certificated professional - dynatrace master partner - Matrix Soft Ware Division - Israel

nicemukesh
Contributor

Thanks for your suggestion.

We are getting below error:

{  "error": {    "code": 404,    "message": "Settings not found"
  }
}

 

nicemukesh
Contributor

How can we fix it?

Could you please share the Curl you used?

Dynatrace Certified Professional - Dynatrace Partner - Yourcompass.ca

curl "https://{environmentid}.live.dynatrace.com/api/v2/settings/objects?schemaIds=builtin"%"3Amanagement-zones&scopes=environment&fields=objectId"%"2Cvalue" ^
-X GET ^
-H "Accept: application/json; charset=utf-8" ^
-H "Content-Type: application/json; charset=utf-8" ^
-H "Authorization: Api-Token xxxxxxx"

Hi @nicemukesh 

For me in windows cmd the api request works OK 

Yosi_Neuman_0-1722330077980.png

Also from Postman

Yosi_Neuman_1-1722330322803.png

From where are you running the curl command?

Yos 

dynatrace certificated professional - dynatrace master partner - Matrix Soft Ware Division - Israel

nicemukesh
Contributor

curl "https://{environmentid}.live.dynatrace.com/api/v2/settings/objects?schemaIds=builtin"%"3Amanagement-zones&scopes=environment&fields=objectId"%"2Cvalue" ^
-X GET ^
-H "Accept: application/json; charset=utf-8" ^
-H "Content-Type: application/json; charset=utf-8" ^
-H "Authorization: Api-Token XXXXXXXXXXXXX"

nicemukesh
Contributor

Hi All,

Thanks for all responses, i ran below CURL command, it is working now.

 

curl -X 'GET' \ 'https://{environmentid}.live.dynatrace.com/api/v2/settings/objects?schemaIds=builtin%3Amanagement-zones&fields=objectId%2Cvalue&pageSize=500' \ -H 'accept: application/json; charset=utf-8' \ -H 'Authorization: Api-Token XXXXXXXX'

 

I have a query, when i tried to run in Dynatrace API. Bit confused for object ID, how to fetch OBJECT ID.

 

nicemukesh_0-1722609788789.png

 

Mukesh

 

 

 

Hi @nicemukesh 

You need to fetch all the objects with get /settings/objects 

Yosi_Neuman_0-1722859762293.png

The schema ID can be found on the MZ page 

Yosi_Neuman_1-1722859870466.png

Yosi_Neuman_2-1722859894683.png

HTH

Yos 

 

 

dynatrace certificated professional - dynatrace master partner - Matrix Soft Ware Division - Israel

Thanks for your suggestions. it helps a lot

Featured Posts