question

Rene F. avatar image
Rene F. asked ·

Create Maintenance Window (API) for all hosts with a specific geoloc_site

Hi,


I'd like to create a maintenance window for all hosts within a specific DC (GEOLOC_Site) through API, however I'm not able to figure out the correct JSON to do this, beside quering for all entities prior the request and concatenate them within the entities.


I'd like to archive something like this:

"scope": {
        "entities": [],
      "matches": [
      {
        "type": "HOST",
        "managementZoneId": null,
        "tags": [
          {
            "context": "ENVIRONMENT",
            "key": "GEOLOC_SITE",
            "value": "GEOLOC_SITE-123456789abdcf"
          }
        ]
      }
    ]
  },


kind regards

René

maintenance window
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

1 Answer

Michael B. avatar image
Michael B. answered ·

Hi René

You are on the right track. However; we would use the type element in the MonitoredEntityFilter object to specify the geolocation. Documentation can be found on this here:

https://www.dynatrace.com/support/help/extend-dynatrace/dynatrace-api/configuration-api/maintenance-windows-api/post-mw/

Such as:

  1. "type": "Geolocation",
  2. "managementZoneId": example


If you navigate to your tenant. You can click the oneagent icon in the top right corner, you can navigate to configuration API to test a few queries :)


-Michael

Share
10 |2000000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.