REST Resource: projects.locations.backupPlans

Resource: 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.

JSON representation
{
  "name": string,
  "description": string,
  "labels": {
    string: string,
    ...
  },
  "createTime": string,
  "updateTime": string,
  "backupRules": [
    {
      object (BackupRule)
    }
  ],
  "state": enum (State),
  "resourceType": string,
  "etag": string,
  "backupVault": string,
  "backupVaultServiceAccount": string
}
Fields
name

string

Output only. Identifier. The resource name of the BackupPlan.

Format: projects/{project}/locations/{location}/backupPlans/{backupPlan}

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

map (key: string, value: string)

Optional. This collection of key/value pairs allows for custom labels to be supplied by the user. Example, {"tag": "Weekly"}.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

createTime

string (Timestamp format)

Output only. When the BackupPlan was created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. When the BackupPlan was last updated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

backupRules[]

object (BackupRule)

Required. The backup rules for this BackupPlan. There must be at least one BackupRule message.

state

enum (State)

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" and "storage.googleapis.com/Bucket".

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.

backupVault

string

Required. Resource name of backup vault which will be used as storage location for backups. Format: projects/{project}/locations/{location}/backupVaults/{backupvault}

backupVaultServiceAccount

string

Output only. The Google Cloud Platform Service Account to be used by the BackupVault for taking backups. Specify the email address of the Backup Vault Service Account.

BackupRule

BackupRule binds the backup schedule to a retention policy.

JSON representation
{
  "ruleId": string,
  "backupRetentionDays": integer,

  // Union field backup_schedule_oneof can be only one of the following:
  "standardSchedule": {
    object (StandardSchedule)
  }
  // End of list of possible types for union field backup_schedule_oneof.
}
Fields
ruleId

string

Required. Immutable. The unique id of this BackupRule. The ruleId is unique per BackupPlan.The ruleId must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, /[a-z][a-z0-9-]{,62}/.

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 90 for hourly backups. Minimum value is 1 and maximum value is 90 for daily backups. Minimum value is 7 and maximum value is 186 for weekly backups. Minimum value is 30 and maximum value is 732 for monthly backups. Minimum value is 30 and maximum value is 36159 for yearly backups.

Union field backup_schedule_oneof. Required.

The schedule that defines the automated backup workloads for this BackupRule. backup_schedule_oneof can be only one of the following:

standardSchedule

object (StandardSchedule)

Required. Defines a schedule that runs within the confines of a defined window of time.

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.

JSON representation
{
  "recurrenceType": enum (RecurrenceType),
  "hourlyFrequency": integer,
  "daysOfWeek": [
    enum (DayOfWeek)
  ],
  "daysOfMonth": [
    integer
  ],
  "weekDayOfMonth": {
    object (WeekDayOfMonth)
  },
  "months": [
    enum (Month)
  ],
  "backupWindow": {
    object (BackupWindow)
  },
  "timeZone": string
}
Fields
recurrenceType

enum (RecurrenceType)

Required. Specifies the RecurrenceType for the schedule.

hourlyFrequency

integer

Optional. Specifies frequency for hourly backups. A hourly frequency of 2 means jobs will run every 2 hours from start time till end time defined.

This is required for recurrenceType, HOURLY and is not applicable otherwise. A validation error will occur if a value is supplied and recurrenceType is not HOURLY.

Value of hourly frequency should be between 6 and 23.

Reason for limit : We found that there is bandwidth limitation of 3GB/S for GMI while taking a backup and 5GB/S while doing a restore. Given the amount of parallel backups and restore we are targeting, this will potentially take the backup time to mins and hours (in worst case scenario).

daysOfWeek[]

enum (DayOfWeek)

Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs will run.

This is required for recurrenceType, WEEKLY and is not applicable otherwise. A validation error will occur if a value is supplied and recurrenceType is not WEEKLY.

daysOfMonth[]

integer

Optional. Specifies days of months like 1, 5, or 14 on which jobs will run.

