Export Management Zones

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

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

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

Hi guys,

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

Click on API button

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

HTH

Yos

Thanks for your suggestion.

We are getting below error:

<span>{</span>  <span class="">"error"</span><span>: {</span>    <span class="">"code"</span><span>: </span><span>404</span><span>,</span>    <span class="">"message"</span><span>: </span><span>"Settings not found"</span>
  }
}

How can we fix it?

Could you please share the Curl you used?

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”

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

Also from Postman

From where are you running the curl command?

Yos

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.

Mukesh

Hi @nicemukesh

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

The schema ID can be found on the MZ page

HTH

Yos

Thanks for your suggestions. it helps a lot

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>”}}