doctl-databases-maintenance-window
Manage DigitalOcean database maintenance windows
TLDR
Run a doctl databases maintenance-window command with an access token
Retrieve details about a database cluster's maintenance windows
Update the maintenance window for a database cluster
SYNOPSIS
doctl databases maintenance-window get <database-cluster-uuid>
Get the current maintenance window settings for a database cluster.
doctl databases maintenance-window update <database-cluster-uuid> --day <day-of-week> --hour <hour-of-day>
Update the maintenance window for a database cluster.
<day-of-week>: e.g., monday, tuesday, ..., sunday
<hour-of-day>: e.g., 0-23 (UTC)
PARAMETERS
<database-cluster-uuid>
The unique identifier (UUID) of the DigitalOcean database cluster for which to manage the maintenance window. This UUID is a mandatory argument and can be obtained by listing your database clusters using `doctl databases list`.
--day <day-of-week>
Required for the `update` command. Specifies the preferred day of the week for the maintenance window. Valid string values include `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, and `sunday`.
--hour <hour-of-day>
Required for the `update` command. Specifies the preferred hour of the day (in UTC) for the maintenance window. Valid integer values range from `0` (midnight UTC) to `23` (11 PM UTC).
DESCRIPTION
The `doctl databases maintenance-window` command is a specific subcommand within the official DigitalOcean command-line interface (`doctl`). It is designed to manage the scheduled maintenance windows for DigitalOcean Managed Database Clusters.
DigitalOcean's Managed Databases regularly receive automated updates, security patches, and minor version upgrades to ensure their stability, security, and performance. These critical operations are typically performed during a designated maintenance window to minimize potential disruption to user applications.
This command provides users with the ability to both retrieve the current maintenance window settings for a specified database cluster and to update them to a preferred day and hour (in UTC). This granular control allows administrators to align database maintenance with their application's lowest traffic periods, thus optimizing availability and user experience.
CAVEATS
- Impact: Changing the maintenance window directly influences when your database cluster will undergo critical updates and patches. It's crucial to select a time that aligns with your application's lowest traffic or usage periods to minimize potential user impact.
- UTC Time Zone: The `--hour` parameter strictly uses Universal Coordinated Time (UTC). Users must convert their desired local time to UTC before setting it to ensure the maintenance occurs at the expected time.
- Potential Disruption: While DigitalOcean engineers strive to make updates as non-disruptive as possible, some operations may still lead to brief periods of unavailability or degraded performance during the maintenance window.
- Permissions: To successfully update a maintenance window, your DigitalOcean API token used with `doctl` must possess the necessary write permissions for database resources.
CHECKING CURRENT SETTINGS
To view the current maintenance window configuration for a specific database cluster, execute the `get` subcommand, replacing <your-database-cluster-uuid> with the actual UUID of your cluster:
doctl databases maintenance-window get <your-database-cluster-uuid>
The output will typically display the `day_of_week` and `hour_of_day` (UTC) currently set for that cluster.
EXAMPLE USAGE: UPDATING THE MAINTENANCE WINDOW
Suppose you want to set your database cluster with UUID `a1b2c3d4-e5f6-7890-1234-567890abcdef` to have its maintenance window on Sunday at 2 AM UTC. You would use the `update` subcommand as follows:
doctl databases maintenance-window update a1b2c3d4-e5f6-7890-1234-567890abcdef --day sunday --hour 2
Upon successful execution, `doctl` will typically confirm the update, and the new settings will take effect for the next scheduled maintenance cycle.
HISTORY
The `doctl` command-line interface has been developed and continually enhanced by DigitalOcean to offer a robust and programmatic way for users to interact with their cloud infrastructure. The `databases` command group, including the functionality for managing maintenance windows, was introduced as DigitalOcean's Managed Databases offering matured. This feature reflects the growing need for users to have precise control over the operational aspects and lifecycle of their managed database instances, aligning with industry best practices for automated update management and service continuity.
SEE ALSO
doctl databases list(1), doctl databases create(1), doctl databases get(1), doctl auth init(1)