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

# POST /v1/{+parent}/backups

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

Creates a Backup for the given BackupPlan.

## Path parameters

- `parent` string, required

## Query parameters

- `backupId` string

## Request body

- Backup — Represents a request to perform a single point-in-time capture of some portion of the state of a GKE cluster, the record of the backup operation itself, and an anchor for the underlying artifacts that comprise the Backup (the config backup and VolumeBackups).
  - `allNamespaces` boolean — Output only. If True, all namespaces were included in the Backup.
  - `createTime` string, google-datetime — Output only. The timestamp when this Backup resource was created.
  - `manual` boolean — Output only. This flag indicates whether this Backup resource was created manually by a user or via a schedule in the BackupPlan. A value of True means that the Backup was created manually.
  - `state` 'STATE_UNSPECIFIED' | 'CREATING' | 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED' | 'DELETING' — Output only. Current state of the Backup
  - `resourceCount` integer — Output only. The total number of Kubernetes resources included in the Backup.
  - `retainDays` integer — Optional. The age (in days) after which this Backup will be automatically deleted. Must be an integer value >= 0: - If 0, no automatic deletion will occur for this Backup. - If not 0, this must be >= delete_lock_days and <= 365. Once a Backup is created, this value may only be increased. Defaults to the parent BackupPlan's backup_retain_days value.
  - `uid` string — Output only. Server generated global unique identifier of [UUID4](https://en.wikipedia.org/wiki/Universally_unique_identifier)
  - `selectedNamespaceLabels` ResourceLabels — A list of Kubernetes labels.
    - `resourceLabels` Label[] — Optional. A list of Kubernetes label-value pairs.
      - `key` string — Optional. The key/name of the label.
      - `value` string — Optional. The value of the label.
  - `sizeBytes` string, int64 — Output only. The total size of the Backup in bytes = config backup size + sum(volume backup sizes)
  - `namespaceCount` integer — Output only. The total number of user managed namespaces contained in the Backup.
  - `encryptionKey` EncryptionKey — Defined a customer managed encryption key that will be used to encrypt Backup artifacts.
    - `gcpKmsEncryptionKey` string — Optional. Google Cloud KMS encryption key. Format: `projects/*/locations/*/keyRings/*/cryptoKeys/*`
  - `troubleshootingInfo` TroubleshootingInfo — Stores information about troubleshooting doc for debugging a particular state of an operation (eg - backup/restore). This will be used by the end user to debug their operation failure scenario easily.
    - `stateReasonUri` string — Output only. URL for the troubleshooting doc which will help the user fix the failing backup/restore operation.
    - `stateReasonCode` string — Output only. Unique code for each backup/restore operation failure message which helps user identify the failure.
  - `retainExpireTime` string, google-datetime — Output only. The time at which this Backup will be automatically deleted (calculated from create_time + retain_days).
  - `selectedNamespaces` Namespaces — A list of Kubernetes Namespaces.
    - `namespaces` string[] — Optional. A list of Kubernetes Namespaces.
  - `deleteLockDays` integer — Optional. Minimum age for this Backup (in days). If this field is set to a non-zero value, the Backup will be "locked" against deletion (either manual or automatic deletion) for the number of days provided (measured from the creation time of the Backup). MUST be an integer value between 0-90 (inclusive). Defaults to parent BackupPlan's backup_delete_lock_days setting and may only be increased (either at creation time or in a subsequent update).
  - `name` string — Output only. Identifier. The fully qualified name of the Backup. `projects/*/locations/*/backupPlans/*/backups/*`
  - `containsVolumeData` boolean — Output only. Whether or not the Backup contains volume data. Controlled by the parent BackupPlan's include_volume_data value.
  - `selectedApplications` NamespacedNames — A list of namespaced Kubernetes resources.
    - `namespacedNames` NamespacedName[] — Optional. A list of namespaced Kubernetes resources.
      - `name` string — Optional. The name of the Kubernetes resource.
      - `namespace` string — Optional. The Namespace of the Kubernetes resource.
  - `permissiveMode` boolean — Output only. If false, Backup will fail when Backup for GKE detects Kubernetes configuration that is non-standard or requires additional setup to restore. Inherited from the parent BackupPlan's permissive_mode value.
  - `stateReason` string — Output only. Human-readable description of why the backup is in the current `state`. This field is only meant for human readability and should not be used programmatically as this field is not guaranteed to be consistent.
  - `podCount` integer — Output only. The total number of Kubernetes Pods contained in the Backup.
  - `updateTime` string, google-datetime — Output only. The timestamp when this Backup resource was last updated.
  - `satisfiesPzi` boolean — Output only. [Output Only] Reserved for future use.
  - `labels` object — Optional. A set of custom labels supplied by user.
  - `containsSecrets` boolean — Output only. Whether or not the Backup contains Kubernetes Secrets. Controlled by the parent BackupPlan's include_secrets value.
  - `etag` string — Output only. `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a backup from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform backup updates in order to avoid race conditions: An `etag` is returned in the response to `GetBackup`, and systems are expected to put that etag in the request to `UpdateBackup` or `DeleteBackup` to ensure that their change will be applied to the same version of the resource.
  - `volumeCount` integer — Output only. The total number of volume backups contained in the Backup.
  - `satisfiesPzs` boolean — Output only. [Output Only] Reserved for future use.
  - `clusterMetadata` ClusterMetadata — Information about the GKE cluster from which this Backup was created.
    - `cluster` string — Output only. The source cluster from which this Backup was created. Valid formats: - `projects/*/locations/*/clusters/*` - `projects/*/zones/*/clusters/*` This is inherited from the parent BackupPlan's cluster field.
    - `gkeVersion` string — Output only. GKE version
    - `backupCrdVersions` object — Output only. A list of the Backup for GKE CRD versions found in the cluster.
    - `k8sVersion` string — Output only. The Kubernetes server version of the source cluster.
    - `anthosVersion` string — Output only. Anthos version
  - `completeTime` string, google-datetime — Output only. Completion time of the Backup
  - `deleteLockExpireTime` string, google-datetime — Output only. The time at which an existing delete lock will expire for this backup (calculated from create_time + delete_lock_days).
  - `configBackupSizeBytes` string, int64 — Output only. The size of the config backup in bytes.
  - `description` string — Optional. User specified descriptive string for this Backup.

## Response `200`

Successful response

---

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