Update One Maintenance Window for One Project
Updates the maintenance window for the specified project. Urgent maintenance activities such as security patches can't wait for your chosen window. MongoDB Cloud starts those maintenance activities when needed. After you schedule maintenance for your cluster, you can't change your maintenance window until the current maintenance efforts complete. The maintenance procedure that MongoDB Cloud performs requires at least one replica set election during the maintenance window per replica set. Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or unexpected system issues could delay the start time. Updating the maintenance window will reset any maintenance deferrals for this project. To use this resource, the requesting Service Account or API Key must have the Project Owner role.
Path parameters
-
Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
Format should match the following pattern:
^([a-f0-9]{24})$
.
Query parameters
-
Flag that indicates whether Application wraps the response in an
envelope
JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.Default value is
false
.
Body
Required
Updates the maintenance window for the specified project.
-
Flag that indicates whether MongoDB Cloud should defer all maintenance windows for one week after you enable them.
-
One-based integer that represents the day of the week that the maintenance window starts.
1
: Sunday.2
: Monday.3
: Tuesday.4
: Wednesday.5
: Thursday.6
: Friday.7
: Saturday.
Minimum value is
1
, maximum value is7
. -
Zero-based integer that represents the hour of the of the day that the maintenance window starts according to a 24-hour clock. Use
0
for midnight and12
for noon.Minimum value is
0
, maximum value is23
. -
Defines the a window where maintenance will not begin within.
-
Flag that indicates whether MongoDB Cloud starts the maintenance window immediately upon receiving this request. To start the maintenance window immediately for your project, MongoDB Cloud must have maintenance scheduled and you must set a maintenance window. This flag resets to
false
after MongoDB Cloud completes maintenance.
curl \
--request PATCH 'https://cloud.mongodb.com/api/atlas/v2/groups/32b6e34b3d91647abb20e7b8/maintenanceWindow' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/vnd.atlas.2023-01-01+json"
{
"autoDeferOnceEnabled": true,
"dayOfWeek": 42,
"hourOfDay": 42,
"protectedHours": {
"endHourOfDay": 42,
"startHourOfDay": 42
},
"startASAP": true
}
{
"error": 400,
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"reason": "Bad Request",
"errorCode": "VALIDATION_ERROR"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}