I’m trying to extract out the mgmt zone ID much like the user who created the post below. I can easily get the ID using the old deprecated endpoint at /config/v1/managementZones, see example output below.
How can I get the ID using the settings endpoint outlined here? I can’t seem to get the information even after taking the object ID of the mgmt zone and passing it in through /v2/setttings/objects/{objectId}
I’ve tried that in the past. The ID you are referring to is not the ID I need, it is different then what you get when you hit the old managementZones endpoint. I should have also stated that I am using this in a script so checking individuals is not feasible.
As an example below is 1 mgmt zones I have looked at
ID shown in URL
00d5356f-0075-3b3d-8cf3-9ada41e2daa5
ID shown from managementZones endpoint
6001292090469458
You are referring to the endpoint mentioned in this doc right? Have you actually been able to get the mgmt zone ID from these results? I had already looked at this option as noted in my original post and I don’t see it there.
Below are the items I see from the results of settings/objects/{objectId}, I see nothing for a mgmt zone ID
objectId
summary
searchSummary
created
modified
modifiedBy
author
updateToken
scope
schemaId
schemaVersion
value (contains the mgmt zone rules)
Okay, my bad sorry. I thought you wanted MZ object id. As I look closer I don’t see possibility to extract MZ id from settings API This is very interesting because this is key information anyone need and it’s not included :thinking:
We have a script that was working with the previous, deprecated endpoint. It would loop through the alerting profiles and identify the ones that are referencing a particular mgmt zone.
Using schema ‘builtin:alerting.profile’ for settings/object the results show the mgmt zone ID in the alerting profile, not the management zone name. Hence why I need to get the ID of the mgmt zone, then cross it with the output from the alerting profile and spit out the ones that have a matching ID.
Sample output
{
“items”: [
{
“objectId”: “<object id>”,
“value”: {
“name”: “<alerting profile name>”,
“managementZone”: “<mgmt zone id that the alerting profile is using>”,
“severityRules”: [
External python script. I would prefer to not jump through hoops and create anything special, instead use the api and the data that should be there just like it was for the previous endpoint.
Hoping to hear from others if this will be changed in the future.
That isn’t what I need. The result you provided which are the same as what I provided a few comments ago, show the mgmt zone ID tied to the alerting profile but tells you nothing about the name of the mgmt zone. How can I allow for input of the mgmt zone name in my script? With the previous endpoint you could input the mgmt zone name and get back the id of the mgmt zone, I don’t see a way with the settings endpoint using schema builtin:management-zones
It doesn’t make much sense to be inputting the mgmt zone ID into my script, that means nothing to me. I want to use the mgmt zone name just like I’ve been doing with the deprecated endpoint.
Hi @gbaudart , what is a Monaco export? I am also facing same problem. In v1 Api management zone id was different and now in v2 it is different, so how we can extract or map older value with newer one?
For anyone interested this is what I received from support.
According to our development team, unfortunately this is a bit of a feature gap at the moment:
Reading a `builtin:alerting-profile` from the Settings API will always return the numerical MZ-Id as part of the payload.
Writing to a `builtin:alerting-profile` in the Settings API will accept either the numerical MZ-Id or the ObjectId of the MZ in the payload.
Currently, there’s no good way in the API to convert a numerical MZ-Id to an ObjectId or vice versa.
Hence, to find the name of a MZ by numerical MZ-Id, you will have to use the deprecated MZ API.
We are aware of this feature gap with APIv2 and therefore the MZ API won’t be removed until this limitation is resolved.
We plan to eventually close this feature gap by getting rid of the numerical MZ-Ids and only use ObjectIds. An improvement plan has been created and this is currently being worked on but as of now, we have no timeline just yet.
It’s now possible to convert the Management Zone settings objectId into a Management Zone ID through the new Settings - Management zones Env v2 endpoint:
The ID returned by this solution is not physically the same as the one I have. However, it is functional!
When I use it in my “Maintenance Window” creation script, it successfully creates the window with the correct management zone. :smiling_face_with_sunglasses: