<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Delete expired maintenance window via API in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/Delete-expired-maintenance-window-via-API/m-p/224256#M28759</link>
    <description>&lt;P&gt;Yep this works.&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3978"&gt;@victor_balbuena&lt;/a&gt;&amp;nbsp;thanks for quick help&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2023 13:37:05 GMT</pubDate>
    <dc:creator>AK</dc:creator>
    <dc:date>2023-09-29T13:37:05Z</dc:date>
    <item>
      <title>Delete expired maintenance window via API</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Delete-expired-maintenance-window-via-API/m-p/223915#M28700</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;Is there a way to delete all expired maintenance window via API.&lt;/P&gt;&lt;P&gt;I gone through few thread on community and suggestion was to filter on expired maintenance window and delete from UI itself.&lt;/P&gt;&lt;P&gt;But dilemma is, due to huge number of maintenance window the page is not at all loading hence I'm looking to pull all expired MW via API and delete it.&lt;/P&gt;&lt;P&gt;Can someone please suggest.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AK&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 14:41:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Delete-expired-maintenance-window-via-API/m-p/223915#M28700</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2023-09-26T14:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Delete expired maintenance window via API</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Delete-expired-maintenance-window-via-API/m-p/223918#M28701</link>
      <description>&lt;P&gt;You can use the Dynatrace API to automate the process, but you will need to build the logic into whatever script or job you decide to run to delete them.&lt;/P&gt;&lt;P&gt;So the steps would be:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get all maintenance windows with the&amp;nbsp;&lt;A title="Settings API v2" href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings/objects/get-objects" target="_blank" rel="noopener"&gt;Settings API v2&lt;/A&gt;&amp;nbsp;using the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;builtin:alerting.maintenance-window&lt;/STRONG&gt; schema ID.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;With the list of IDs, get every maintenace window via the &lt;A title="Get an object" href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings/objects/get-object" target="_blank" rel="noopener"&gt;same Settings API v2, different endpoint&lt;/A&gt;&amp;nbsp;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;For each maintenance window, dive into the body response of the call and check if the &lt;STRONG&gt;scheduleType&lt;/STRONG&gt; is &lt;STRONG&gt;ONCE&lt;/STRONG&gt; and if the &lt;STRONG&gt;endTime&lt;/STRONG&gt; is in the past (we ignore recurring maintenance windows since they are never expired).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;If the above verifies, save the ID of the object and make one last call to the&amp;nbsp;&lt;A title="Settings API v2, delete an object" href="https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings/objects/del-object" target="_blank" rel="noopener"&gt;Settings API v2, delete an object&lt;/A&gt;&amp;nbsp;to delete it.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;It's a bit complicated, but it's the only way as the maintenace window doesn't have an expired field or something else we can check apart from the one mentioned above.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 15:51:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Delete-expired-maintenance-window-via-API/m-p/223918#M28701</guid>
      <dc:creator>victor_balbuena</dc:creator>
      <dc:date>2023-09-26T15:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Delete expired maintenance window via API</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Delete-expired-maintenance-window-via-API/m-p/224256#M28759</link>
      <description>&lt;P&gt;Yep this works.&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3978"&gt;@victor_balbuena&lt;/a&gt;&amp;nbsp;thanks for quick help&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 13:37:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Delete-expired-maintenance-window-via-API/m-p/224256#M28759</guid>
      <dc:creator>AK</dc:creator>
      <dc:date>2023-09-29T13:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Delete expired maintenance window via API</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/Delete-expired-maintenance-window-via-API/m-p/281085#M37011</link>
      <description>&lt;P&gt;Since there is option to list the expired maintenance window and also, option to delete the expired ones manually in UI, May be candidate for API enhancement instead of the workaround?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 21:48:48 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/Delete-expired-maintenance-window-via-API/m-p/281085#M37011</guid>
      <dc:creator>TSubramanian</dc:creator>
      <dc:date>2025-07-08T21:48:48Z</dc:date>
    </item>
  </channel>
</rss>

