REST Resource: projects.locations.backupPlans

Resource: BackupPlan

Defines the configuration and scheduling for a "line" of Backups.

JSON representation
{
  "name": string,
  "uid": string,
  "createTime": string,
  "updateTime": string,
  "description": string,
  "cluster": string,
  "retentionPolicy": {
    object (RetentionPolicy)
  },
  "labels": {
    string: string,
    ...
  },
  "backupSchedule": {
    object (Schedule)
  },
  "etag": string,
  "deactivated": boolean,
  "backupConfig": {
    object (BackupConfig)
  },
  "protectedPodCount": integer,
  "state": enum (State),
  "stateReason": string,
  "rpoRiskLevel": integer,
  "rpoRiskReason": string
}
Fields
name

string

Output only. The full name of the BackupPlan resource. Format: projects/*/locations/*/backupPlans/*

uid

string

Output only. Server generated global unique identifier of UUID format.

createTime

string (Timestamp format)

Output only. The timestamp when this BackupPlan resource 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. The timestamp when this BackupPlan resource 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".

description

string

Optional. User specified descriptive string for this BackupPlan.

cluster

string

Required. Immutable. The source cluster from which Backups will be created via this BackupPlan. Valid formats:

  • projects/*/locations/*/clusters/*
  • projects/*/zones/*/clusters/*
retentionPolicy

object (RetentionPolicy)

Optional. RetentionPolicy governs lifecycle of Backups created under this plan.

labels

map (key: string, value: string)

Optional. A set of custom labels supplied by user.

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

backupSchedule

object (Schedule)

Optional. Defines a schedule for automatic Backup creation via this BackupPlan.

etag

string

Output only. etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a backup plan from overwriting each other. It is strongly suggested that systems make use of the 'etag' in the read-modify-write cycle to perform BackupPlan updates in order to avoid race conditions: An etag is returned in the response to backupPlans.get, and systems are expected to put that etag in the request to backupPlans.patch or backupPlans.delete to ensure that their change will be applied to the same version of the resource.

deactivated

boolean

Optional. This flag indicates whether this BackupPlan has been deactivated. Setting this field to True locks the BackupPlan such that no further updates will be allowed (except deletes), including the deactivated field itself. It also prevents any new Backups from being created via this BackupPlan (including scheduled Backups).

Default: False

backupConfig

object (BackupConfig)

Optional. Defines the configuration of Backups created via this BackupPlan.

protectedPodCount

integer

Output only. The number of Kubernetes Pods backed up in the last successful Backup created via this BackupPlan.

state

enum (State)

Output only. State of the BackupPlan. This State field reflects the various stages a BackupPlan can be in during the Create operation. It will be set to "DEACTIVATED" if the BackupPlan is deactivated on an Update

stateReason

string

Output only. Human-readable description of why BackupPlan is in the current state

rpoRiskLevel

integer

Output only. A number that represents the current risk level of this BackupPlan from RPO perspective with 1 being no risk and 5 being highest risk.

rpoRiskReason

string

Output only. Human-readable description of why the BackupPlan is in the current rpoRiskLevel and action items if any.

RetentionPolicy

RetentionPolicy defines a Backup retention policy for a BackupPlan.

JSON representation
{
  "backupDeleteLockDays": integer,
  "backupRetainDays": integer,
  "locked": boolean
}
Fields
backupDeleteLockDays

integer

Optional. Minimum age for Backups created via this BackupPlan (in days). This field MUST be an integer value between 0-90 (inclusive). A Backup created under this BackupPlan will NOT be deletable until it reaches Backup's (createTime + backupDeleteLockDays). Updating this field of a BackupPlan does NOT affect existing Backups under it. Backups created AFTER a successful update will inherit the new value.

Default: 0 (no delete blocking)

backupRetainDays

integer

Optional. The default maximum age of a Backup created via this BackupPlan. This field MUST be an integer value >= 0 and <= 365. If specified, a Backup created under this BackupPlan will be automatically deleted after its age reaches (createTime + backupRetainDays). If not specified, Backups created under this BackupPlan will NOT be subject to automatic deletion. Updating this field does NOT affect existing Backups under it. Backups created AFTER a successful update will automatically pick up the new value. NOTE: backupRetainDays must be >= backupDeleteLockDays. If cronSchedule is defined, then this must be <= 360 * the creation interval. If rpoConfig is defined, then this must be <= 360 * [targetRpoMinutes][Schedule.rpo_config.target_rpo_minutes] / (1440minutes/day).

Default: 0 (no automatic deletion)

locked

boolean

Optional. This flag denotes whether the retention policy of this BackupPlan is locked. If set to True, no further update is allowed on this policy, including the locked field itself.

Default: False

Schedule

Defines scheduling parameters for automatically creating Backups via this BackupPlan.

JSON representation
{
  "cronSchedule": string,
  "paused": boolean,
  "rpoConfig": {
    object (RpoConfig)
  },
  "nextScheduledBackupTime": string
}
Fields
cronSchedule

string

Optional. A standard cron string that defines a repeating schedule for creating Backups via this BackupPlan. This is mutually exclusive with the rpoConfig field since at most one schedule can be defined for a BackupPlan. If this is defined, then backupRetainDays must also be defined.

Default (empty): no automatic backup creation will occur.

paused

boolean

Optional. This flag denotes whether automatic Backup creation is paused for this BackupPlan.

Default: False

rpoConfig

object (RpoConfig)

Optional. Defines the RPO schedule configuration for this BackupPlan. This is mutually exclusive with the cronSchedule field since at most one schedule can be defined for a BackupPLan. If this is defined, then backupRetainDays must also be defined.

Default (empty): no automatic backup creation will occur.

nextScheduledBackupTime

string (Timestamp format)

Output only. Start time of next scheduled backup under this BackupPlan by either cronSchedule or rpo config.

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".

RpoConfig

Defines RPO scheduling configuration for automatically creating Backups via this BackupPlan.

JSON representation
{
  "targetRpoMinutes": integer,
  "exclusionWindows": [
    {
      object (ExclusionWindow)
    }
  ]
}
Fields
targetRpoMinutes

integer

Required. Defines the target RPO for the BackupPlan in minutes, which means the target maximum data loss in time that is acceptable for this BackupPlan. This must be at least 60, i.e., 1 hour, and at most 86400, i.e., 60 days.

exclusionWindows[]

object (ExclusionWindow)

Optional. User specified time windows during which backup can NOT happen for this BackupPlan - backups should start and finish outside of any given exclusion window. Note: backup jobs will be scheduled to start and finish outside the duration of the window as much as possible, but running jobs will not get canceled when it runs into the window. All the time and date values in exclusionWindows entry in the API are in UTC. We only allow <=1 recurrence (daily or weekly) exclusion window for a BackupPlan while no restriction on number of single occurrence windows.

ExclusionWindow

Defines a time window during which no backup should happen. All time and date are in UTC.

JSON representation
{
  "startTime": {
    object (TimeOfDay)
  },
  "duration": string,

  // Union field recurrence can be only one of the following:
  "singleOccurrenceDate": {
    object (Date)
  },
  "daily": boolean,
  "daysOfWeek": {
    object (DayOfWeekList)
  }
  // End of list of possible types for union field recurrence.
}
Fields
startTime

object (TimeOfDay)

Required. Specifies the start time of the window using time of the day in UTC.

duration

string (Duration format)

Required. Specifies duration of the window. Duration must be >= 5 minutes and < (target RPO - 20 minutes). Additional restrictions based on the recurrence type to allow some time for backup to happen: - singleOccurrenceDate: no restriction, but UI may warn about this when duration >= target RPO - daily window: duration < 24 hours - weekly window: - days of week includes all seven days of a week: duration < 24 hours - all other weekly window: duration < 168 hours (i.e., 24 * 7 hours)

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

Union field recurrence. Required. Specifies the day(s) on which the exclusion window takes effect. Exactly one of the fields MUST be specified. recurrence can be only one of the following:
singleOccurrenceDate

object (Date)

No recurrence. The exclusion window occurs only once and on this date in UTC.

daily

boolean

The exclusion window occurs every day if set to "True". Specifying this field to "False" is an error.

daysOfWeek

object (DayOfWeekList)

The exclusion window occurs on these days of each week in UTC.

TimeOfDay

Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and google.protobuf.Timestamp.

JSON representation
{
  "hours": integer,
  "minutes": integer,
  "seconds": integer,
  "nanos": integer
}
Fields
hours

integer

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

minutes

integer

Minutes of hour of day. Must be from 0 to 59.

seconds

integer

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

nanos

integer

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

Date

Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:

  • A full date, with non-zero year, month, and day values.
  • A month and day, with a zero year (for example, an anniversary).
  • A year on its own, with a zero month and a zero day.
  • A year and month, with a zero day (for example, a credit card expiration date).

Related types:

JSON representation
{
  "year": integer,
  "month": integer,
  "day": integer
}
Fields
year

integer

Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

month

integer

Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

day

integer

Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

DayOfWeekList

Holds repeated DaysOfWeek values as a container.

JSON representation
{
  "daysOfWeek": [
    enum (DayOfWeek)
  ]
}
Fields
daysOfWeek[]

enum (DayOfWeek)

Optional. A list of days of week.

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

BackupConfig

BackupConfig defines the configuration of Backups created via this BackupPlan.

JSON representation
{
  "includeVolumeData": boolean,
  "includeSecrets": boolean,
  "encryptionKey": {
    object (EncryptionKey)
  },
  "permissiveMode": boolean,

  // Union field backup_scope can be only one of the following:
  "allNamespaces": boolean,
  "selectedNamespaces": {
    object (Namespaces)
  },
  "selectedApplications": {
    object (NamespacedNames)
  }
  // End of list of possible types for union field backup_scope.
}
Fields
includeVolumeData

boolean

Optional. This flag specifies whether volume data should be backed up when PVCs are included in the scope of a Backup.

Default: False

includeSecrets

boolean

Optional. This flag specifies whether Kubernetes Secret resources should be included when they fall into the scope of Backups.

Default: False

encryptionKey

object (EncryptionKey)

Optional. This defines a customer managed encryption key that will be used to encrypt the "config" portion (the Kubernetes resources) of Backups created via this plan.

Default (empty): Config backup artifacts will not be encrypted.

permissiveMode

boolean

Optional. If false, Backups will fail when Backup for GKE detects Kubernetes configuration that is non-standard or requires additional setup to restore.

Default: False

Union field backup_scope. This defines the "scope" of the Backup - which namespaced resources in the cluster will be included in a Backup. Exactly one of the fields of backup_scope MUST be specified. backup_scope can be only one of the following:
allNamespaces

boolean

If True, include all namespaced resources

selectedNamespaces

object (Namespaces)

If set, include just the resources in the listed namespaces.

selectedApplications

object (NamespacedNames)

If set, include just the resources referenced by the listed ProtectedApplications.

State

State

Enums
STATE_UNSPECIFIED Default first value for Enums.
CLUSTER_PENDING Waiting for cluster state to be RUNNING.
PROVISIONING The BackupPlan is in the process of being created.
READY The BackupPlan has successfully been created and is ready for Backups.
FAILED BackupPlan creation has failed.
DEACTIVATED The BackupPlan has been deactivated.
DELETING The BackupPlan is in the process of being deleted.

Methods

create

Creates a new BackupPlan in a given location.

delete

Deletes an existing BackupPlan.

get

Retrieve the details of a single BackupPlan.

getIamPolicy

Gets the access control policy for a resource.

list

Lists BackupPlans in a given location.

patch

Update a BackupPlan.

setIamPolicy

Sets the access control policy on the specified resource.

testIamPermissions

Returns permissions that a caller has on the specified resource.