Set MongoDB Maintenance Windows

To update the maintenanceWindow, perform a PATCH request.

Endpoint

Use the following endpoint to update maintenance windows: https://api.ionos.com/databases/mongodb/clusters/{clusterId}

Note: The sample UUID is d02de413-d5af-4104-a6f9-3a3c2766ee61.

Request

curl --include \
    --request PATCH \
    --user "[email protected]:Mb2.r5oHf-0t" \
    --header "Content-Type: application/json" \
    --data-binary '{
      "properties": {
        "maintenanceWindow": {
          "dayOfTheWeek": "Sunday",
          "time": "03:30:00"
        }
      }
    }' 
    https://api.ionos.com/databases/mongodb/clusters/d02de413-d5af-4104-a6f9-3a3c2766ee61

Response

{
  "type": "cluster",
  "id": "d02de413-d5af-4104-a6f9-3a3c2766ee61",
  "metadata": {
    "state": "BUSY",
    "health": "HEALTHY",
    "createdDate": "2020-12-10T12:37:50.000Z",
    "createdBy": "[email protected]",
    "createdByUserId": "012342f-411f-1eeb-9d07-046c59cc737e"
  },
  "properties": {
    "maintenanceWindow": {
      "dayOfTheWeek": "Sunday",
      "time": "03:30:00"
    },
    "type": "replicaset",
    "edition": "enterprise",
    "cores": 2,
    "ram": 2048,
    "storageSize": 10240,
    "storageType": "HDD",
    "displayName": "Represents database name",
    "location": "de/fra",
    "connections": [
      {
        "datacenterId": "b72ebcf5-6158-4ddb-8f65-31b20d82b6c7",
        "lanId": "2",
        "cidrList": [
          "10.1.1.3/24",
          "10.1.1.4/24",
          "10.1.1.5/24"
        ]
      }
    ],
    "instances": 3,
    "connectionString": "mongodb+srv://m-65f4a879f126e3c4.mongodb.de-fra.ionos.com"
  }
}

Last updated

Was this helpful?