## gkebackup.gke.io/v1

Contains the API schema definitions for the gkebackup.gke.io v1 API group.

### BackupAllRestoreAll

Defines a strategy that backs up everything selected in
this component, and restores everything during restoration.

*Appears in:*
- [Strategy](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#strategy)

| Field | Description |
|---|---|
| `backupPreHooks` *[HookSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#hookspec) array* | A list of hooks that are executed before backing up all selected volumes of this component. These are usually the quiesce steps. The execution target Pods are all Pods within this component. |
| `backupPostHooks` *[HookSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#hookspec) array* | A list of hooks that are executed after all volumes of this component are backed up. These are usually the un-quiesce steps. The execution target Pods are all Pods within this component. |
| `volumeSelector` *[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#labelselector-v1-meta)* | A label selector that is used to select persistent volumes that are backed up and restored within this component. All persistent volumes are selected if this is not provided. |

### BackupJobList

Contains a list of backup jobs.

| Field | Description |
|---|---|
| `apiVersion` *string* | `gkebackup.gke.io/v1` |
| `kind` *string* | `BackupJobList` |
| `metadata` *[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#listmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `items` *[BackupJob](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#backupjob) array* |   |

### BackupJobSpec

Defines the desired state of the backup job.

*Appears in:*
- [BackupJob](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#backupjob)

| Field | Description |
|---|---|
| `backupName` *string* | The control plane backup name that the backup job is executing against. The name is immutable. |

### BackupJobStatus

Defines the observed state of the backup job.

*Appears in:*
- [BackupJob](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#backupjob)

| Field | Description |
|---|---|
| `phase` *BackupJobPhase* | The current phase of the backup. |
| `message` *string* | A human-readable message indicating details about why the backup is in this state. |
| `reason` *string* | A brief camel case string that describes any update and is used for machine parsing and tidy display. |

### BackupOneRestoreAll

Defines a strategy that only backs up volumes from one Pod
within this component, and these volumes are restored to all other Pods during
restoration. This strategy is used for applications that are deployed
in a high-availability configuration of one primary and one or more secondaries. This strategy is
exclusively applicable to `StatefulSet` components that use
a defined `volumeClaimTemplate` resource to provision volumes.

If a component consists of multiple `Deployment` resources,
all deployments must have exactly one replica,
all replicas must have the same number of persistent volumes,
and all persistent volumes must be defined in the same order.
These volumes are defined in the `.spec.template.spec.volumes` field,
and non-persistent volumes will be skipped.

If a component consists of multiple `StatefulSet` resources,
all `StatefulSet` resources must have the same number of volume claim templates,
and all volume claim templates must follow the same order. They are defined
in the `.spec.volumeClaimTemplates` field.

*Appears in:*
- [Strategy](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#strategy)

| Field | Description |
|---|---|
| `backupTargetName` *string* | The name of the preferred `Deployment` or `StatefulSet` resource that is used for backup. We selectthe target Pod based on how this component is composed. For multi-`Deployment`, pick the only Pod created by this `Deployment` resource. For multi-`StatefulSet`, pick the first Pod created by the target `StatefulSet` resource. For single-`StatefulSet`, pick the second Pod created by the target `StatefulSet` resource. |
| `backupPreHooks` *[HookSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#hookspec) array* | A list of hooks that are executed before backing up all selected volumes of this component. These are usually the quiesce steps. Hooks are only executed on the selected backup Pod. |
| `backupPostHooks` *[HookSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#hookspec) array* | A list of hooks that are executed after all volumes of this component are backed up. These are usually the un-quiesce steps. Hooks are only executed on selected backup Pod. |
| `volumeSelector` *[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#labelselector-v1-meta)* | A label selector that is used to select all persistent volumes that are backed up within the target Pod. It is possible that the selector will select volumes outside of the target Pod, but only volumes belonging to the target Pod are backed up. Those volume backups are restored to all other volumes selected by the selector during restoration. All persistent volumes are selected if this is not provided. |

### Component

Defines a subset of application resources and their backup and
restore strategies. An individual component is represented either by
a list of `StatefulSet` or `Deployment` resources.

*Appears in:*
- [ProtectedApplicationSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplicationspec)

| Field | Description |
|---|---|
| `name` *string* | The unique name of this component. |
| `resourceKind` *[ResourceKind](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#resourcekind)* | The kind of resources included in this component. The resource kind can only be `Deployment` or `StatefulSet` or `Pod`. The `Pod` resource kind only supports the `BackupAllRestoreAll` strategy at this time. |
| `resourceNames` *string array* | The names of resources which belong to this component. It must be a list of names of `Deployment`, `StatefulSet`, or `Pod` resources based on what is defined in the `resourceKind` field. |
| `strategy` *[Strategy](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#strategy)* | The details of how to back up and restore this component. |

### DumpAndLoad

Defines a strategy where backup and restore of a component is
achieved using application specific tools for dumping and loading data,
like `mysqldump` for MySQL or `pg_dump` for PostgreSQL. Dump files are
stored in a dedicated volume. Only the dedicated volumes are
selected to be backed up for this strategy. The dump target and load target
could be different. This strategy is exclusively applicable to `StatefulSet`
components that use a defined `volumeClaimTemplate` resource to provision volumes.

*Appears in:*
- [Strategy](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#strategy)

| Field | Description |
|---|---|
| `dumpTarget` *string* | The name of a preferred `Deployment` or `StatefulSet` resource that is used to dump the component data. We select the target Pod based on how this component is composed. For `Deployment`, pick the only Pod created by the target `Deployment` resource. For single-`StatefulSet`, pick the second Pod created by the target `StatefulSet` resource if the replica number is greater than two. Otherwise, pick the only Pod. For multi-`StatefulSet`, pick the first Pod created by the target `StatefulSet` resource. |
| `loadTarget` *string* | The name of the preferred `Deployment` or `StatefulSet` resource that is used to load the component data. We select the target Pod based on how this component is composed. For `Deployment`, pick the only Pod created by target `Deployment` resource. For `StatefulSet`, always pick the first Pod created by target `StatefulSet` resource. |
| `dumpHooks` *[HookSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#hookspec) array* | A list of hooks that are used to dump the data of this component into a dedicated volume. The execution target Pod is one of the Pods selected from the `DumpTarget` field. |
| `backupPostHooks` *[HookSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#hookspec) array* | A list of hooks that are executed after a dedicated dump volume is backed up. These are usually clean up steps. |
| `loadHooks` *[HookSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#hookspec) array* | A list of hooks that are used to load the data of this component from a dedicated volume. It might include clean up steps after the load is completed. The execution target Pod is one of the Pods selected from the `LoadTarget` field. |
| `volumeSelector` *[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#labelselector-v1-meta)* | A label selector that must select dedicated volumes that are used to dump and load the application data. Only one volume must be selected in both the `DumpTarget` and `LoadTarget` fields. |

### HookFailurePolicy

*Underlying type:* `string`
The desired behavior to take if hook execution runs into error.

*Appears in:*
- [HookSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#hookspec)

### HookSpec

Defines how a hook is executed in a selected container, assuming
the target Pod has been selected.

*Appears in:*
- [BackupAllRestoreAll](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#backupallrestoreall)
- [BackupOneRestoreAll](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#backuponerestoreall)
- [DumpAndLoad](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#dumpandload)

| Field | Description |
|---|---|
| `name` *string* | The name of this hook. This field is used to identify the status of hook execution, and any errors that are encountered. |
| `container` *string* | The container that this hook executes on. If unspecified, it executes on the first container of the Pod. |
| `command` *string array* | The command to execute. The hook command to run. For example, `["/sbin/fsfreeze", "--freeze"]`. |
| `timeoutSeconds` *integer* | The timeout of the hook in seconds. If unspecified, the default value is `30`. |
| `onError` *[HookFailurePolicy](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#hookfailurepolicy)* | The desired behavior to follow when the hook execution runs into an error. Valid values are `Ignore` or `Fail`. If unspecified, the value will be `Fail`. |

### ProtectedApplication

Defines the schema for the `Protectedapplication` API.

*Appears in:*
- [ProtectedApplicationList](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplicationlist)

| Field | Description |
|---|---|
| `apiVersion` *string* | `gkebackup.gke.io/v1` |
| `kind` *string* | `ProtectedApplication` |
| `metadata` *[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `spec` *[ProtectedApplicationSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplicationspec)* |   |
| `status` *[ProtectedApplicationStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplicationstatus)* |   |

### ProtectedApplicationError

Contains detailed error information for this
`ProtectedApplication` resource.

*Appears in:*
- [ProtectedApplicationStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplicationstatus)

| Field | Description |
|---|---|
| `reason` *string* | A camel case string that describes any error and is used for machine parsing and tidy display. |
| `message` *string* | A human-readable message indicating details about the error. |

### ProtectedApplicationList

Contains a list of `ProtectedApplication` resources.

| Field | Description |
|---|---|
| `apiVersion` *string* | `gkebackup.gke.io/v1` |
| `kind` *string* | `ProtectedApplicationList` |
| `metadata` *[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#listmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `items` *[ProtectedApplication](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplication) array* |   |

### ProtectedApplicationSpec

Defines relevant resources that belong to a `ProtectedApplication`,
and how the given application must be backed up or restored.

*Appears in:*
- [ProtectedApplication](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplication)

| Field | Description |
|---|---|
| `resourceSelection` *[ResourceSelection](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#resourceselection)* | The resources that belong to this `ProtectedApplication`. |
| `components` *[Component](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#component) array* | The components of this protected application. |

### ProtectedApplicationStatus

Defines the status of this `ProtectedApplication` resource.

*Appears in:*
- [ProtectedApplication](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplication)

| Field | Description |
|---|---|
| `readyToBackup` *boolean* | Specifies whether this `ProtectedApplication` resource is ready to backup. A `ProtectedApplication` resource is not ready if it contains any errors. |
| `error` *[ProtectedApplicationError](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplicationerror) array* | The errors relating to this protected application. For example, one component configuration is invalid. |

### ResourceKind

*Underlying type:* `string`
Defines the kind of the resource.

*Appears in:*
- [Component](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#component)

### ResourceSelection

Defines how to identify the resources belonging to this application.

*Appears in:*
- [ProtectedApplicationSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#protectedapplicationspec)

| Field | Description |
|---|---|
| `type` *[ResourceSelectionType](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#resourceselectiontype)* | The type of application source. The `Type` field must be `ApplicationName` or `Selector`. This is the union discriminator. |
| `applicationName` *string* | The name of a sig-apps application within the same namespace. This is the application the data protection specification applies to. |
| `selector` *[LabelSelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#labelselector-v1-meta)* | The resources in the same namespace as the `ProtectedApplication` resource that are selected. The data protection specification is applied to these resources. |

### ResourceSelectionType

*Underlying type:* `string`
The types of selection.

*Appears in:*
- [ResourceSelection](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#resourceselection)

### RestoreJob

Defines the schema for the `RestoreJob` API

*Appears in:*
- [RestoreJobList](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#restorejoblist)

| Field | Description |
|---|---|
| `apiVersion` *string* | `gkebackup.gke.io/v1` |
| `kind` *string* | `RestoreJob` |
| `metadata` *[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `spec` *[RestoreJobSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#restorejobspec)* |   |
| `status` *[RestoreJobStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#restorejobstatus)* |   |

### RestoreJobList

Contains a list of `RestoreJob` resources.

| Field | Description |
|---|---|
| `apiVersion` *string* | `gkebackup.gke.io/v1` |
| `kind` *string* | `RestoreJobList` |
| `metadata` *[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#listmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `items` *[RestoreJob](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#restorejob) array* |   |

### RestoreJobSpec

Defines the desired state of a restoration.

*Appears in:*
- [RestoreJob](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#restorejob)

| Field | Description |
|---|---|
| `restoreName` *string* | RestoreName is the control plane Restore name that the RestoreJob is executing against. The name is immutable. |

### RestoreJobStatus

Defines the observed state of a restore job.

*Appears in:*
- [RestoreJob](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#restorejob)

| Field | Description |
|---|---|
| `phase` *RestoreJobPhase* | The current status of a restore. |
| `message` *string* | A human-readable message indicating details about why the backup restoration is in this state. |
| `reason` *string* | A camel case string that describes any update and is used for machine parsing and tidy display. |

### Strategy

Defines how to back up and restore for a particular component. It
must be one of `BackupAllRestoreAll`, `BackupOneRestoreAll`, or `DumpAndLoad`.

*Appears in:*
- [Component](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#component)

| Field | Description |
|---|---|
| `type` *[StrategyType](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#strategytype)* | The type of backup and restore strategy. The value can only be either `BackupAllRestoreAll`, `BackupOneRestoreAll`, or `DumpAndLoad`. Note, the `Pod` resource kind only supports the `BackupAllRestoreAll` strategy. This is the union discriminator. |
| `backupAllRestoreAll` *[BackupAllRestoreAll](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#backupallrestoreall)* | A strategy that backs up everything selected in this component, and restores everything during restoration. |
| `backupOneRestoreAll` *[BackupOneRestoreAll](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#backuponerestoreall)* | A strategy that only backs up volumes from one Pod within this component, and are restored to all other Pods during restoration. This strategy is used for applications that are deployed in a high availability configuration of one primary and one or more secondaries. This strategy is exclusively applicable to `StatefulSet` components that use a defined `volumeClaimTemplate` resource to provision volumes. |
| `dumpAndLoad` *[DumpAndLoad](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#dumpandload)* | A strategy where the backup and restore of a component is achieved using application specific tools for dumping and loading data, like `mysqldump` for MySQL or `pg_dump` for PostgreSQL. Dump files are stored in a dedicated volume. Only the dedicated volume must be selected to be backed up for this strategy. The dump target and load target could be different. This strategy is exclusively applicable to `StatefulSet` components that use a defined `volumeClaimTemplate` resource to provision volumes. |

### StrategyType

*Underlying type:* `string`
Defines the backup and restore strategies of a component.

*Appears in:*
- [Strategy](https://docs.cloud.google.com/distributed-cloud/hosted/docs/1.16/gdcag/apis/service/backup/v1/gkebackup-agent-v1#strategy)