w.postgres: Postgres¶
- class databricks.sdk.service.postgres.PostgresAPI¶
Use the Postgres API to create and manage Lakebase Autoscaling Postgres infrastructure, including projects, branches, compute endpoints, and roles.
This API manages database infrastructure only. To query or modify data, use the Data API or direct SQL connections.
About resource IDs and names
Resources are identified by hierarchical resource names like
projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}. Thenamefield on each resource contains this full path and is output-only. Note thatnamerefers to this resource path, not the user-visibledisplay_name.- create_branch(parent: str, branch: Branch, branch_id: str [, replace_existing: Optional[bool]]) CreateBranchOperation¶
Creates a new database branch in the project.
- Parameters:
parent – str The Project where this Branch will be created. Format: projects/{project_id}
branch –
BranchThe Branch to create.branch_id – str 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_existing – bool (optional) If true, update the branch if it already exists instead of returning an error.
- Returns:
- create_catalog(catalog: Catalog, catalog_id: str) CreateCatalogOperation¶
Register a Postgres database in the Unity Catalog.
- create_cdf_config(parent: str, cdf_config: CdfConfig [, cdf_config_id: Optional[str]]) CreateCdfConfigOperation¶
Create a CDF configuration that materializes the change data feed for all tables in a Postgres schema as open-format Delta tables in Unity Catalog. Once created, each table’s change history is continuously written to its corresponding Lakehouse table.
- Parameters:
parent – str The parent database under which to create the CdfConfig. Format: projects/{project}/branches/{branch}/databases/{database}
cdf_config –
CdfConfigThe CdfConfig to create. The catalog, schema, and postgres_schema fields are required; all other fields are output only and ignored on input.cdf_config_id – str (optional) The user-specified id for the CdfConfig, forming the final segment of its resource name. Must match the pattern
[a-z][a-z0-9_]{0,62}. Defaults to the Postgres schema name when omitted.
- Returns:
- create_data_api(parent: str, data_api: DataApi) CreateDataApiOperation¶
Enable Data API for a database.
- create_database(parent: str, database: Database [, database_id: Optional[str], replace_existing: Optional[bool]]) CreateDatabaseOperation¶
Create a Database.
Creates a database in the specified branch. A branch can have multiple databases.
- Parameters:
parent – str The Branch where this Database will be created. Format: projects/{project_id}/branches/{branch_id}
database –
DatabaseThe desired specification of a Database.database_id –
str (optional) The ID to use for the Database, which will become the final component of the database’s resource name. This ID becomes the database name in postgres.
This value should be 4-63 characters, and only use characters available in DNS names, as defined by RFC-1123
If database_id is not specified in the request, it is generated automatically.
replace_existing – bool (optional) If true, update the database if it already exists instead of returning an error.
- Returns:
- create_endpoint(parent: str, endpoint: Endpoint, endpoint_id: str [, replace_existing: Optional[bool]]) CreateEndpointOperation¶
Creates a new compute endpoint in the branch.
- Parameters:
parent – str The Branch where this Endpoint will be created. Format: projects/{project_id}/branches/{branch_id}
endpoint –
EndpointThe Endpoint to create.endpoint_id – str The ID to use for the Endpoint. This becomes the final component of the endpoint’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,
primarybecomesprojects/my-app/branches/development/endpoints/primary.replace_existing – bool (optional) If true, update the endpoint if it already exists instead of returning an error.
- Returns:
- create_project(project: Project, project_id: str) CreateProjectOperation¶
Creates a new Lakebase Autoscaling Postgres database project, which contains branches and compute endpoints.
- Parameters:
project –
ProjectThe Project to create.project_id – str The ID to use for the Project. This becomes the final component of the project’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,
my-appbecomesprojects/my-app.
- Returns:
- create_replication_group_preview(parent: str, replication_group_preview: ReplicationGroupPreview, replication_group_preview_id: str [, request_id: Optional[str]]) CreateReplicationGroupPreviewOperation¶
Creates a new replication group for the project.
- Parameters:
parent – str
replication_group_preview –
ReplicationGroupPreviewreplication_group_preview_id – str
request_id – str (optional)
- Returns:
- create_role(parent: str, role: Role [, replace_existing: Optional[bool], role_id: Optional[str]]) CreateRoleOperation¶
Creates a new Postgres role in the branch.
- Parameters:
parent – str The Branch where this Role is created. Format: projects/{project_id}/branches/{branch_id}
role –
RoleThe desired specification of a Role.replace_existing –
bool (optional) If true, update the role if it already exists instead of returning an error.
When the role already exists, the provided
rolespec fully replaces the existing one:membership_rolesis overwritten, not merged. Leavingmembership_rolesempty clears all of the role’s existing memberships, includingDATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field.role_id –
str (optional) The ID to use for the Role, which will become the final component of the role’s resource name. This ID becomes the role in Postgres.
This value should be 4-63 characters, and valid characters are lowercase letters, numbers, and hyphens, as defined by RFC 1123.
If role_id is not specified in the request, it is generated automatically.
- Returns:
- create_snapshot(parent: str, snapshot: Snapshot [, snapshot_id: Optional[str]]) CreateSnapshotOperation¶
Creates a snapshot, an immutable point-in-time copy of a branch’s data, within the project.
- create_synced_table(synced_table: SyncedTable, synced_table_id: str) CreateSyncedTableOperation¶
Create a Synced Table.
- Parameters:
synced_table –
SyncedTablesynced_table_id –
str The ID to use for the Synced Table. This becomes the final component of the SyncedTable’s resource name. ID is required and is the synced table name, containing (catalog, schema, table) tuple. Elements of the tuple are the UC entity names.
Example: “{catalog}.{schema}.{table}”
synced_table_id represents both of the following:
An online VIEW virtual table in the Unity Catalog accessible via the Lakehouse Federation.
Postgres table named “{table}” in schema “{schema}” in the connected Postgres database
- Returns:
- create_table(table: Table) Table¶
Create a Table (non-synced database table for Autoscaling v2 Lakebase projects).
- delete_branch(name: str [, allow_missing: Optional[bool], purge: Optional[bool]]) DeleteBranchOperation¶
Deletes the specified database branch.
- Parameters:
name – str The full resource path of the branch to delete. Format: projects/{project_id}/branches/{branch_id}
allow_missing – bool (optional) If true, if branch does not exists, the request will succeed and no action will be taken. If false (default value) and branch does not exists, the request will fail with NOT_FOUND error.
purge – bool (optional) If true, permanently delete the branch; if false, soft delete.
- Returns:
- delete_catalog(name: str) DeleteCatalogOperation¶
Delete a Database Catalog.
- Parameters:
name –
str The full resource path of the catalog to delete.
Format: “catalogs/{catalog_id}”.
- Returns:
- delete_cdf_config(name: str [, force: Optional[bool]]) DeleteCdfConfigOperation¶
Delete a CDF configuration and stop materializing the change data feed. When force=true, also drops the Delta tables in Unity Catalog. When force=false (default), the existing tables are preserved at their last state.
- Parameters:
name – str The resource name of the CdfConfig to delete. Format: projects/{project}/branches/{branch}/databases/{database}/cdf-configs/{cdf_config}
force – bool (optional) When true, also drops the replicated Delta tables in Unity Catalog. When false (the default), the replicated tables are preserved at their last synced state.
- Returns:
- delete_data_api(name: str) DeleteDataApiOperation¶
Disable Data API for a database.
- Parameters:
name – str Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api
- Returns:
- delete_database(name: str) DeleteDatabaseOperation¶
Delete a Database.
- Parameters:
name – str The resource name of the postgres database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- Returns:
- delete_endpoint(name: str) DeleteEndpointOperation¶
Deletes the specified compute endpoint.
- Parameters:
name – str The full resource path of the endpoint to delete. Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
- Returns:
- delete_forward_etl_configuration(parent: str [, pg_database_oid: Optional[int], pg_schema_oid: Optional[int], tenant_id: Optional[str], timeline_id: Optional[str]]) DeleteForwardEtlConfigurationResponse¶
Hard delete a Forward ETL configuration and all associated table mappings. Unlike DisableForwardEtl, this permanently removes the config and mapping rows.
- Parameters:
parent – str The Branch to delete Forward ETL configuration for. Format: projects/{project_id}/branches/{branch_id}
pg_database_oid – int (optional) PostgreSQL database OID to delete configuration for.
pg_schema_oid – int (optional) PostgreSQL schema OID to delete configuration for.
tenant_id – str (optional) Tenant ID (dashless UUID format).
timeline_id – str (optional) Timeline ID (dashless UUID format).
- Returns:
- delete_project(name: str [, purge: Optional[bool]]) DeleteProjectOperation¶
Deletes the specified database project.
- Parameters:
name – str The full resource path of the project to delete. Format: projects/{project_id}
purge – bool (optional) If true, permanently deletes the project (hard delete). If false or unset, performs a soft delete.
- Returns:
- delete_recovery_branch_preview(name: str [, request_id: Optional[str]]) DeleteRecoveryBranchPreviewOperation¶
Deletes the specified recovery branch after reconciliation is complete.
- Parameters:
name – str
request_id – str (optional)
- Returns:
- delete_replication_group_preview(name: str [, etag: Optional[str], request_id: Optional[str]]) DeleteReplicationGroupPreviewOperation¶
Deletes the specified replication group.
- Parameters:
name – str
etag – str (optional)
request_id – str (optional)
- Returns:
- delete_role(name: str [, reassign_owned_to: Optional[str]]) DeleteRoleOperation¶
Deletes the specified Postgres role.
- Parameters:
name – str The full resource path of the role to delete. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
reassign_owned_to –
str (optional) Reassign objects. If this is set, all objects owned by the role are reassigned to the role specified in this parameter.
NOTE: setting this requires spinning up a compute to succeed, since it involves running SQL queries.
- Returns:
- delete_snapshot(name: str) DeleteSnapshotOperation¶
Deletes the specified snapshot.
- Parameters:
name – str The resource name of the snapshot to delete. Format: projects/{project_id}/snapshots/{snapshot_id}
- Returns:
- delete_synced_table(name: str) DeleteSyncedTableOperation¶
Delete a Synced Table.
- Parameters:
name – str The Full resource name of the synced table, of the format “synced_tables/{catalog}.{schema}.{table}”, where (catalog, schema, table) are the UC entity names.
- Returns:
- delete_table(name: str)¶
Delete a Table (non-synced database table for Autoscaling v2 Lakebase projects).
- Parameters:
name – str Full three-part (catalog, schema, table) name of the table.
- disable_forward_etl(parent: str [, pg_database_oid: Optional[int], pg_schema_oid: Optional[int], tenant_id: Optional[str], timeline_id: Optional[str]]) DisableForwardEtlResponse¶
Disable Forward ETL for a branch.
- Parameters:
parent – str The Branch to disable Forward ETL for. Format: projects/{project_id}/branches/{branch_id}
pg_database_oid – int (optional) PostgreSQL database OID to disable.
pg_schema_oid – int (optional) PostgreSQL schema OID to disable.
tenant_id – str (optional) Tenant ID (dashless UUID format).
timeline_id – str (optional) Timeline ID (dashless UUID format).
- Returns:
- failover_replication_group_preview(name: str, target_workspace: str [, etag: Optional[str], request_id: Optional[str]]) FailoverReplicationGroupPreviewOperation¶
Fails over the replication group to a target workspace, promoting the secondary to primary.
- Parameters:
name – str
target_workspace – str
etag – str (optional)
request_id – str (optional)
- Returns:
- generate_database_credential(endpoint: str [, claims: Optional[List[RequestedClaims]], expire_time: Optional[Timestamp], group_name: Optional[str], ttl: Optional[Duration]]) DatabaseCredential¶
Generate OAuth credentials for a Postgres database.
- Parameters:
endpoint – str The endpoint resource name for which this credential will be generated. Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
claims – List[
RequestedClaims] (optional) The returned token will be scoped to UC tables with the specified permissions.expire_time – Timestamp (optional) Timestamp in UTC of when this credential should expire. Must be at least 300 seconds (5 minutes) and at most 1 hour from the current time.
group_name – str (optional) Databricks workspace group name. When provided, credentials are generated with permissions scoped to this group.
ttl – Duration (optional) The requested time-to-live for the generated credential token. Must be at least 300 seconds (5 minutes) and at most 3600 seconds (1 hour).
- Returns:
- get_branch(name: str) Branch¶
Retrieves information about the specified database branch.
- Parameters:
name – str The full resource path of the branch to retrieve. Format: projects/{project_id}/branches/{branch_id}
- Returns:
- get_catalog(name: str) Catalog¶
Get a Database Catalog.
- Parameters:
name –
str The full resource path of the catalog to retrieve.
Format: “catalogs/{catalog_id}”.
- Returns:
- get_cdf_config(name: str) CdfConfig¶
Get a single Lakebase CDF configuration, including the source Postgres schema, target Unity Catalog schema, and the identity under which writes are authorized.
- Parameters:
name – str The resource name of the CdfConfig to retrieve. Format: projects/{project}/branches/{branch}/databases/{database}/cdf-configs/{cdf_config}
- Returns:
- get_cdf_status(name: str) CdfStatus¶
Get the CDF status of a single table within a Lakebase CDF configuration, including its current state and the last committed position in the feed.
- Parameters:
name – str The resource name of the CdfStatus to retrieve. Format: projects/{project}/branches/{branch}/databases/{database}/cdf-configs/{cdf_config}/cdf-statuses/{cdf_status}
- Returns:
- get_compute_instance(name: str) ComputeInstance¶
Lists the specific compute instance under an endpoint. Note: ComputeInstances are managed via the parent Endpoint resource, and cannot be created, updated, or deleted directly.
- Parameters:
name – str The full resource path of the compute instance to retrieve. Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}/compute-instances/{compute_instance_id}
- Returns:
- get_data_api(name: str) DataApi¶
Get Data API configuration for a database.
- Parameters:
name – str Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api
- Returns:
- get_database(name: str) Database¶
Get a Database.
- Parameters:
name – str The name of the Database to retrieve. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
- Returns:
- get_endpoint(name: str) Endpoint¶
Retrieves information about the specified compute endpoint, including its connection details and operational state.
- Parameters:
name – str The full resource path of the endpoint to retrieve. Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
- Returns:
- get_forward_etl_metadata(parent: str [, tenant_id: Optional[str], timeline_id: Optional[str]]) ForwardEtlMetadata¶
Get Forward ETL metadata (database and schema OIDs).
- Parameters:
parent – str The Branch to get metadata for. Format: projects/{project_id}/branches/{branch_id}
tenant_id – str (optional) Tenant ID (dashless UUID format).
timeline_id – str (optional) Timeline ID (dashless UUID format).
- Returns:
- get_forward_etl_status(parent: str [, tenant_id: Optional[str], timeline_id: Optional[str]]) ForwardEtlStatus¶
Get Forward ETL configuration and status for a branch.
- Parameters:
parent – str The Branch to get Forward ETL status for. Format: projects/{project_id}/branches/{branch_id}
tenant_id – str (optional) Tenant ID (dashless UUID format).
timeline_id – str (optional) Timeline ID (dashless UUID format).
- Returns:
- get_operation(name: str) Operation¶
Retrieves the status of a long-running operation.
- Parameters:
name – str The name of the operation resource.
- Returns:
- get_project(name: str) Project¶
Retrieves information about the specified database project.
- Parameters:
name – str The full resource path of the project to retrieve. Format: projects/{project_id}
- Returns:
- get_recovery_branch_preview(name: str) RecoveryBranchPreview¶
Retrieves information about the specified recovery branch.
- Parameters:
name – str
- Returns:
- get_replication_group_preview(name: str) ReplicationGroupPreview¶
Retrieves information about the specified replication group.
- Parameters:
name – str
- Returns:
- get_role(name: str) Role¶
Retrieves information about the specified Postgres role, including its authentication method and permissions.
- Parameters:
name – str The full resource path of the role to retrieve. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
- Returns:
- get_snapshot(name: str) Snapshot¶
Retrieves information about the specified snapshot.
- Parameters:
name – str The resource name of the snapshot to retrieve. Format: projects/{project_id}/snapshots/{snapshot_id}
- Returns:
- get_snapshot_schedule(name: str) SnapshotSchedule¶
Retrieves the snapshot schedule for a branch. A branch with no configured schedule returns an empty schedule (not NOT_FOUND).
- Parameters:
name – str The resource name of the branch’s snapshot schedule. Format: projects/{project_id}/branches/{branch_id}/snapshot-schedule
- Returns:
- get_synced_table(name: str) SyncedTable¶
Get a Synced Table.
- Parameters:
name – str The Full resource name of the synced table. Format: “synced_tables/{catalog}.{schema}.{table}”, where (catalog, schema, table) are the entity names in the Unity Catalog.
- Returns:
- get_table(name: str) Table¶
Get a Table (non-synced database table for Autoscaling v2 Lakebase projects).
- Parameters:
name – str Full three-part (catalog, schema, table) name of the table.
- Returns:
- inspect_recovery_branch_preview(name: str, branch_id: str [, request_id: Optional[str]]) InspectRecoveryBranchPreviewOperation¶
Materializes a temporary inspection branch from the specified recovery branch for data examination.
- Parameters:
name – str The recovery branch from which to create the inspection branch.
branch_id – str Caller-supplied id for the inspection Branch this custom method materializes.
request_id – str (optional)
- Returns:
- list_branches(parent: str [, page_size: Optional[int], page_token: Optional[str], show_deleted: Optional[bool]]) Iterator[Branch]¶
Returns a paginated list of database branches in the project.
- Parameters:
parent – str The Project that owns this collection of branches. Format: projects/{project_id}
page_size – int (optional) Upper bound for items returned. Cannot be negative.
page_token – str (optional) Page token from a previous response. If not provided, returns the first page.
show_deleted – bool (optional) Whether to include soft-deleted branches in the response. When true, deleted branches are included alongside active branches. Purged branches are never returned.
- Returns:
Iterator over
Branch
- list_cdf_configs(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[CdfConfig]¶
List all CDF configurations for a Lakebase database. Each configuration maps a Postgres schema to a Unity Catalog schema where the change data feed is materialized.
- Parameters:
parent – str The parent database to list CdfConfigs for. Format: projects/{project}/branches/{branch}/databases/{database}
page_size – int (optional) Maximum number of CdfConfigs to return.
page_token – str (optional) Pagination token returned by a previous ListCdfConfigs call. Empty on the first page.
- Returns:
Iterator over
CdfConfig
- list_cdf_statuses(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[CdfStatus]¶
List the per-table CDF statuses within a Lakebase CDF configuration. Each status shows whether a table’s change data feed is snapshotting, streaming, or skipped.
- Parameters:
parent – str The parent CdfConfig to list CdfStatuses for. Format: projects/{project}/branches/{branch}/databases/{database}/cdf-configs/{cdf_config}
page_size – int (optional) Maximum number of CdfStatuses to return.
page_token – str (optional) Pagination token returned by a previous ListCdfStatuses call. Empty on the first page.
- Returns:
Iterator over
CdfStatus
- list_compute_instances(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[ComputeInstance]¶
Lists all compute instances that have been created under the specified endpoint. Note: ComputeInstances are managed via the parent Endpoint resource, and cannot be created, updated, or deleted directly.
- Parameters:
parent – str The parent, which owns the compute instances.
page_size –
int (optional) The maximum number of compute instances to return. The service may return fewer than this value.
If unspecified, at most 50 compute instances will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
page_token –
str (optional) A page token, received from a previous
ListInstancescall. Provide this to retrieve the subsequent page.When paginating, all other parameters provided to
ListInstancesmust match the call that provided the page token.
- Returns:
Iterator over
ComputeInstance
- list_databases(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[Database]¶
List Databases.
- Parameters:
parent – str The Branch that owns this collection of databases. Format: projects/{project_id}/branches/{branch_id}
page_size – int (optional) Upper bound for items returned.
page_token – str (optional) Pagination token to go to the next page of Databases. Requests first page if absent.
- Returns:
Iterator over
Database
- list_endpoints(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[Endpoint]¶
Returns a paginated list of compute endpoints in the branch.
- Parameters:
parent – str The Branch that owns this collection of endpoints. Format: projects/{project_id}/branches/{branch_id}
page_size – int (optional) Upper bound for items returned. Cannot be negative.
page_token – str (optional) Page token from a previous response. If not provided, returns the first page.
- Returns:
Iterator over
Endpoint
- list_projects([, page_size: Optional[int], page_token: Optional[str], show_deleted: Optional[bool]]) Iterator[Project]¶
Returns a paginated list of database projects in the workspace that the user has permission to access.
- Parameters:
page_size – int (optional) Upper bound for items returned. Cannot be negative. The maximum value is 100.
page_token – str (optional) Page token from a previous response. If not provided, returns the first page.
show_deleted – bool (optional) Whether to include soft-deleted projects in the response. When true, soft-deleted projects are included alongside active projects. Hard-deleted and already-purged projects are never returned.
- Returns:
Iterator over
Project
- list_recovery_branch_previews(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[RecoveryBranchPreview]¶
Returns a paginated list of recovery branches for the project.
- Parameters:
parent – str
page_size – int (optional)
page_token – str (optional)
- Returns:
Iterator over
RecoveryBranchPreview
- list_replication_group_previews(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[ReplicationGroupPreview]¶
Returns a paginated list of replication groups for the project.
- Parameters:
parent – str
page_size – int (optional)
page_token – str (optional)
- Returns:
Iterator over
ReplicationGroupPreview
- list_roles(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[Role]¶
Returns a paginated list of Postgres roles in the branch.
- Parameters:
parent – str The Branch that owns this collection of roles. Format: projects/{project_id}/branches/{branch_id}
page_size – int (optional) Upper bound for items returned. Cannot be negative.
page_token – str (optional) Page token from a previous response. If not provided, returns the first page.
- Returns:
Iterator over
Role
- list_snapshots(parent: str [, page_size: Optional[int], page_token: Optional[str]]) Iterator[Snapshot]¶
Returns a paginated list of snapshots in the project.
- Parameters:
parent – str The project that owns the snapshots. Format: projects/{project_id}
page_size – int (optional) Maximum number of snapshots to return per page.
page_token – str (optional) Page token from a previous response; omit for the first page.
- Returns:
Iterator over
Snapshot
- switchover_replication_group_preview(name: str, target_workspace: str [, etag: Optional[str], request_id: Optional[str]]) SwitchoverReplicationGroupPreviewOperation¶
Switches over the replication group to a target workspace with a coordinated failover.
- Parameters:
name – str
target_workspace – str
etag – str (optional)
request_id – str (optional)
- Returns:
- undelete_branch(name: str) UndeleteBranchOperation¶
Undeletes the specified database branch.
- Parameters:
name – str The full resource path of the branch to undelete. Format: projects/{project_id}/branches/{branch_id}
- Returns:
- undelete_project(name: str) UndeleteProjectOperation¶
Undeletes a soft-deleted project.
- Parameters:
name – str The full resource path of the project to undelete. Format: projects/{project_id}
- Returns:
- update_branch(name: str, branch: Branch, update_mask: FieldMask) UpdateBranchOperation¶
Updates the specified database branch. You can set this branch as the project’s default branch, or protect/unprotect it.
- Parameters:
name – str Output only. The full resource path of the branch. Format: projects/{project_id}/branches/{branch_id}
branch –
BranchThe Branch to update.The branch’s
namefield is used to identify the branch to update. Format: projects/{project_id}/branches/{branch_id}update_mask – FieldMask The list of fields to update. If unspecified, all fields will be updated when possible.
- Returns:
- update_data_api(name: str, data_api: DataApi, update_mask: FieldMask) UpdateDataApiOperation¶
Update Data API configuration for a database.
- Parameters:
name – str Resource name: projects/{project_id}/branches/{branch_id}/databases/{database_id}/data-api
data_api –
DataApiThe Data API configuration to update. The data_api’snamefield identifies the resource.update_mask – FieldMask The list of fields to update. If unspecified, all fields will be updated when possible.
- Returns:
- update_database(name: str, database: Database, update_mask: FieldMask) UpdateDatabaseOperation¶
Update a Database.
- Parameters:
name – str The resource name of the database. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
database –
DatabaseThe Database to update.The database’s
namefield is used to identify the database to update. Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}update_mask – FieldMask The list of fields to update. If unspecified, all fields will be updated when possible.
- Returns:
- update_endpoint(name: str, endpoint: Endpoint, update_mask: FieldMask) UpdateEndpointOperation¶
Updates the specified compute endpoint. You can update autoscaling limits, suspend timeout, or enable/disable the compute endpoint.
- Parameters:
name – str Output only. The full resource path of the endpoint. Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
endpoint –
EndpointThe Endpoint to update.The endpoint’s
namefield is used to identify the endpoint to update. Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}update_mask – FieldMask The list of fields to update. If unspecified, all fields will be updated when possible.
- Returns:
- update_project(name: str, project: Project, update_mask: FieldMask) UpdateProjectOperation¶
Updates the specified database project.
- Parameters:
name – str Output only. The full resource path of the project. Format: projects/{project_id}
project –
ProjectThe Project to update.The project’s
namefield is used to identify the project to update. Format: projects/{project_id}update_mask – FieldMask The list of fields to update. If unspecified, all fields will be updated when possible.
- Returns:
- update_replication_group_preview(name: str, replication_group_preview: ReplicationGroupPreview, update_mask: FieldMask [, request_id: Optional[str]]) UpdateReplicationGroupPreviewOperation¶
Updates the specified replication group.
- Parameters:
name – str The resource name of the replication group. Format: projects/{project_id}/preview/replication-groups/{replication_group_id}
replication_group_preview –
ReplicationGroupPreviewupdate_mask –
FieldMask The field mask must be a single string, with multiple fields separated by commas (no spaces). The field path is relative to the resource object, using a dot (
.) to navigate sub-fields (e.g.,author.given_name). Specification of elements in sequence or map fields is not allowed, as only the entire collection field can be specified. Field names must exactly match the resource field names.A field mask of
*indicates full replacement. It’s recommended to always explicitly list the fields being updated and avoid using*wildcards, as it can lead to unintended results if the API changes in the future.request_id – str (optional)
- Returns:
- update_role(name: str, role: Role, update_mask: FieldMask) UpdateRoleOperation¶
Update a role for a branch.
- Parameters:
name – str Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
role –
RoleThe Postgres Role to update.The role’s
namefield is used to identify the role to update. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}update_mask – FieldMask The list of fields to update in Postgres Role. If unspecified, all fields will be updated when possible.
- Returns:
- update_snapshot(name: str, snapshot: Snapshot, update_mask: FieldMask) UpdateSnapshotOperation¶
Updates the specified snapshot. You can change or disable its expiration policy.
- Parameters:
name – str The resource name of the snapshot. Format: projects/{project_id}/snapshots/{snapshot_id}
snapshot –
SnapshotThe snapshot to update. Itsnameidentifies the snapshot. Format: projects/{project_id}/snapshots/{snapshot_id}update_mask – FieldMask Fields to update. The only updatable path is
spec.expiration.
- Returns:
- update_snapshot_schedule(name: str, snapshot_schedule: SnapshotSchedule, update_mask: FieldMask) SnapshotSchedule¶
Sets the snapshot schedule for a branch. The
schedulefield is replaced wholesale; an empty schedule disables automatic snapshots.- Parameters:
name – str The resource name of the branch’s snapshot schedule. Format: projects/{project_id}/branches/{branch_id}/snapshot-schedule
snapshot_schedule –
SnapshotScheduleThe snapshot schedule to set. Itsnameidentifies the branch. Format: projects/{project_id}/branches/{branch_id}/snapshot-scheduleupdate_mask – FieldMask Fields to update. The only updatable path is
schedule, which replaces the entire set of cadences.
- Returns: