#Enable/disable maintenance mode via API?

1 messages · Page 1 of 1 (latest)

half crane
#

Hi! I'm curious if it is possible to enable/disable maintenance mode via the AIQ UM API? I'm automating day to day operations for our storage team and it would be nice to be able to put the clusters into maintenance mode programatically prior to any maintenance.

tired falcon
#

You can find maintenance_window in the "datasource" model

half crane
#

thanks so much!

half crane
#

@tired falcon Looking at the model for /admin/datasources/clusters/{key} it looks as if maint start time and end time is read only. I'm attempting to pass the following body:

{
  "maintenance_window": {
    "end_time": "2023-10-12T13:56:09Z",
    "start_time": "2023-10-12T12:56:09Z"
   }
}

But getting this error:

{
  "error": {
    "message": "Provide at least one valid parameter",
    "target": "",
    "code": null
  }
}

If this is settable via API do you all have any examples of the way to do it?

tired falcon
#

Yeah, you're right.... Definitely looks like it

#

I think NetApp needs to chime in here if it's possible or on the roadmap

half crane
#

We'll work with our account team as well to see if its on the roadmap.

ionic canyon
#

Looks like there's a hidden api call to set the maintenance windows - open the Develper Tools in Chrome and you can see the URL call and the JSON body. I tried it in Postman and it worked.

#

JSON Body: { "DatasourceId":7,"startTime":"2023-10-13T11:53:25-06:00","endTime":"2023-10-13T12:53:25-06:00"}

#

This would most likely be unsupported since it's not a presented API and could not work in future versions.