Skip to content

Commit

Permalink
Include replica connection info on DBaaS clusters & DBaaS PG pools (#663
Browse files Browse the repository at this point in the history
)

* include replica connection info, clusters + pools

* add standby conns on tests w. storage

---------

Co-authored-by: danaelhe <42972711+danaelhe@users.noreply.github.com>
  • Loading branch information
dwilsondo and danaelhe authored Jan 22, 2024
1 parent b2afa34 commit e63ec45
Show file tree
Hide file tree
Showing 2 changed files with 283 additions and 27 deletions.
54 changes: 29 additions & 25 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,26 @@ var _ DatabasesService = &DatabasesServiceOp{}
// "pg", "mysql" or "redis". A Database also includes connection information and other
// properties of the service like region, size and current status.
type Database struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
EngineSlug string `json:"engine,omitempty"`
VersionSlug string `json:"version,omitempty"`
Connection *DatabaseConnection `json:"connection,omitempty"`
PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
Users []DatabaseUser `json:"users,omitempty"`
NumNodes int `json:"num_nodes,omitempty"`
SizeSlug string `json:"size,omitempty"`
DBNames []string `json:"db_names,omitempty"`
RegionSlug string `json:"region,omitempty"`
Status string `json:"status,omitempty"`
MaintenanceWindow *DatabaseMaintenanceWindow `json:"maintenance_window,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
PrivateNetworkUUID string `json:"private_network_uuid,omitempty"`
Tags []string `json:"tags,omitempty"`
ProjectID string `json:"project_id,omitempty"`
StorageSizeMib uint64 `json:"storage_size_mib,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
EngineSlug string `json:"engine,omitempty"`
VersionSlug string `json:"version,omitempty"`
Connection *DatabaseConnection `json:"connection,omitempty"`
PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
StandbyConnection *DatabaseConnection `json:"standby_connection,omitempty"`
StandbyPrivateConnection *DatabaseConnection `json:"standby_private_connection,omitempty"`
Users []DatabaseUser `json:"users,omitempty"`
NumNodes int `json:"num_nodes,omitempty"`
SizeSlug string `json:"size,omitempty"`
DBNames []string `json:"db_names,omitempty"`
RegionSlug string `json:"region,omitempty"`
Status string `json:"status,omitempty"`
MaintenanceWindow *DatabaseMaintenanceWindow `json:"maintenance_window,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
PrivateNetworkUUID string `json:"private_network_uuid,omitempty"`
Tags []string `json:"tags,omitempty"`
ProjectID string `json:"project_id,omitempty"`
StorageSizeMib uint64 `json:"storage_size_mib,omitempty"`
}

// DatabaseCA represents a database ca.
Expand Down Expand Up @@ -381,13 +383,15 @@ type DatabaseReplica struct {

// DatabasePool represents a database connection pool
type DatabasePool struct {
User string `json:"user"`
Name string `json:"name"`
Size int `json:"size"`
Database string `json:"db"`
Mode string `json:"mode"`
Connection *DatabaseConnection `json:"connection"`
PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
User string `json:"user"`
Name string `json:"name"`
Size int `json:"size"`
Database string `json:"db"`
Mode string `json:"mode"`
Connection *DatabaseConnection `json:"connection"`
PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
StandbyConnection *DatabaseConnection `json:"standby_connection,omitempty"`
StandbyPrivateConnection *DatabaseConnection `json:"standby_private_connection,omitempty"`
}

// DatabaseCreatePoolRequest is used to create a new database connection pool
Expand Down
Loading

0 comments on commit e63ec45

Please sign in to comment.