Values for daysOfMonth are only applicable for recurrenceType, MONTHLY and YEARLY. A validation error will occur if other values are supplied.

weekDayOfMonth

object (WeekDayOfMonth)

Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST MONDAY, on which jobs will run. This will be specified by two fields in WeekDayOfMonth, one for the day, e.g. MONDAY, and one for the week, e.g. LAST.

This field is only applicable for recurrenceType, MONTHLY and YEARLY. A validation error will occur if other values are supplied.

months[]

enum (Month)

Optional. Specifies the months of year, like FEBRUARY and/or MAY, on which jobs will run.

This field is only applicable when recurrenceType is YEARLY. A validation error will occur if other values are supplied.

backupWindow

object (BackupWindow)

Required. A BackupWindow defines the window of day during which backup jobs will run. Jobs are queued at the beginning of the window and will be marked as NOT_RUN if they do not start by the end of the window.

Note: running jobs will not be cancelled at the end of the window.

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 e.g., Europe/Paris.

RecurrenceType

RecurrenceTypes enumerates the applicable periodicity for the schedule.

Enums
RECURRENCE_TYPE_UNSPECIFIED recurrence type not set
HOURLY The BackupRule is to be applied hourly.
DAILY The BackupRule is to be applied daily.
WEEKLY The BackupRule is to be applied weekly.
MONTHLY The BackupRule is to be applied monthly.
YEARLY The BackupRule is to be applied yearly.

DayOfWeek

Represents a day of the week.

Enums
DAY_OF_WEEK_UNSPECIFIED The day of the week is unspecified.
MONDAY Monday
TUESDAY Tuesday
WEDNESDAY Wednesday
THURSDAY Thursday
FRIDAY Friday
SATURDAY Saturday
SUNDAY Sunday

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.

JSON representation
{
  "weekOfMonth": enum (WeekOfMonth),
  "dayOfWeek": enum (DayOfWeek)
}
Fields
weekOfMonth

enum (WeekOfMonth)

Required. Specifies the week of the month.

dayOfWeek

enum (DayOfWeek)

Required. Specifies the day of the week.

WeekOfMonth

WeekOfMonth enumerates possible weeks in the month, e.g. the first, third, or last week of the month.

Enums
WEEK_OF_MONTH_UNSPECIFIED The zero value. Do not use.
FIRST The first week of the month.
SECOND The second week of the month.
THIRD The third week of the month.
FOURTH The fourth week of the month.
LAST The last week of the month.

Month

Represents a month in the Gregorian calendar.

Enums
MONTH_UNSPECIFIED The unspecified month.
JANUARY The month of January.
FEBRUARY The month of February.
MARCH The month of March.
APRIL The month of April.
MAY The month of May.
JUNE The month of June.
JULY The month of July.
AUGUST The month of August.
SEPTEMBER The month of September.
OCTOBER The month of October.
NOVEMBER The month of November.
DECEMBER The month of December.

BackupWindow

BackupWindow defines a window of the day during which backup jobs will run.

JSON representation
{
  "startHourOfDay": integer,
  "endHourOfDay": integer
}
Fields
startHourOfDay

integer

Required. The hour of day (0-23) when the window starts for e.g. if value of start hour of day is 6 that mean backup window start at 6:00.

endHourOfDay

integer

Required. The hour of day (1-24) when the window end for e.g. 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 <= startHourOfDay < endHourOfDay <= 24

End hour of day is not include in backup window that mean if endHourOfDay= 10 jobs should start before 10:00.

State

State enumerates the possible states for a BackupPlan.

Enums
STATE_UNSPECIFIED State not set.
CREATING The resource is being created.
ACTIVE The resource has been created and is fully usable.
DELETING The resource is being deleted.
INACTIVE The resource has been created but is not usable.

Methods

create

Create a BackupPlan

delete

Deletes a single BackupPlan.

get

Gets details of a single BackupPlan.

list

Lists BackupPlans in a given project and location.