REST Resource: projects.locations.autoProtectionPolicies

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 (BackupPlanDetail)
    }
  ],
  "criteria": {
    object (Criteria)
  },
  "state": enum (State),
  "etag": string,
  "bindingSummary": {
    object (BindingSummary)
  },
  "policyEvaluationSummary": {
    object (PolicyEvaluationSummary)
  },
  "createTime": string,
  "updateTime": string
}
Fields
name

string

Identifier. The resource name of the AutoprotectionPolicy. Format: projects/{project}/locations/{location}/autoProtectionPolicies/{autoProtectionPolicy}

description

string

Optional. A description of the policy.

backupPlanDetails[]

object (BackupPlanDetail)

Required. The backup plan details for matching resources.

criteria

object (Criteria)

Required. The criteria for matching resources.

state

enum (State)

Output only. The current state of the AutoprotectionPolicy.

etag

string

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

object (BindingSummary)

Output only. Summary of total count of different containers covered through this policy.

policyEvaluationSummary

object (PolicyEvaluationSummary)

Output only. Summary of last policy application when job was run per workload type.

createTime

string (Timestamp format)

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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

updateTime

string (Timestamp format)

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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

BackupPlanDetail

BackupPlanDetail defines configuration of protection.

JSON representation
{
  "resourceType": string,
  "backupPlan": string
}
Fields
resourceType

string

Required. The type of resource that this policy will automatically protect. For MVP, compute.googleapis.com/Instance and compute.googleapis.com/Disk are supported.

backupPlan

string

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 (MatchingCondition)
    }
  ]
}
Fields
matchingConditions[]

object (MatchingCondition)

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 (KeyValuePair)
  }
  // End of mutually exclusive fields.
}
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

object (KeyValuePair)

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

string

Required. The key of the label to match. This must be in the format {labelKey}. The key must match the regex Format:[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}.

values[]

string

Required. The values of the label to match. There will be explicit "OR" between values of array. Each value must be in the format {labelValue}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

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

string (int64 format)

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

string (int64 format)

Output only. The number of resources that currently match the policy's criteria.

protectedResourceCount

string (int64 format)

Output only. The number of matching resources that are successfully protected.

failedResourceCount

string (int64 format)

Output only. The number of matching resources whose protection failed during job run.

Methods

create

Creates a new AutoProtectionPolicy in a given project and location.

delete

Deletes a single AutoProtectionPolicy.

get

Gets details of a single AutoProtectionPolicy.

list

Lists AutoProtectionPolicies for a given project and location.

patch

Updates the parameters of a single AutoProtectionPolicy.