- Resource: AutoProtectionPolicy
- BackupPlanDetail
- Criteria
- MatchingCondition
- KeyValuePair
- State
- BindingSummary
- PolicyEvaluationSummary
- Methods
Resource: AutoProtectionPolicy
An AutoprotectionPolicy is a policy resource designed to automate backup management, moving from manual per-resource protection to a bulk approach. The policy dynamically discovers and applies a specified backup plan to all eligible resources that match its defined scope and criteria.
| JSON representation |
|---|
{ "name": string, "description": string, "backupPlanDetails": [ { object ( |
| Fields | |
|---|---|
name |
Identifier. The resource name of the AutoprotectionPolicy. Format: |
description |
Optional. A description of the policy. |
backupPlanDetails[] |
Required. The backup plan details for matching resources. |
criteria |
Required. The criteria for matching resources. |
state |
Output only. The current state of the AutoprotectionPolicy. |
etag |
Output only. The etag for the policy. If this is provided on update, it must match the server's etag, otherwise the request will be rejected with an ABORTED error. |
bindingSummary |
Output only. Summary of total count of different containers covered through this policy. |
policyEvaluationSummary |
Output only. Summary of last policy application when job was run per workload type. |
createTime |
Output only. The timestamp when the policy was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
updateTime |
Output only. The timestamp when the policy was last updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
BackupPlanDetail
BackupPlanDetail defines configuration of protection.
| JSON representation |
|---|
{ "resourceType": string, "backupPlan": string } |
| Fields | |
|---|---|
resourceType |
Required. The type of resource that this policy will automatically protect. For MVP, |
backupPlan |
Required. The resource name of the BackupPlan to apply to resources that match the policy's criteria. This backup plan must be in the same location as AutoProtectionPolicy. Format: projects/{project}/locations/{location}/backupPlans/{backupPlanId} |
Criteria
Criteria specifies a set of criteria for matching resources.
| JSON representation |
|---|
{
"matchingConditions": [
{
object ( |
| Fields | |
|---|---|
matchingConditions[] |
Required. A list of matching conditions that a resource must meet to be protected by the policy. |
MatchingCondition
MatchingCondition specifies a set of conditions for matching resources.
| JSON representation |
|---|
{
// The following is a list of mutually exclusive fields. At most one of the
// fields will be set in a response:
"labelCondition": {
object ( |
| Fields | |
|---|---|
| A condition that a resource must meet to be protected by the policy. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: | |
labelCondition |
Optional. A condition that matches resources based on their labels. For MVP, this is limited to a single label match. |
| End of mutually exclusive fields. | |
KeyValuePair
KeyValuePair defines a key-value pair for matching resource labels.
| JSON representation |
|---|
{ "key": string, "values": [ string ] } |
| Fields | |
|---|---|
key |
Required. The key of the label to match. This must be in the format |
values[] |
Required. The values of the label to match. There will be explicit "OR" between values of array. Each value must be in the format |
State
The state of an AutoprotectionPolicy.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
The state of the policy is unspecified. |
CREATING |
The policy is being created. |
ACTIVE |
The policy is active and protecting matching resources. |
UPDATING |
The policy is being updated. |
DELETING |
The policy is being deleted. |
BindingSummary
BindingSummary contains count of different containers covered through this policy.
| JSON representation |
|---|
{ "projectCount": string } |
| Fields | |
|---|---|
projectCount |
Output only. Total count of Projects protected with this policy. |
PolicyEvaluationSummary
PolicyEvaluationSummary contains the summary of the last run of job that applies policy to matching resources.
| JSON representation |
|---|
{ "matchingResourceCount": string, "protectedResourceCount": string, "failedResourceCount": string } |
| Fields | |
|---|---|
matchingResourceCount |
Output only. The number of resources that currently match the policy's criteria. |
protectedResourceCount |
Output only. The number of matching resources that are successfully protected. |
failedResourceCount |
Output only. The number of matching resources whose protection failed during job run. |
Methods |
|
|---|---|
|
Creates a new AutoProtectionPolicy in a given project and location. |
|
Deletes a single AutoProtectionPolicy. |
|
Gets details of a single AutoProtectionPolicy. |
|
Lists AutoProtectionPolicies for a given project and location. |
|
Updates the parameters of a single AutoProtectionPolicy. |