---
title: "POST /v1/{+parent}/backupPlans"
method: POST
path: "/v1/{+parent}/backupPlans"
tags: ["projects"]
---

# POST /v1/{+parent}/backupPlans

`POST /v1/{+parent}/backupPlans`

Create a BackupPlan

## Path parameters

- `parent` string, required

## Query parameters

- `backupPlanId` string
- `requestId` string

## Request body

- BackupPlan — A `BackupPlan` specifies some common fields, such as `description` as well as one or more `BackupRule` messages. Each `BackupRule` has a retention policy and defines a schedule by which the system is to perform backup workloads.
  - `diskBackupPlanProperties` DiskBackupPlanProperties — Properties for a disk backup plan.
    - `guestFlush` boolean — Optional. Indicates whether to perform a guest flush operation before taking a disk backup. When set to false, the system will create crash-consistent backups. Default value is false.
  - `createTime` string, google-datetime — Output only. When the `BackupPlan` was created.
  - `revisionId` string — Output only. The user friendly revision ID of the `BackupPlanRevision`. Example: v0, v1, v2, etc.
  - `revisionName` string — Output only. The resource id of the `BackupPlanRevision`. Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}`
  - `updateTime` string, google-datetime — Output only. When the `BackupPlan` was last updated.
  - `name` string — Output only. Identifier. The resource name of the `BackupPlan`. Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`
  - `computeInstanceBackupPlanProperties` ComputeInstanceBackupPlanProperties — Properties for a compute instance backup plan.
    - `guestFlush` boolean — Optional. Indicates whether to perform a guest flush operation before taking a compute backup. When set to false, the system will create crash-consistent backups. Default value is false.
  - `state` 'STATE_UNSPECIFIED' | 'CREATING' | 'ACTIVE' | 'DELETING' | 'INACTIVE' | 'UPDATING' — Output only. The `State` for the `BackupPlan`.
  - `resourceType` string — Required. The resource type to which the `BackupPlan` will be applied. Examples include, "compute.googleapis.com/Instance", "sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster", "compute.googleapis.com/Disk".
  - `description` string — Optional. The description of the `BackupPlan` resource. The description allows for additional details about `BackupPlan` and its use cases to be provided. An example description is the following: "This is a backup plan that performs a daily backup at 6pm and retains data for 3 months". The description must be at most 2048 characters.
  - `labels` object — Optional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {"tag": "Weekly"}.
  - `backupVaultServiceAccount` string — Output only. The Google Cloud service account to be used by the BackupVault for taking backups. Specify the email address of the Backup Vault Service Account.
  - `backupVault` string — Required. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault}
  - `etag` string — Optional. `etag` is returned from the service in the response. As a user of the service, you may provide an etag value in this field to prevent stale resources.
  - `supportedResourceTypes` string[] — Output only. All resource types to which backupPlan can be applied.
  - `logRetentionDays` string, int64 — Optional. Applicable only for Cloud SQL resource_type. Configures how long logs will be stored. It is defined in “days”. This value should be greater than or equal to minimum enforced log retention duration of the backup vault.
  - `backupRules` BackupRule[] — Optional. The backup rules for this `BackupPlan`.
    - `ruleId` string — Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is unique per `BackupPlan`.The `rule_id` must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, /a-z{,62}/.
    - `standardSchedule` StandardSchedule — `StandardSchedule` defines a schedule that run within the confines of a defined window of days. We can define recurrence type for schedule as HOURLY, DAILY, WEEKLY, MONTHLY or YEARLY.
      - `backupWindow` BackupWindow — `BackupWindow` defines a window of the day during which backup jobs will run.
        - `endHourOfDay` integer — Required. The hour of day (1-24) when the window end for example if value of end hour of day is 10 that mean backup window end time is 10:00. End hour of day should be greater than start hour of day. 0 <= start_hour_of_day < end_hour_of_day <= 24 End hour of day is not include in backup window that mean if end_hour_of_day= 10 jobs should start before 10:00.
        - `startHourOfDay` integer — Required. The hour of day (0-23) when the window starts for example if value of start hour of day is 6 that mean backup window start at 6:00.
      - `months` string[] — Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on which jobs will run. This field is only applicable when `recurrence_type` is `YEARLY`. A validation error will occur if other values are supplied.
      - `weekDayOfMonth` WeekDayOfMonth — `WeekDayOfMonth` defines the week day of the month on which the backups will run. The message combines a `WeekOfMonth` and `DayOfWeek` to produce values like `FIRST`/`MONDAY` or `LAST`/`FRIDAY`.
        - `weekOfMonth` 'WEEK_OF_MONTH_UNSPECIFIED' | 'FIRST' | 'SECOND' | 'THIRD' | 'FOURTH' | 'LAST' — Required. Specifies the week of the month.
        - `dayOfWeek` 'DAY_OF_WEEK_UNSPECIFIED' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY' — Required. Specifies the day of the week.
      - `timeZone` string — Required. The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the IANA tz database. See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the list of valid timezone names. For example, Europe/Paris.
      - `hourlyFrequency` integer — Optional. Specifies frequency for hourly backups. A hourly frequency of 1 means jobs will run every 1 hour from start time till end time defined. This is required for `recurrence_type`, `HOURLY` and is not applicable otherwise. A validation error will occur if a value is supplied and `recurrence_type` is not `HOURLY`. The supported values for each resource type are as follows: * `compute.googleapis.com/Instance`: 1-23 * `compute.googleapis.com/Disk`: 1-23 * `sqladmin.googleapis.com/Instance`: 6-23 * `alloydb.googleapis.com/Cluster`: 1-23 * `file.googleapis.com/Instance`: 1-23 Refer to link https://cloud.google.com/backup-disaster-recovery/docs/concepts/cloud_best_practices for more details.
      - `recurrenceType` 'RECURRENCE_TYPE_UNSPECIFIED' | 'HOURLY' | 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY' — Required. Specifies the `RecurrenceType` for the schedule.
      - `daysOfWeek` string[] — Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs will run. This is required for `recurrence_type`, `WEEKLY` and is not applicable otherwise. A validation error will occur if a value is supplied and `recurrence_type` is not `WEEKLY`.
      - `daysOfMonth` integer[] — Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. Values for `days_of_month` are only applicable for `recurrence_type`, `MONTHLY` and `YEARLY`. A validation error will occur if other values are supplied.
    - `backupRetentionDays` integer — Required. Configures the duration for which backup data will be kept. It is defined in “days”. The value should be greater than or equal to minimum enforced retention of the backup vault. Minimum value is 1 and maximum value is 36159 for custom retention on-demand backup. Minimum and maximum values are workload specific for all other rules. Note: Longer retention can lead to higher storage costs post introductory trial. We recommend starting with a short duration of 3 days or less.
  - `maxCustomOnDemandRetentionDays` integer — Optional. Optional field to configure the maximum number of days for which a backup can be retained. This field is only applicable for on-demand backups taken with custom retention value.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/backupdr.md) · [All operations](https://skmtc.dev/google/apis/backupdr/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/backupdr/revisions/b432f73f0b98/schema)
