Reference documentation and code samples for the Google Cloud AlloyDB for PostgreSQL V1 Client class QuantityBasedExpiry.
A backup's position in a quantity-based retention queue, of backups with
the same source cluster and type, with length, retention, specified by the
backup's retention policy.
Once the position is greater than the retention, the backup is eligible to
be garbage collected.
Example: 5 backups from the same source cluster and type with a
quantity-based retention of 3 and denoted by backup_id (position,
retention).
Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3).
Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3)
Generated from protobuf message google.cloud.alloydb.v1.Backup.QuantityBasedExpiry
Namespace
Google \ Cloud \ AlloyDb \ V1 \ Backup
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ retention_count
int
Output only. The backup's position among its backups with the same source cluster and type, by descending chronological order create time(i.e. newest first).
↳ total_retention_count
int
Output only. The length of the quantity-based queue, specified by the backup's retention policy.
getRetentionCount
Output only. The backup's position among its backups with the same source
cluster and type, by descending chronological order create time(i.e.
newest first).
Returns
Type
Description
int
setRetentionCount
Output only. The backup's position among its backups with the same source
cluster and type, by descending chronological order create time(i.e.
newest first).
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getTotalRetentionCount
Output only. The length of the quantity-based queue, specified by the
backup's retention policy.
Returns
Type
Description
int
setTotalRetentionCount
Output only. The length of the quantity-based queue, specified by the
backup's retention policy.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Google Cloud AlloyDB for PostgreSQL V1 Client - Class QuantityBasedExpiry (1.4.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.1 (latest)](/php/docs/reference/cloud-alloydb/latest/V1.Backup.QuantityBasedExpiry)\n- [1.4.0](/php/docs/reference/cloud-alloydb/1.4.0/V1.Backup.QuantityBasedExpiry)\n- [1.3.0](/php/docs/reference/cloud-alloydb/1.3.0/V1.Backup.QuantityBasedExpiry)\n- [1.2.0](/php/docs/reference/cloud-alloydb/1.2.0/V1.Backup.QuantityBasedExpiry)\n- [1.1.3](/php/docs/reference/cloud-alloydb/1.1.3/V1.Backup.QuantityBasedExpiry)\n- [1.0.0](/php/docs/reference/cloud-alloydb/1.0.0/V1.Backup.QuantityBasedExpiry)\n- [0.10.3](/php/docs/reference/cloud-alloydb/0.10.3/V1.Backup.QuantityBasedExpiry)\n- [0.9.0](/php/docs/reference/cloud-alloydb/0.9.0/V1.Backup.QuantityBasedExpiry)\n- [0.8.0](/php/docs/reference/cloud-alloydb/0.8.0/V1.Backup.QuantityBasedExpiry)\n- [0.7.1](/php/docs/reference/cloud-alloydb/0.7.1/V1.Backup.QuantityBasedExpiry)\n- [0.6.0](/php/docs/reference/cloud-alloydb/0.6.0/V1.Backup.QuantityBasedExpiry)\n- [0.5.0](/php/docs/reference/cloud-alloydb/0.5.0/V1.Backup.QuantityBasedExpiry)\n- [0.4.0](/php/docs/reference/cloud-alloydb/0.4.0/V1.Backup.QuantityBasedExpiry)\n- [0.3.0](/php/docs/reference/cloud-alloydb/0.3.0/V1.Backup.QuantityBasedExpiry)\n- [0.2.1](/php/docs/reference/cloud-alloydb/0.2.1/V1.Backup.QuantityBasedExpiry)\n- [0.1.3](/php/docs/reference/cloud-alloydb/0.1.3/V1.Backup.QuantityBasedExpiry) \nReference documentation and code samples for the Google Cloud AlloyDB for PostgreSQL V1 Client class QuantityBasedExpiry.\n\nA backup's position in a quantity-based retention queue, of backups with\nthe same source cluster and type, with length, retention, specified by the\nbackup's retention policy.\n\nOnce the position is greater than the retention, the backup is eligible to\nbe garbage collected.\nExample: 5 backups from the same source cluster and type with a\nquantity-based retention of 3 and denoted by backup_id (position,\nretention).\nSafe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3).\nAwaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3)\n\nGenerated from protobuf message `google.cloud.alloydb.v1.Backup.QuantityBasedExpiry`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ AlloyDb \\\\ V1 \\\\ Backup\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getRetentionCount\n\nOutput only. The backup's position among its backups with the same source\ncluster and type, by descending chronological order create time(i.e.\n\nnewest first).\n\n### setRetentionCount\n\nOutput only. The backup's position among its backups with the same source\ncluster and type, by descending chronological order create time(i.e.\n\nnewest first).\n\n### getTotalRetentionCount\n\nOutput only. The length of the quantity-based queue, specified by the\nbackup's retention policy.\n\n### setTotalRetentionCount\n\nOutput only. The length of the quantity-based queue, specified by the\nbackup's retention policy."]]