Set a PostgreSQL Maintenance Window
If you do not choose a maintenance window during the creation of your database, a system-defined maintenance window will be assigned to your database. You can update the window at any time, as shown in the example below.
Endpoint
Use the following endpoint to set a PostgreSQL maintenance window:https://api.ionos.com/databases/postgresql/clusters/{clusterId}
Request
curl --include \
--request PATCH \
--user "[email protected]:Mb2.r5oHf-0t" \
--header "Content-Type: application/json" \
--data-binary '{
"metadata": {},
"properties": {
"maintenanceWindow": {
"dayOfTheWeek": "Sunday",
"time": "03:30:00"
}
}
}' \
https://api.ionos.com/databases/postgresql/clusters/498ae72f-411f-11eb-9d07-046c59cc737eResponse
{
"type": "cluster",
"id": "498ae72f-411f-11eb-9d07-046c59cc737e",
"metadata": {
"state": "AVAILABLE",
"createdDate": "2020-12-10T12:37:50.000Z",
"createdBy": "[email protected]",
"createdByUserId": "012342f-411f-1eeb-9d07-046c59cc737e",
"lastModifiedDate": "2020-12-18T21:37:50.000Z",
"lastModifiedBy": "[email protected]",
"lastModifiedByUserId": "012342f-411f-1eeb-9d07-046c59cc737e"
},
"properties": {
"displayName": "an even better name",
"location": "de/txl",
"dnsName": "pg-pgov71sjg1c875ji.postgresql.de-txl.ionos.com",
"connections": [
{
"datacenterId": "db7e8811-cfae-4b40-82ee-2f4cff81e105",
"lanId": "2",
"cidr": "10.7.222.3/23"
}
],
"cores": 4,
"postgresVersion": "15",
"ram": 4096,
"instances": 1,
"storageSize": 102400,
"storageType": "HDD",
"maintenanceWindow": {
"dayOfTheWeek": "Sunday",
"time": "03:30:00"
},
"synchronizationMode": "ASYNCHRONOUS",
"connectionPooler": {
"enabled": false,
"poolMode": "transaction"
}
}
}Response
{
"type": "cluster",
"id": "498ae72f-411f-11eb-9d07-046c59cc737e",
"metadata": {
"state": "AVAILABLE",
"createdDate": "2020-12-10T12:37:50.000Z",
"createdBy": "[email protected]",
"createdByUserId": "012342f-411f-1eeb-9d07-046c59cc737e",
"lastModifiedDate": "2020-12-18T21:37:50.000Z",
"lastModifiedBy": "[email protected]",
"lastModifiedByUserId": "012342f-411f-1eeb-9d07-046c59cc737e"
},
"properties": {
"displayName": "an even better name",
"location": "de/txl",
"dnsName": "pg-pgov71sjg1c875ji.postgresql.de-txl.ionos.com",
"connections": [
{
"datacenterId": "db7e8811-cfae-4b40-82ee-2f4cff81e105",
"lanId": "2",
"cidr": "10.7.222.3/23"
}
],
"cores": 4,
"postgresVersion": "15",
"ram": 4096,
"instances": 1,
"storageSize": 102400,
"storageType": "HDD",
"maintenanceWindow": {
"dayOfTheWeek": "Wednesday",
"time": "12:08:00"
},
"synchronizationMode": "ASYNCHRONOUS",
"connectionPooler": {
"enabled": false,
"poolMode": "transaction"
}
}
}Caution: When your cluster contains only one replica, you may experience a short downtime during this maintenance window while your database instance is being updated. In a replicated cluster, we only update standbys; however, we may perform a switchover to change the leader node.
Last updated
Was this helpful?