@Generated public class PostgresAPI extends Object
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}`. The `name` field on each resource contains this full path and is output-only. Note that `name` refers to this resource path, not the user-visible `display_name`.
| Constructor and Description |
|---|
PostgresAPI(ApiClient apiClient)
Regular-use constructor
|
PostgresAPI(PostgresService mock)
Constructor for mocks
|
| Modifier and Type | Method and Description |
|---|---|
CreateBranchOperation |
createBranch(CreateBranchRequest request)
Creates a new database branch in the project.
|
CreateEndpointOperation |
createEndpoint(CreateEndpointRequest request)
Creates a new compute endpoint in the branch.
|
CreateProjectOperation |
createProject(CreateProjectRequest request)
Creates a new Lakebase Autoscaling Postgres database project, which contains branches and
compute endpoints.
|
CreateRoleOperation |
createRole(CreateRoleRequest request)
Creates a new Postgres role in the branch.
|
DeleteBranchOperation |
deleteBranch(DeleteBranchRequest request)
Deletes the specified database branch.
|
DeleteBranchOperation |
deleteBranch(String name) |
DeleteEndpointOperation |
deleteEndpoint(DeleteEndpointRequest request)
Deletes the specified compute endpoint.
|
DeleteEndpointOperation |
deleteEndpoint(String name) |
DeleteProjectOperation |
deleteProject(DeleteProjectRequest request)
Deletes the specified database project.
|
DeleteProjectOperation |
deleteProject(String name) |
DeleteRoleOperation |
deleteRole(DeleteRoleRequest request)
Deletes the specified Postgres role.
|
DeleteRoleOperation |
deleteRole(String name) |
DatabaseCredential |
generateDatabaseCredential(GenerateDatabaseCredentialRequest request)
Generate OAuth credentials for a Postgres database.
|
Branch |
getBranch(GetBranchRequest request)
Retrieves information about the specified database branch.
|
Branch |
getBranch(String name) |
Endpoint |
getEndpoint(GetEndpointRequest request)
Retrieves information about the specified compute endpoint, including its connection details
and operational state.
|
Endpoint |
getEndpoint(String name) |
Operation |
getOperation(GetOperationRequest request)
Retrieves the status of a long-running operation.
|
Operation |
getOperation(String name) |
Project |
getProject(GetProjectRequest request)
Retrieves information about the specified database project.
|
Project |
getProject(String name) |
Role |
getRole(GetRoleRequest request)
Retrieves information about the specified Postgres role, including its authentication method
and permissions.
|
Role |
getRole(String name) |
PostgresService |
impl() |
Iterable<Branch> |
listBranches(ListBranchesRequest request)
Returns a paginated list of database branches in the project.
|
Iterable<Branch> |
listBranches(String parent) |
Iterable<Endpoint> |
listEndpoints(ListEndpointsRequest request)
Returns a paginated list of compute endpoints in the branch.
|
Iterable<Endpoint> |
listEndpoints(String parent) |
Iterable<Project> |
listProjects(ListProjectsRequest request)
Returns a paginated list of database projects in the workspace that the user has permission to
access.
|
Iterable<Role> |
listRoles(ListRolesRequest request)
Returns a paginated list of Postgres roles in the branch.
|
Iterable<Role> |
listRoles(String parent) |
UpdateBranchOperation |
updateBranch(UpdateBranchRequest request)
Updates the specified database branch.
|
UpdateEndpointOperation |
updateEndpoint(UpdateEndpointRequest request)
Updates the specified compute endpoint.
|
UpdateProjectOperation |
updateProject(UpdateProjectRequest request)
Updates the specified database project.
|
public PostgresAPI(ApiClient apiClient)
public PostgresAPI(PostgresService mock)
public CreateBranchOperation createBranch(CreateBranchRequest request)
public CreateEndpointOperation createEndpoint(CreateEndpointRequest request)
public CreateProjectOperation createProject(CreateProjectRequest request)
public CreateRoleOperation createRole(CreateRoleRequest request)
public DeleteBranchOperation deleteBranch(String name)
public DeleteBranchOperation deleteBranch(DeleteBranchRequest request)
public DeleteEndpointOperation deleteEndpoint(String name)
public DeleteEndpointOperation deleteEndpoint(DeleteEndpointRequest request)
public DeleteProjectOperation deleteProject(String name)
public DeleteProjectOperation deleteProject(DeleteProjectRequest request)
public DeleteRoleOperation deleteRole(String name)
public DeleteRoleOperation deleteRole(DeleteRoleRequest request)
public DatabaseCredential generateDatabaseCredential(GenerateDatabaseCredentialRequest request)
public Branch getBranch(GetBranchRequest request)
public Endpoint getEndpoint(GetEndpointRequest request)
public Operation getOperation(GetOperationRequest request)
public Project getProject(GetProjectRequest request)
public Role getRole(GetRoleRequest request)
public Iterable<Branch> listBranches(ListBranchesRequest request)
public Iterable<Endpoint> listEndpoints(ListEndpointsRequest request)
public Iterable<Project> listProjects(ListProjectsRequest request)
public Iterable<Role> listRoles(ListRolesRequest request)
public UpdateBranchOperation updateBranch(UpdateBranchRequest request)
public UpdateEndpointOperation updateEndpoint(UpdateEndpointRequest request)
public UpdateProjectOperation updateProject(UpdateProjectRequest request)
public PostgresService impl()
Copyright © 2026. All rights reserved.