Branch
Branch object
- namestring
Output only. The full resource path of the branch. Format: projects/{project_id}/branches/{branch_id}
- uidstring
System-generated unique ID for the branch.
- parentstring
The project containing this branch (API resource hierarchy). Format: projects/{project_id}
Note: This field indicates where the branch exists in the resource hierarchy. For point-in-time branching from another branch, see
status.source_branch.
- create_timestring
A timestamp indicating when the branch was created.
- update_timestring
A timestamp indicating when the branch was last updated.
- specobject
The spec contains the branch configuration.
Show child attributesHide child attributes
- source_branchstring
The name of the source branch from which this branch was created (data lineage for point-in-time recovery). If not specified, defaults to the project's default branch. Format: projects/{project_id}/branches/{branch_id}
- source_branch_lsnstring
The Log Sequence Number (LSN) on the source branch from which this branch was created.
- source_branch_timestring
The point in time on the source branch from which this branch was created.
- is_protectedboolean
When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected.
- expire_timestring
Absolute expiration timestamp. When set, the branch will expire at this time. Mutually exclusive with
ttlandno_expiry. When updating, usespec.expirationin the update_mask.
- ttlstring
Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. Mutually exclusive with
expire_timeandno_expiry. When updating, usespec.expirationin the update_mask.
- no_expiryboolean
Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead. Mutually exclusive with
expire_timeandttl. When updating, usespec.expirationin the update_mask.
- statusobject
The current status of a Branch.
Show child attributesHide child attributes
- source_branchstring
The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
- source_branch_lsnstring
The Log Sequence Number (LSN) on the source branch from which this branch was created.
- source_branch_timestring
The point in time on the source branch from which this branch was created.
- defaultboolean
Whether the branch is the project's default branch.
- is_protectedboolean
Whether the branch is protected.
- current_statestring
The branch's state, indicating if it is initializing, ready for use, or archived.
- pending_statestring
The pending state of the branch, if a state transition is in progress.
- state_change_timestring
A timestamp indicating when the
current_statebegan.
- logical_size_bytesint64
The logical size of the branch.
- expire_timestring
Absolute expiration time for the branch. Empty if expiration is disabled.
- branch_idstring
Part of the resource name.
- branch_idstring
The part of the name, chosen by the user when the resource was created.
Get GA
GET
Retrieves information about the specified database branch.
API scopes: postgres
Parameters
- namestringpath
The full resource path of the branch to retrieve. Format: projects/{project_id}/branches/{branch_id}
Response
Returns the Branch object.
List GA
GET
Returns a paginated list of database branches in the project.
API scopes: postgres
Parameters
- parentstringpath
The Project that owns this collection of branches. Format: projects/{project_id}
- page_tokenstringquery
Page token from a previous response. If not provided, returns the first page.
- page_sizeint32query
Upper bound for items returned. Cannot be negative.
Response
Returns a list of Branch objects.
Create GA
POST
Creates a new database branch in the project.
API scopes: postgres
Parameters
- parentstringpath
The Project where this Branch will be created. Format: projects/{project_id}
- branch_idstringquery
The ID to use for the Branch. This becomes the final component of the branch's resource name. The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example,
developmentbecomesprojects/my-app/branches/development.
- replace_existingbooleanquery
If true, update the branch if it already exists instead of returning an error.
Request body
- branchobject
The Branch to create.
Show child attributesHide child attributes
- namestring
Output only. The full resource path of the branch. Format: projects/{project_id}/branches/{branch_id}
- uidstring
System-generated unique ID for the branch.
- parentstring
The project containing this branch (API resource hierarchy). Format: projects/{project_id}
Note: This field indicates where the branch exists in the resource hierarchy. For point-in-time branching from another branch, see
status.source_branch.
- create_timestring
A timestamp indicating when the branch was created.
- update_timestring
A timestamp indicating when the branch was last updated.
- specobject
The spec contains the branch configuration.
Show child attributesHide child attributes
- source_branchstring
The name of the source branch from which this branch was created (data lineage for point-in-time recovery). If not specified, defaults to the project's default branch. Format: projects/{project_id}/branches/{branch_id}
- source_branch_lsnstring
The Log Sequence Number (LSN) on the source branch from which this branch was created.
- source_branch_timestring
The point in time on the source branch from which this branch was created.
- is_protectedboolean
When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected.
- expire_timestringRequired
Absolute expiration timestamp. When set, the branch will expire at this time. Mutually exclusive with
ttlandno_expiry. When updating, usespec.expirationin the update_mask.
- ttlstringRequired
Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. Mutually exclusive with
expire_timeandno_expiry. When updating, usespec.expirationin the update_mask.
- no_expirybooleanRequired
Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead. Mutually exclusive with
expire_timeandttl. When updating, usespec.expirationin the update_mask.
- statusobject
The current status of a Branch.
Show child attributesHide child attributes
- source_branchstring
The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
- source_branch_lsnstring
The Log Sequence Number (LSN) on the source branch from which this branch was created.
- source_branch_timestring
The point in time on the source branch from which this branch was created.
- defaultboolean
Whether the branch is the project's default branch.
- is_protectedboolean
Whether the branch is protected.
- current_statestring
The branch's state, indicating if it is initializing, ready for use, or archived.
- pending_statestring
The pending state of the branch, if a state transition is in progress.
- state_change_timestring
A timestamp indicating when the
current_statebegan.
- logical_size_bytesint64
The logical size of the branch.
- expire_timestring
Absolute expiration time for the branch. Empty if expiration is disabled.
- branch_idstring
Part of the resource name.
- branch_idstring
The part of the name, chosen by the user when the resource was created.
Response
- namestring
The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the
nameshould be a resource name ending withoperations/{unique_id}.
- metadataobject
Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata.
- doneboolean
If the value is
false, it means the operation is still in progress. Iftrue, the operation is completed, and eithererrororresponseis available.
- errorobjectRequired
The error result of the operation in case of failure or cancellation.
Show child attributesHide child attributes
- error_codestring
- messagestring
- stack_tracestring
- detailsarray of object
- responseobjectRequired
The normal, successful response of the operation.
Update GA
PATCH
Updates the specified database branch. You can set this branch as the project's default branch, or protect/unprotect it.
API scopes: postgres
Parameters
- branchobjectpath
The Branch to update.
The branch's
namefield is used to identify the branch to update. Format: projects/{project_id}/branches/{branch_id}Show child attributesHide child attributes
- namestring
Output only. The full resource path of the branch. Format: projects/{project_id}/branches/{branch_id}
- uidstring
System-generated unique ID for the branch.
- parentstring
The project containing this branch (API resource hierarchy). Format: projects/{project_id}
Note: This field indicates where the branch exists in the resource hierarchy. For point-in-time branching from another branch, see
status.source_branch.
- create_timestring
A timestamp indicating when the branch was created.
- update_timestring
A timestamp indicating when the branch was last updated.
- specobject
The spec contains the branch configuration.
Show child attributesHide child attributes
- source_branchstring
The name of the source branch from which this branch was created (data lineage for point-in-time recovery). If not specified, defaults to the project's default branch. Format: projects/{project_id}/branches/{branch_id}
- source_branch_lsnstring
The Log Sequence Number (LSN) on the source branch from which this branch was created.
- source_branch_timestring
The point in time on the source branch from which this branch was created.
- is_protectedboolean
When set to true, protects the branch from deletion and reset. Associated compute endpoints and the project cannot be deleted while the branch is protected.
- expire_timestringRequired
Absolute expiration timestamp. When set, the branch will expire at this time. Mutually exclusive with
ttlandno_expiry. When updating, usespec.expirationin the update_mask.
- ttlstringRequired
Relative time-to-live duration. When set, the branch will expire at creation_time + ttl. Mutually exclusive with
expire_timeandno_expiry. When updating, usespec.expirationin the update_mask.
- no_expirybooleanRequired
Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead. Mutually exclusive with
expire_timeandttl. When updating, usespec.expirationin the update_mask.
- statusobject
The current status of a Branch.
Show child attributesHide child attributes
- source_branchstring
The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
- source_branch_lsnstring
The Log Sequence Number (LSN) on the source branch from which this branch was created.
- source_branch_timestring
The point in time on the source branch from which this branch was created.
- defaultboolean
Whether the branch is the project's default branch.
- is_protectedboolean
Whether the branch is protected.
- current_statestring
The branch's state, indicating if it is initializing, ready for use, or archived.
- pending_statestring
The pending state of the branch, if a state transition is in progress.
- state_change_timestring
A timestamp indicating when the
current_statebegan.
- logical_size_bytesint64
The logical size of the branch.
- expire_timestring
Absolute expiration time for the branch. Empty if expiration is disabled.
- branch_idstring
Part of the resource name.
- branch_idstring
The part of the name, chosen by the user when the resource was created.
- update_maskstringquery
The list of fields to update.
Response
- namestring
The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the
nameshould be a resource name ending withoperations/{unique_id}.
- metadataobject
Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata.
- doneboolean
If the value is
false, it means the operation is still in progress. Iftrue, the operation is completed, and eithererrororresponseis available.
- errorobjectRequired
The error result of the operation in case of failure or cancellation.
Show child attributesHide child attributes
- error_codestring
- messagestring
- stack_tracestring
- detailsarray of object
- responseobjectRequired
The normal, successful response of the operation.
Delete GA
DELETE
Deletes the specified database branch.
API scopes: postgres
Parameters
- namestringpath
The full resource path of the branch to delete. Format: projects/{project_id}/branches/{branch_id}
Response
- namestring
The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the
nameshould be a resource name ending withoperations/{unique_id}.
- metadataobject
Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata.
- doneboolean
If the value is
false, it means the operation is still in progress. Iftrue, the operation is completed, and eithererrororresponseis available.
- errorobjectRequired
The error result of the operation in case of failure or cancellation.
Show child attributesHide child attributes
- error_codestring
- messagestring
- stack_tracestring
- detailsarray of object
- responseobjectRequired
The normal, successful response of the operation.