controlplane

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2025 License: PostgreSQL Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "control-plane"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "v0.6.2"

APIVersion is the version of the API as defined in the design.

View Source
const ServiceName = "control-plane"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [25]string{"init-cluster", "join-cluster", "get-join-token", "get-join-options", "get-cluster", "list-hosts", "get-host", "remove-host", "list-databases", "create-database", "get-database", "update-database", "delete-database", "backup-database-node", "switchover-database-node", "failover-database-node", "list-database-tasks", "get-database-task", "get-database-task-log", "restore-database", "get-version", "restart-instance", "stop-instance", "start-instance", "cancel-database-task"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeCancelFailed

func MakeCancelFailed(err error) *goa.ServiceError

MakeCancelFailed builds a goa.ServiceError from an error.

func MakeClusterAlreadyInitialized

func MakeClusterAlreadyInitialized(err error) *goa.ServiceError

MakeClusterAlreadyInitialized builds a goa.ServiceError from an error.

func MakeClusterNotInitialized

func MakeClusterNotInitialized(err error) *goa.ServiceError

MakeClusterNotInitialized builds a goa.ServiceError from an error.

func MakeDatabaseNotModifiable

func MakeDatabaseNotModifiable(err error) *goa.ServiceError

MakeDatabaseNotModifiable builds a goa.ServiceError from an error.

func MakeInvalidInput

func MakeInvalidInput(err error) *goa.ServiceError

MakeInvalidInput builds a goa.ServiceError from an error.

func MakeInvalidJoinToken

func MakeInvalidJoinToken(err error) *goa.ServiceError

MakeInvalidJoinToken builds a goa.ServiceError from an error.

func MakeNotFound

func MakeNotFound(err error) *goa.ServiceError

MakeNotFound builds a goa.ServiceError from an error.

func MakeOperationAlreadyInProgress

func MakeOperationAlreadyInProgress(err error) *goa.ServiceError

MakeOperationAlreadyInProgress builds a goa.ServiceError from an error.

func MakeOperationNotSupported

func MakeOperationNotSupported(err error) *goa.ServiceError

MakeOperationNotSupported builds a goa.ServiceError from an error.

func MakeRestartFailed

func MakeRestartFailed(err error) *goa.ServiceError

MakeRestartFailed builds a goa.ServiceError from an error.

func MakeServerError

func MakeServerError(err error) *goa.ServiceError

MakeServerError builds a goa.ServiceError from an error.

func MakeStartFailed

func MakeStartFailed(err error) *goa.ServiceError

MakeStartFailed builds a goa.ServiceError from an error.

func MakeStopFailed

func MakeStopFailed(err error) *goa.ServiceError

MakeStopFailed builds a goa.ServiceError from an error.

func NewBackupDatabaseNodeEndpoint

func NewBackupDatabaseNodeEndpoint(s Service) goa.Endpoint

NewBackupDatabaseNodeEndpoint returns an endpoint function that calls the method "backup-database-node" of service "control-plane".

func NewCancelDatabaseTaskEndpoint

func NewCancelDatabaseTaskEndpoint(s Service) goa.Endpoint

NewCancelDatabaseTaskEndpoint returns an endpoint function that calls the method "cancel-database-task" of service "control-plane".

func NewCreateDatabaseEndpoint

func NewCreateDatabaseEndpoint(s Service) goa.Endpoint

NewCreateDatabaseEndpoint returns an endpoint function that calls the method "create-database" of service "control-plane".

func NewDeleteDatabaseEndpoint

func NewDeleteDatabaseEndpoint(s Service) goa.Endpoint

NewDeleteDatabaseEndpoint returns an endpoint function that calls the method "delete-database" of service "control-plane".

func NewFailoverDatabaseNodeEndpoint

func NewFailoverDatabaseNodeEndpoint(s Service) goa.Endpoint

NewFailoverDatabaseNodeEndpoint returns an endpoint function that calls the method "failover-database-node" of service "control-plane".

func NewGetClusterEndpoint

func NewGetClusterEndpoint(s Service) goa.Endpoint

NewGetClusterEndpoint returns an endpoint function that calls the method "get-cluster" of service "control-plane".

func NewGetDatabaseEndpoint

func NewGetDatabaseEndpoint(s Service) goa.Endpoint

NewGetDatabaseEndpoint returns an endpoint function that calls the method "get-database" of service "control-plane".

func NewGetDatabaseTaskEndpoint

func NewGetDatabaseTaskEndpoint(s Service) goa.Endpoint

NewGetDatabaseTaskEndpoint returns an endpoint function that calls the method "get-database-task" of service "control-plane".

func NewGetDatabaseTaskLogEndpoint

func NewGetDatabaseTaskLogEndpoint(s Service) goa.Endpoint

NewGetDatabaseTaskLogEndpoint returns an endpoint function that calls the method "get-database-task-log" of service "control-plane".

func NewGetHostEndpoint

func NewGetHostEndpoint(s Service) goa.Endpoint

NewGetHostEndpoint returns an endpoint function that calls the method "get-host" of service "control-plane".

func NewGetJoinOptionsEndpoint

func NewGetJoinOptionsEndpoint(s Service) goa.Endpoint

NewGetJoinOptionsEndpoint returns an endpoint function that calls the method "get-join-options" of service "control-plane".

func NewGetJoinTokenEndpoint

func NewGetJoinTokenEndpoint(s Service) goa.Endpoint

NewGetJoinTokenEndpoint returns an endpoint function that calls the method "get-join-token" of service "control-plane".

func NewGetVersionEndpoint

func NewGetVersionEndpoint(s Service) goa.Endpoint

NewGetVersionEndpoint returns an endpoint function that calls the method "get-version" of service "control-plane".

func NewInitClusterEndpoint

func NewInitClusterEndpoint(s Service) goa.Endpoint

NewInitClusterEndpoint returns an endpoint function that calls the method "init-cluster" of service "control-plane".

func NewJoinClusterEndpoint

func NewJoinClusterEndpoint(s Service) goa.Endpoint

NewJoinClusterEndpoint returns an endpoint function that calls the method "join-cluster" of service "control-plane".

func NewListDatabaseTasksEndpoint

func NewListDatabaseTasksEndpoint(s Service) goa.Endpoint

NewListDatabaseTasksEndpoint returns an endpoint function that calls the method "list-database-tasks" of service "control-plane".

func NewListDatabasesEndpoint

func NewListDatabasesEndpoint(s Service) goa.Endpoint

NewListDatabasesEndpoint returns an endpoint function that calls the method "list-databases" of service "control-plane".

func NewListHostsEndpoint

func NewListHostsEndpoint(s Service) goa.Endpoint

NewListHostsEndpoint returns an endpoint function that calls the method "list-hosts" of service "control-plane".

func NewRemoveHostEndpoint

func NewRemoveHostEndpoint(s Service) goa.Endpoint

NewRemoveHostEndpoint returns an endpoint function that calls the method "remove-host" of service "control-plane".

func NewRestartInstanceEndpoint

func NewRestartInstanceEndpoint(s Service) goa.Endpoint

NewRestartInstanceEndpoint returns an endpoint function that calls the method "restart-instance" of service "control-plane".

func NewRestoreDatabaseEndpoint

func NewRestoreDatabaseEndpoint(s Service) goa.Endpoint

NewRestoreDatabaseEndpoint returns an endpoint function that calls the method "restore-database" of service "control-plane".

func NewStartInstanceEndpoint

func NewStartInstanceEndpoint(s Service) goa.Endpoint

NewStartInstanceEndpoint returns an endpoint function that calls the method "start-instance" of service "control-plane".

func NewStopInstanceEndpoint

func NewStopInstanceEndpoint(s Service) goa.Endpoint

NewStopInstanceEndpoint returns an endpoint function that calls the method "stop-instance" of service "control-plane".

func NewSwitchoverDatabaseNodeEndpoint

func NewSwitchoverDatabaseNodeEndpoint(s Service) goa.Endpoint

NewSwitchoverDatabaseNodeEndpoint returns an endpoint function that calls the method "switchover-database-node" of service "control-plane".

func NewUpdateDatabaseEndpoint

func NewUpdateDatabaseEndpoint(s Service) goa.Endpoint

NewUpdateDatabaseEndpoint returns an endpoint function that calls the method "update-database" of service "control-plane".

func NewViewedDatabase

func NewViewedDatabase(res *Database, view string) *controlplaneviews.Database

NewViewedDatabase initializes viewed result type Database from result type Database using the given view.

func NewViewedListDatabasesResponse

func NewViewedListDatabasesResponse(res *ListDatabasesResponse, view string) *controlplaneviews.ListDatabasesResponse

NewViewedListDatabasesResponse initializes viewed result type ListDatabasesResponse from result type ListDatabasesResponse using the given view.

Types

type APIError

type APIError struct {
	// The name of the error.
	Name string
	// The error message.
	Message string
}

A Control Plane API error.

func (*APIError) Error

func (e *APIError) Error() string

Error returns an error description.

func (*APIError) ErrorName deprecated

func (e *APIError) ErrorName() string

ErrorName returns "APIError".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*APIError) GoaErrorName

func (e *APIError) GoaErrorName() string

GoaErrorName returns "APIError".

type BackupConfigSpec

type BackupConfigSpec struct {
	// The repositories for this backup configuration.
	Repositories []*BackupRepositorySpec
	// The schedules for this backup configuration.
	Schedules []*BackupScheduleSpec
}

type BackupDatabaseNodePayload

type BackupDatabaseNodePayload struct {
	// ID of the database to back up.
	DatabaseID Identifier
	// Name of the node to back up.
	NodeName string
	Options  *BackupOptions
	// Forcibly attempt backup even in unmodifiable state
	Force bool
}

BackupDatabaseNodePayload is the payload type of the control-plane service backup-database-node method.

type BackupDatabaseNodeResponse

type BackupDatabaseNodeResponse struct {
	// The task that will backup this database node.
	Task *Task
}

BackupDatabaseNodeResponse is the result type of the control-plane service backup-database-node method.

type BackupOptions

type BackupOptions struct {
	// The type of backup.
	Type string
	// Annotations for the backup.
	Annotations map[string]string
	// Options for the backup.
	BackupOptions map[string]string
}

type BackupRepositorySpec

type BackupRepositorySpec struct {
	// The unique identifier of this repository.
	ID *Identifier
	// The type of this repository.
	Type string
	// The S3 bucket name for this repository. Only applies when type = 's3'.
	S3Bucket *string
	// The region of the S3 bucket for this repository. Only applies when type =
	// 's3'.
	S3Region *string
	// The optional S3 endpoint for this repository. Only applies when type = 's3'.
	S3Endpoint *string
	// An optional AWS access key ID to use for this repository. If not provided,
	// pgbackrest will use the default credential provider chain. This field will
	// be excluded from the response of all endpoints. It can also be omitted from
	// update requests to keep the current value.
	S3Key *string
	// The corresponding secret for the AWS access key ID in s3_key. This field
	// will be excluded from the response of all endpoints. It can also be omitted
	// from update requests to keep the current value.
	S3KeySecret *string
	// The GCS bucket name for this repository. Only applies when type = 'gcs'.
	GcsBucket *string
	// The optional GCS endpoint for this repository. Only applies when type =
	// 'gcs'.
	GcsEndpoint *string
	// Optional base64-encoded private key data. If omitted, pgbackrest will use
	// the service account attached to the instance profile. This field will be
	// excluded from the response of all endpoints. It can also be omitted from
	// update requests to keep the current value.
	GcsKey *string
	// The Azure account name for this repository. Only applies when type = 'azure'.
	AzureAccount *string
	// The Azure container name for this repository. Only applies when type =
	// 'azure'.
	AzureContainer *string
	// The optional Azure endpoint for this repository. Only applies when type =
	// 'azure'.
	AzureEndpoint *string
	// The Azure storage account access key to use for this repository. This field
	// will be excluded from the response of all endpoints. It can also be omitted
	// from update requests to keep the current value.
	AzureKey *string
	// The count of full backups to retain or the time to retain full backups.
	RetentionFull *int
	// The type of measure used for retention_full.
	RetentionFullType *string
	// The base path within the repository to store backups. Required for type =
	// 'posix' and 'cifs'.
	BasePath *string
	// Additional options to apply to this repository.
	CustomOptions map[string]string
}

type BackupScheduleSpec

type BackupScheduleSpec struct {
	// The unique identifier for this backup schedule.
	ID string
	// The type of backup to take on this schedule.
	Type string
	// The cron expression for this schedule.
	CronExpression string
}

type CancelDatabaseTaskPayload

type CancelDatabaseTaskPayload struct {
	// ID of the database that owns the task.
	DatabaseID Identifier
	// ID of the task to cancel.
	TaskID Identifier
}

CancelDatabaseTaskPayload is the payload type of the control-plane service cancel-database-task method.

type Client

type Client struct {
	InitClusterEndpoint            goa.Endpoint
	JoinClusterEndpoint            goa.Endpoint
	GetJoinTokenEndpoint           goa.Endpoint
	GetJoinOptionsEndpoint         goa.Endpoint
	GetClusterEndpoint             goa.Endpoint
	ListHostsEndpoint              goa.Endpoint
	GetHostEndpoint                goa.Endpoint
	RemoveHostEndpoint             goa.Endpoint
	ListDatabasesEndpoint          goa.Endpoint
	CreateDatabaseEndpoint         goa.Endpoint
	GetDatabaseEndpoint            goa.Endpoint
	UpdateDatabaseEndpoint         goa.Endpoint
	DeleteDatabaseEndpoint         goa.Endpoint
	BackupDatabaseNodeEndpoint     goa.Endpoint
	SwitchoverDatabaseNodeEndpoint goa.Endpoint
	FailoverDatabaseNodeEndpoint   goa.Endpoint
	ListDatabaseTasksEndpoint      goa.Endpoint
	GetDatabaseTaskEndpoint        goa.Endpoint
	GetDatabaseTaskLogEndpoint     goa.Endpoint
	RestoreDatabaseEndpoint        goa.Endpoint
	GetVersionEndpoint             goa.Endpoint
	RestartInstanceEndpoint        goa.Endpoint
	StopInstanceEndpoint           goa.Endpoint
	StartInstanceEndpoint          goa.Endpoint
	CancelDatabaseTaskEndpoint     goa.Endpoint
}

Client is the "control-plane" service client.

func NewClient

func NewClient(initCluster, joinCluster, getJoinToken, getJoinOptions, getCluster, listHosts, getHost, removeHost, listDatabases, createDatabase, getDatabase, updateDatabase, deleteDatabase, backupDatabaseNode, switchoverDatabaseNode, failoverDatabaseNode, listDatabaseTasks, getDatabaseTask, getDatabaseTaskLog, restoreDatabase, getVersion, restartInstance, stopInstance, startInstance, cancelDatabaseTask goa.Endpoint) *Client

NewClient initializes a "control-plane" service client given the endpoints.

func (*Client) BackupDatabaseNode

func (c *Client) BackupDatabaseNode(ctx context.Context, p *BackupDatabaseNodePayload) (res *BackupDatabaseNodeResponse, err error)

BackupDatabaseNode calls the "backup-database-node" endpoint of the "control-plane" service. BackupDatabaseNode may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "database_not_modifiable" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "operation_already_in_progress" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) CancelDatabaseTask

func (c *Client) CancelDatabaseTask(ctx context.Context, p *CancelDatabaseTaskPayload) (res *Task, err error)

CancelDatabaseTask calls the "cancel-database-task" endpoint of the "control-plane" service. CancelDatabaseTask may return the following errors:

  • "not_found" (type *goa.ServiceError): The specified database or task could not be found.
  • "invalid_input" (type *goa.ServiceError): The input values are malformed or missing.
  • "cancel_failed" (type *goa.ServiceError): The task could not be canceled.
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) CreateDatabase

func (c *Client) CreateDatabase(ctx context.Context, p *CreateDatabaseRequest) (res *CreateDatabaseResponse, err error)

CreateDatabase calls the "create-database" endpoint of the "control-plane" service. CreateDatabase may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "database_already_exists" (type *APIError)
  • "invalid_input" (type *goa.ServiceError)
  • "operation_already_in_progress" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) DeleteDatabase

func (c *Client) DeleteDatabase(ctx context.Context, p *DeleteDatabasePayload) (res *DeleteDatabaseResponse, err error)

DeleteDatabase calls the "delete-database" endpoint of the "control-plane" service. DeleteDatabase may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "database_not_modifiable" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "operation_already_in_progress" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) FailoverDatabaseNode

func (c *Client) FailoverDatabaseNode(ctx context.Context, p *FailoverDatabaseNodeRequest) (res *FailoverDatabaseNodeResponse, err error)

FailoverDatabaseNode calls the "failover-database-node" endpoint of the "control-plane" service. FailoverDatabaseNode may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "database_not_modifiable" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "operation_already_in_progress" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) GetCluster

func (c *Client) GetCluster(ctx context.Context) (res *Cluster, err error)

GetCluster calls the "get-cluster" endpoint of the "control-plane" service. GetCluster may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) GetDatabase

func (c *Client) GetDatabase(ctx context.Context, p *GetDatabasePayload) (res *Database, err error)

GetDatabase calls the "get-database" endpoint of the "control-plane" service. GetDatabase may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) GetDatabaseTask

func (c *Client) GetDatabaseTask(ctx context.Context, p *GetDatabaseTaskPayload) (res *Task, err error)

GetDatabaseTask calls the "get-database-task" endpoint of the "control-plane" service. GetDatabaseTask may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) GetDatabaseTaskLog

func (c *Client) GetDatabaseTaskLog(ctx context.Context, p *GetDatabaseTaskLogPayload) (res *TaskLog, err error)

GetDatabaseTaskLog calls the "get-database-task-log" endpoint of the "control-plane" service. GetDatabaseTaskLog may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) GetHost

func (c *Client) GetHost(ctx context.Context, p *GetHostPayload) (res *Host, err error)

GetHost calls the "get-host" endpoint of the "control-plane" service. GetHost may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) GetJoinOptions

func (c *Client) GetJoinOptions(ctx context.Context, p *ClusterJoinRequest) (res *ClusterJoinOptions, err error)

GetJoinOptions calls the "get-join-options" endpoint of the "control-plane" service. GetJoinOptions may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "invalid_join_token" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) GetJoinToken

func (c *Client) GetJoinToken(ctx context.Context) (res *ClusterJoinToken, err error)

GetJoinToken calls the "get-join-token" endpoint of the "control-plane" service. GetJoinToken may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) GetVersion

func (c *Client) GetVersion(ctx context.Context) (res *VersionInfo, err error)

GetVersion calls the "get-version" endpoint of the "control-plane" service. GetVersion may return the following errors:

  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) InitCluster

func (c *Client) InitCluster(ctx context.Context, p *InitClusterRequest) (res *ClusterJoinToken, err error)

InitCluster calls the "init-cluster" endpoint of the "control-plane" service. InitCluster may return the following errors:

  • "cluster_already_initialized" (type *goa.ServiceError)
  • "operation_not_supported" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) JoinCluster

func (c *Client) JoinCluster(ctx context.Context, p *ClusterJoinToken) (err error)

JoinCluster calls the "join-cluster" endpoint of the "control-plane" service. JoinCluster may return the following errors:

  • "cluster_already_initialized" (type *goa.ServiceError)
  • "invalid_join_token" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) ListDatabaseTasks

func (c *Client) ListDatabaseTasks(ctx context.Context, p *ListDatabaseTasksPayload) (res *ListDatabaseTasksResponse, err error)

ListDatabaseTasks calls the "list-database-tasks" endpoint of the "control-plane" service. ListDatabaseTasks may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) ListDatabases

func (c *Client) ListDatabases(ctx context.Context) (res *ListDatabasesResponse, err error)

ListDatabases calls the "list-databases" endpoint of the "control-plane" service. ListDatabases may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) ListHosts

func (c *Client) ListHosts(ctx context.Context) (res *ListHostsResponse, err error)

ListHosts calls the "list-hosts" endpoint of the "control-plane" service. ListHosts may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) RemoveHost

func (c *Client) RemoveHost(ctx context.Context, p *RemoveHostPayload) (res *RemoveHostResponse, err error)

RemoveHost calls the "remove-host" endpoint of the "control-plane" service. RemoveHost may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) RestartInstance

func (c *Client) RestartInstance(ctx context.Context, p *RestartInstancePayload) (res *RestartInstanceResponse, err error)

RestartInstance calls the "restart-instance" endpoint of the "control-plane" service. RestartInstance may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError): The cluster must be initialized before instance operations.
  • "invalid_input" (type *goa.ServiceError): The input values are malformed or missing.
  • "not_found" (type *goa.ServiceError): The specified database or instance could not be found.
  • "restart_failed" (type *goa.ServiceError): Restart operation could not be completed.
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) RestoreDatabase

func (c *Client) RestoreDatabase(ctx context.Context, p *RestoreDatabasePayload) (res *RestoreDatabaseResponse, err error)

RestoreDatabase calls the "restore-database" endpoint of the "control-plane" service. RestoreDatabase may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "database_not_modifiable" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "operation_already_in_progress" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) StartInstance

func (c *Client) StartInstance(ctx context.Context, p *StartInstancePayload) (res *StartInstanceResponse, err error)

StartInstance calls the "start-instance" endpoint of the "control-plane" service. StartInstance may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError): The cluster must be initialized before instance operations.
  • "invalid_input" (type *goa.ServiceError): The input values are malformed or missing.
  • "not_found" (type *goa.ServiceError): The specified database or instance could not be found.
  • "start_failed" (type *goa.ServiceError): Start operation could not be completed.
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) StopInstance

func (c *Client) StopInstance(ctx context.Context, p *StopInstancePayload) (res *StopInstanceResponse, err error)

StopInstance calls the "stop-instance" endpoint of the "control-plane" service. StopInstance may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError): The cluster must be initialized before instance operations.
  • "invalid_input" (type *goa.ServiceError): The input values are malformed or missing.
  • "not_found" (type *goa.ServiceError): The specified database or instance could not be found.
  • "stop_failed" (type *goa.ServiceError): Stop operation could not be completed.
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) SwitchoverDatabaseNode

func (c *Client) SwitchoverDatabaseNode(ctx context.Context, p *SwitchoverDatabaseNodePayload) (res *SwitchoverDatabaseNodeResponse, err error)

SwitchoverDatabaseNode calls the "switchover-database-node" endpoint of the "control-plane" service. SwitchoverDatabaseNode may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "database_not_modifiable" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "operation_already_in_progress" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

func (*Client) UpdateDatabase

func (c *Client) UpdateDatabase(ctx context.Context, p *UpdateDatabasePayload) (res *UpdateDatabaseResponse, err error)

UpdateDatabase calls the "update-database" endpoint of the "control-plane" service. UpdateDatabase may return the following errors:

  • "cluster_not_initialized" (type *goa.ServiceError)
  • "database_not_modifiable" (type *goa.ServiceError)
  • "invalid_input" (type *goa.ServiceError)
  • "not_found" (type *goa.ServiceError)
  • "operation_already_in_progress" (type *goa.ServiceError)
  • "server_error" (type *goa.ServiceError)
  • error: internal error

type Cluster

type Cluster struct {
	// Unique identifier for the cluster.
	ID Identifier
	// Current status of the cluster.
	Status *ClusterStatus
	// All of the hosts in the cluster.
	Hosts []*Host
}

Cluster is the result type of the control-plane service get-cluster method.

type ClusterCredentials

type ClusterCredentials struct {
	// The Etcd username for the new host.
	Username string
	// The Etcd password for the new host.
	Password string
	// The base64-encoded CA certificate for the cluster.
	CaCert string
	// The base64-encoded etcd client certificate for the new cluster member.
	ClientCert string
	// The base64-encoded etcd client key for the new cluster member.
	ClientKey string
	// The base64-encoded etcd server certificate for the new cluster member.
	ServerCert string
	// The base64-encoded etcd server key for the new cluster member.
	ServerKey string
}

type ClusterJoinOptions

type ClusterJoinOptions struct {
	// Connection information for the etcd cluster leader
	Leader *EtcdClusterMember
	// Credentials for the new host joining the cluster.
	Credentials *ClusterCredentials
}

ClusterJoinOptions is the result type of the control-plane service get-join-options method.

type ClusterJoinRequest

type ClusterJoinRequest struct {
	// Token to join the cluster.
	Token string
	// The unique identifier for the host that's joining the cluster.
	HostID Identifier
	// The hostname of the host that's joining the cluster.
	Hostname string
	// The IPv4 address of the host that's joining the cluster.
	Ipv4Address string
	// True if the joining member is configured to run an embedded an etcd server.
	EmbeddedEtcdEnabled bool
}

ClusterJoinRequest is the payload type of the control-plane service get-join-options method.

type ClusterJoinToken

type ClusterJoinToken struct {
	// Token to join an existing cluster.
	Token string
	// Existing server to join
	ServerURL string
}

ClusterJoinToken is the result type of the control-plane service init-cluster method.

type ClusterStatus

type ClusterStatus struct {
	// The current state of the cluster.
	State string
}

type ComponentStatus

type ComponentStatus struct {
	// Indicates if the component is healthy.
	Healthy bool
	// Error message from any errors that occurred during the health check.
	Error *string
	// Additional details about the component.
	Details map[string]any
}

type CreateDatabaseRequest

type CreateDatabaseRequest struct {
	// Unique identifier for the database.
	ID *Identifier
	// Unique identifier for the databases's owner.
	TenantID *Identifier
	// The specification for the database.
	Spec *DatabaseSpec
}

CreateDatabaseRequest is the payload type of the control-plane service create-database method.

type CreateDatabaseResponse

type CreateDatabaseResponse struct {
	// The task that will create this database.
	Task *Task
	// The database being created.
	Database *Database
}

CreateDatabaseResponse is the result type of the control-plane service create-database method.

type Database

type Database struct {
	// Unique identifier for the database.
	ID Identifier
	// Unique identifier for the databases's owner.
	TenantID *Identifier
	// The time that the database was created.
	CreatedAt string
	// The time that the database was last updated.
	UpdatedAt string
	// Current state of the database.
	State string
	// All of the instances in the database.
	Instances InstanceCollection
	// The user-provided specification for the database.
	Spec *DatabaseSpec
}

Database is the result type of the control-plane service get-database method.

func NewDatabase

func NewDatabase(vres *controlplaneviews.Database) *Database

NewDatabase initializes result type Database from viewed result type Database.

type DatabaseCollection

type DatabaseCollection []*Database

type DatabaseNodeSpec

type DatabaseNodeSpec struct {
	// The name of the database node.
	Name string
	// The IDs of the hosts that should run this node. When multiple hosts are
	// specified, one host will chosen as a primary, and the others will be read
	// replicas.
	HostIds []Identifier
	// The Postgres version for this node in 'major.minor' format. Overrides the
	// Postgres version set in the DatabaseSpec.
	PostgresVersion *string
	// The port used by the Postgres database for this node. Overrides the Postgres
	// port set in the DatabaseSpec.
	Port *int
	// The number of CPUs to allocate for the database on this node and to use for
	// tuning Postgres. It can include the SI suffix 'm', e.g. '500m' for 500
	// millicpus. Cannot allocate units smaller than 1m. Defaults to the number of
	// available CPUs on the host if 0 or unspecified. Cannot allocate more CPUs
	// than are available on the host. Whether this limit is enforced depends on
	// the orchestrator.
	Cpus *string
	// The amount of memory in SI or IEC notation to allocate for the database on
	// this node and to use for tuning Postgres. Defaults to the total available
	// memory on the host. Whether this limit is enforced depends on the
	// orchestrator.
	Memory *string
	// Additional postgresql.conf settings for this particular node. Will be merged
	// with the settings provided by control-plane.
	PostgresqlConf map[string]any
	// The backup configuration for this node. Overrides the backup configuration
	// set in the DatabaseSpec.
	BackupConfig *BackupConfigSpec
	// The restore configuration for this node. Overrides the restore configuration
	// set in the DatabaseSpec.
	RestoreConfig *RestoreConfigSpec
	// Orchestrator-specific configuration options.
	OrchestratorOpts *OrchestratorOpts
	// The name of the source node to use for sync. This is typically the node
	// (like 'n1') from which the data will be copied to initialize this new node.
	SourceNode *string
}

type DatabaseSpec

type DatabaseSpec struct {
	// The name of the Postgres database.
	DatabaseName string
	// The Postgres version in 'major.minor' format.
	PostgresVersion *string
	// The major version of the Spock extension.
	SpockVersion *string
	// The port used by the Postgres database. If the port is 0, each instance will
	// be assigned a random port. If the port is unspecified, the database will not
	// be exposed on any port, dependent on orchestrator support for that feature.
	Port *int
	// The number of CPUs to allocate for the database and to use for tuning
	// Postgres. Defaults to the number of available CPUs on the host. Can include
	// an SI suffix, e.g. '500m' for 500 millicpus. Whether this limit is enforced
	// depends on the orchestrator.
	Cpus *string
	// The amount of memory in SI or IEC notation to allocate for the database and
	// to use for tuning Postgres. Defaults to the total available memory on the
	// host. Whether this limit is enforced depends on the orchestrator.
	Memory *string
	// The Spock nodes for this database.
	Nodes []*DatabaseNodeSpec
	// The users to create for this database.
	DatabaseUsers []*DatabaseUserSpec
	// The backup configuration for this database.
	BackupConfig *BackupConfigSpec
	// The restore configuration for this database.
	RestoreConfig *RestoreConfigSpec
	// Additional postgresql.conf settings. Will be merged with the settings
	// provided by control-plane.
	PostgresqlConf map[string]any
	// Orchestrator-specific configuration options.
	OrchestratorOpts *OrchestratorOpts
}

type DatabaseUserSpec

type DatabaseUserSpec struct {
	// The username for this database user.
	Username string
	// The password for this database user. This field will be excluded from the
	// response of all endpoints. It can also be omitted from update requests to
	// keep the current value.
	Password *string
	// If true, this user will be granted database ownership.
	DbOwner *bool
	// The attributes to assign to this database user.
	Attributes []string
	// The roles to assign to this database user.
	Roles []string
}

type DeleteDatabasePayload

type DeleteDatabasePayload struct {
	// ID of the database to delete.
	DatabaseID Identifier
	// Force deletion of a database even in an unmodifiable state
	Force bool
}

DeleteDatabasePayload is the payload type of the control-plane service delete-database method.

type DeleteDatabaseResponse

type DeleteDatabaseResponse struct {
	// The task that will delete this database.
	Task *Task
}

DeleteDatabaseResponse is the result type of the control-plane service delete-database method.

type Endpoints

type Endpoints struct {
	InitCluster            goa.Endpoint
	JoinCluster            goa.Endpoint
	GetJoinToken           goa.Endpoint
	GetJoinOptions         goa.Endpoint
	GetCluster             goa.Endpoint
	ListHosts              goa.Endpoint
	GetHost                goa.Endpoint
	RemoveHost             goa.Endpoint
	ListDatabases          goa.Endpoint
	CreateDatabase         goa.Endpoint
	GetDatabase            goa.Endpoint
	UpdateDatabase         goa.Endpoint
	DeleteDatabase         goa.Endpoint
	BackupDatabaseNode     goa.Endpoint
	SwitchoverDatabaseNode goa.Endpoint
	FailoverDatabaseNode   goa.Endpoint
	ListDatabaseTasks      goa.Endpoint
	GetDatabaseTask        goa.Endpoint
	GetDatabaseTaskLog     goa.Endpoint
	RestoreDatabase        goa.Endpoint
	GetVersion             goa.Endpoint
	RestartInstance        goa.Endpoint
	StopInstance           goa.Endpoint
	StartInstance          goa.Endpoint
	CancelDatabaseTask     goa.Endpoint
}

Endpoints wraps the "control-plane" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "control-plane" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "control-plane" service endpoints.

type EtcdClusterMember

type EtcdClusterMember struct {
	// The name of the Etcd cluster member.
	Name string
	// The Etcd peer endpoint for this cluster member.
	PeerUrls []string
	// The Etcd client endpoint for this cluster member.
	ClientUrls []string
}

type ExtraNetworkSpec

type ExtraNetworkSpec struct {
	// The name or ID of the network to connect to.
	ID string
	// Optional network-scoped aliases for the container.
	Aliases []string
	// Optional driver options for the network connection.
	DriverOpts map[string]string
}

Describes an additional Docker network to attach the container to.

type ExtraVolumesSpec

type ExtraVolumesSpec struct {
	// The host path for the volume.
	HostPath string
	// The path inside the container where the volume will be mounted.
	DestinationPath string
}

Extra volumes to mount from the host to the database container.

type FailoverDatabaseNodeRequest

type FailoverDatabaseNodeRequest struct {
	// ID of the database to perform the failover for.
	DatabaseID Identifier
	// Name of the node to initiate the failover from.
	NodeName string
	// Optional instance_id of the replica to promote. If omitted, a candidate will
	// be selected.
	CandidateInstanceID *string
	// If true, skip the health validations that prevent running failover on a
	// healthy cluster.
	SkipValidation bool
}

FailoverDatabaseNodeRequest is the payload type of the control-plane service failover-database-node method.

type FailoverDatabaseNodeResponse

type FailoverDatabaseNodeResponse struct {
	// The task that will perform the failover.
	Task *Task
}

FailoverDatabaseNodeResponse is the result type of the control-plane service failover-database-node method.

type GetDatabasePayload

type GetDatabasePayload struct {
	// ID of the database to get.
	DatabaseID Identifier
}

GetDatabasePayload is the payload type of the control-plane service get-database method.

type GetDatabaseTaskLogPayload

type GetDatabaseTaskLogPayload struct {
	// ID of the database to get the task log for.
	DatabaseID Identifier
	// ID of the task to get the log for.
	TaskID string
	// ID of the entry to start from.
	AfterEntryID *string
	// Maximum number of entries to return.
	Limit *int
}

GetDatabaseTaskLogPayload is the payload type of the control-plane service get-database-task-log method.

type GetDatabaseTaskPayload

type GetDatabaseTaskPayload struct {
	// ID of the database the task belongs to.
	DatabaseID Identifier
	// ID of the task to get.
	TaskID string
}

GetDatabaseTaskPayload is the payload type of the control-plane service get-database-task method.

type GetHostPayload

type GetHostPayload struct {
	// ID of the host to get.
	HostID Identifier
}

GetHostPayload is the payload type of the control-plane service get-host method.

type Host

type Host struct {
	// Unique identifier for the host.
	ID Identifier
	// The orchestrator used by this host.
	Orchestrator string
	// The data directory for the host.
	DataDir string
	// The cohort that this host belongs to.
	Cohort *HostCohort
	// The hostname of this host.
	Hostname string
	// The IPv4 address of this host.
	Ipv4Address string
	// The number of CPUs on this host.
	Cpus *int
	// The amount of memory available on this host.
	Memory *string
	// Current status of the host.
	Status *HostStatus
	// The default PgEdge version for this host.
	DefaultPgedgeVersion *PgEdgeVersion
	// The PgEdge versions supported by this host.
	SupportedPgedgeVersions []*PgEdgeVersion
}

Host is the result type of the control-plane service get-host method.

type HostCohort

type HostCohort struct {
	// The type of cohort that the host belongs to.
	Type string
	// The member ID of the host within the cohort.
	MemberID string
	// Indicates if the host is a control node in the cohort.
	ControlAvailable bool
}

type HostStatus

type HostStatus struct {
	State string
	// The last time the host status was updated.
	UpdatedAt string
	// The status of each component of the host.
	Components map[string]*ComponentStatus
}

type Identifier

type Identifier string

A user-specified identifier. Must be 1-63 characters, contain only lower-cased letters and hyphens, start and end with a letter or number, and not contain consecutive hyphens.

type InitClusterRequest

type InitClusterRequest struct {
	// Optional id for the cluster, omit for default generated id
	ClusterID *Identifier
}

InitClusterRequest is the payload type of the control-plane service init-cluster method.

type Instance

type Instance struct {
	// Unique identifier for the instance.
	ID string
	// The ID of the host this instance is running on.
	HostID string
	// The Spock node name for this instance.
	NodeName string
	// The time that the instance was created.
	CreatedAt string
	// The time that the instance was last modified.
	UpdatedAt string
	// The time that the instance status information was last updated.
	StatusUpdatedAt *string
	State           string
	// Connection information for the instance.
	ConnectionInfo *InstanceConnectionInfo
	// Postgres status information for the instance.
	Postgres *InstancePostgresStatus
	// Spock status information for the instance.
	Spock *InstanceSpockStatus
	// An error message if the instance is in an error state.
	Error *string
}

An instance of pgEdge Postgres running on a host.

type InstanceCollection

type InstanceCollection []*Instance

type InstanceConnectionInfo

type InstanceConnectionInfo struct {
	// The hostname of the host that's running this instance.
	Hostname *string
	// The IPv4 address of the host that's running this instance.
	Ipv4Address *string
	// The host port that Postgres is listening on for this instance.
	Port *int
}

Connection information for a pgEdge instance.

type InstancePostgresStatus

type InstancePostgresStatus struct {
	// The version of Postgres for this instance.
	Version      *string
	PatroniState *string
	Role         *string
	// True if this instance has a pending restart from a configuration change.
	PendingRestart *bool
	// True if Patroni is paused for this instance.
	PatroniPaused *bool
}

Postgres status information for a pgEdge instance.

type InstanceSpockStatus

type InstanceSpockStatus struct {
	// The current spock.readonly setting.
	ReadOnly *string
	// The version of Spock for this instance.
	Version *string
	// Status information for this instance's Spock subscriptions.
	Subscriptions []*InstanceSubscription
}

Spock status information for a pgEdge instance.

type InstanceSubscription

type InstanceSubscription struct {
	// The Spock node name of the provider for this subscription.
	ProviderNode string
	// The name of the subscription.
	Name string
	// The current status of the subscription.
	Status string
}

Status information for a Spock subscription.

type ListDatabaseTasksPayload

type ListDatabaseTasksPayload struct {
	// ID of the database to list tasks for.
	DatabaseID Identifier
	// ID of the task to start from.
	AfterTaskID *string
	// Maximum number of tasks to return.
	Limit *int
	// Sort order for the tasks.
	SortOrder *string
}

ListDatabaseTasksPayload is the payload type of the control-plane service list-database-tasks method.

type ListDatabaseTasksResponse

type ListDatabaseTasksResponse struct {
	Tasks []*Task
}

ListDatabaseTasksResponse is the result type of the control-plane service list-database-tasks method.

type ListDatabasesResponse

type ListDatabasesResponse struct {
	Databases DatabaseCollection
}

ListDatabasesResponse is the result type of the control-plane service list-databases method.

func NewListDatabasesResponse

func NewListDatabasesResponse(vres *controlplaneviews.ListDatabasesResponse) *ListDatabasesResponse

NewListDatabasesResponse initializes result type ListDatabasesResponse from viewed result type ListDatabasesResponse.

type ListHostsResponse

type ListHostsResponse struct {
	// List of hosts in the cluster
	Hosts []*Host
}

ListHostsResponse is the result type of the control-plane service list-hosts method.

type OrchestratorOpts

type OrchestratorOpts struct {
	// Swarm-specific configuration.
	Swarm *SwarmOpts
}

Options specific to the selected orchestrator.

type PgEdgeVersion

type PgEdgeVersion struct {
	// The Postgres major and minor version.
	PostgresVersion string
	// The Spock major version.
	SpockVersion string
}

type RemoveHostPayload

type RemoveHostPayload struct {
	// ID of the host to remove.
	HostID Identifier
	// Force removal even if instances exist or quorum would be violated. Use only
	// for disaster recovery when a host is permanently lost.
	Force bool
}

RemoveHostPayload is the payload type of the control-plane service remove-host method.

type RemoveHostResponse added in v0.6.0

type RemoveHostResponse struct {
	// The tasks that will update databases affected by the host removal.
	UpdateDatabaseTasks []*Task
}

RemoveHostResponse is the result type of the control-plane service remove-host method.

type RestartInstancePayload

type RestartInstancePayload struct {
	// The ID of the database that owns the instance.
	DatabaseID Identifier
	// The ID of the instance to restart.
	InstanceID Identifier
	// The time at which the restart is scheduled.
	ScheduledAt *string
}

RestartInstancePayload is the payload type of the control-plane service restart-instance method.

type RestartInstanceResponse

type RestartInstanceResponse struct {
	// Task representing the restart operation
	Task *Task
}

Returns a task representing the restart operation.

type RestoreConfigSpec

type RestoreConfigSpec struct {
	// The ID of the database to restore this database from.
	SourceDatabaseID Identifier
	// The name of the node to restore this database from.
	SourceNodeName string
	// The name of the database in this repository. The database will be renamed to
	// the database_name in the DatabaseSpec after it's restored.
	SourceDatabaseName string
	// The repository to restore this database from.
	Repository *RestoreRepositorySpec
	// Additional options to use when restoring this database. If omitted, the
	// database will be restored to the latest point in the given repository.
	RestoreOptions map[string]string
}

type RestoreDatabasePayload

type RestoreDatabasePayload struct {
	// ID of the database to restore.
	DatabaseID Identifier
	Request    *RestoreDatabaseRequest
	// Force restoration of a database even in an unmodifiable state
	Force bool
}

RestoreDatabasePayload is the payload type of the control-plane service restore-database method.

type RestoreDatabaseRequest

type RestoreDatabaseRequest struct {
	// Configuration for the restore process.
	RestoreConfig *RestoreConfigSpec
	// The nodes to restore. Defaults to all nodes if empty or unspecified.
	TargetNodes []string
}

type RestoreDatabaseResponse

type RestoreDatabaseResponse struct {
	// The task that will restore this database.
	Task *Task
	// The tasks that will restore each database node.
	NodeTasks []*Task
	// The database being restored.
	Database *Database
}

RestoreDatabaseResponse is the result type of the control-plane service restore-database method.

type RestoreRepositorySpec

type RestoreRepositorySpec struct {
	// The unique identifier of this repository.
	ID *Identifier
	// The type of this repository.
	Type string
	// The S3 bucket name for this repository. Only applies when type = 's3'.
	S3Bucket *string
	// The region of the S3 bucket for this repository. Only applies when type =
	// 's3'.
	S3Region *string
	// The optional S3 endpoint for this repository. Only applies when type = 's3'.
	S3Endpoint *string
	// An optional AWS access key ID to use for this repository. If not provided,
	// pgbackrest will use the default credential provider chain.
	S3Key *string
	// The corresponding secret for the AWS access key ID in s3_key.
	S3KeySecret *string
	// The GCS bucket name for this repository. Only applies when type = 'gcs'.
	GcsBucket *string
	// The optional GCS endpoint for this repository. Only applies when type =
	// 'gcs'.
	GcsEndpoint *string
	// Optional base64-encoded private key data. If omitted, pgbackrest will use
	// the service account attached to the instance profile.
	GcsKey *string
	// The Azure account name for this repository. Only applies when type = 'azure'.
	AzureAccount *string
	// The Azure container name for this repository. Only applies when type =
	// 'azure'.
	AzureContainer *string
	// The optional Azure endpoint for this repository. Only applies when type =
	// 'azure'.
	AzureEndpoint *string
	// An optional Azure storage account access key to use for this repository. If
	// not provided, pgbackrest will use the VM's managed identity.
	AzureKey *string
	// The base path within the repository to store backups. Required for type =
	// 'posix' and 'cifs'.
	BasePath *string
	// Additional options to apply to this repository.
	CustomOptions map[string]string
}

type Service

type Service interface {
	// Initializes a new cluster.
	InitCluster(context.Context, *InitClusterRequest) (res *ClusterJoinToken, err error)
	// Joins this host to an existing cluster.
	JoinCluster(context.Context, *ClusterJoinToken) (err error)
	// Gets the join token for this cluster.
	GetJoinToken(context.Context) (res *ClusterJoinToken, err error)
	// Internal endpoint for other cluster members seeking to join this cluster.
	GetJoinOptions(context.Context, *ClusterJoinRequest) (res *ClusterJoinOptions, err error)
	// Returns information about the cluster.
	GetCluster(context.Context) (res *Cluster, err error)
	// Lists all hosts within the cluster.
	ListHosts(context.Context) (res *ListHostsResponse, err error)
	// Returns information about a particular host in the cluster.
	GetHost(context.Context, *GetHostPayload) (res *Host, err error)
	// Removes a host from the cluster.
	RemoveHost(context.Context, *RemoveHostPayload) (res *RemoveHostResponse, err error)
	// Lists all databases in the cluster.
	ListDatabases(context.Context) (res *ListDatabasesResponse, err error)
	// Creates a new database in the cluster.
	CreateDatabase(context.Context, *CreateDatabaseRequest) (res *CreateDatabaseResponse, err error)
	// Returns information about a particular database in the cluster.
	GetDatabase(context.Context, *GetDatabasePayload) (res *Database, err error)
	// Updates a database with the given specification.
	UpdateDatabase(context.Context, *UpdateDatabasePayload) (res *UpdateDatabaseResponse, err error)
	// Deletes a database from the cluster.
	DeleteDatabase(context.Context, *DeleteDatabasePayload) (res *DeleteDatabaseResponse, err error)
	// Initiates a backup for a database node.
	BackupDatabaseNode(context.Context, *BackupDatabaseNodePayload) (res *BackupDatabaseNodeResponse, err error)
	// Performs a planned switchover for a node's primary to a replica candidate.
	SwitchoverDatabaseNode(context.Context, *SwitchoverDatabaseNodePayload) (res *SwitchoverDatabaseNodeResponse, err error)
	// Performs a failover for a node to a replica candidate.
	FailoverDatabaseNode(context.Context, *FailoverDatabaseNodeRequest) (res *FailoverDatabaseNodeResponse, err error)
	// Lists all tasks for a database.
	ListDatabaseTasks(context.Context, *ListDatabaseTasksPayload) (res *ListDatabaseTasksResponse, err error)
	// Returns information about a particular task.
	GetDatabaseTask(context.Context, *GetDatabaseTaskPayload) (res *Task, err error)
	// Returns the log of a particular task for a database.
	GetDatabaseTaskLog(context.Context, *GetDatabaseTaskLogPayload) (res *TaskLog, err error)
	// Perform an in-place restore of one or more nodes using the given restore
	// configuration.
	RestoreDatabase(context.Context, *RestoreDatabasePayload) (res *RestoreDatabaseResponse, err error)
	// Returns version information for this Control Plane server.
	GetVersion(context.Context) (res *VersionInfo, err error)
	// Restarts a specific instance within a database. Supports immediate or
	// scheduled restarts.
	RestartInstance(context.Context, *RestartInstancePayload) (res *RestartInstanceResponse, err error)
	// Stops a specific instance within a database. Supports immediate stops.
	StopInstance(context.Context, *StopInstancePayload) (res *StopInstanceResponse, err error)
	// Starts a specific instance within a database. Supports immediate starts
	StartInstance(context.Context, *StartInstancePayload) (res *StartInstanceResponse, err error)
	// Cancels a running or pending task for a database.
	CancelDatabaseTask(context.Context, *CancelDatabaseTaskPayload) (res *Task, err error)
}

Service is the control-plane service interface.

type StartInstancePayload

type StartInstancePayload struct {
	// The ID of the database that owns the instance.
	DatabaseID Identifier
	// The ID of the instance to start.
	InstanceID Identifier
	// Force starting an instance even if database in an unmodifiable state
	Force bool
}

StartInstancePayload is the payload type of the control-plane service start-instance method.

type StartInstanceResponse

type StartInstanceResponse struct {
	// Task representing the start operation
	Task *Task
}

Returns a task representing the start operation.

type StopInstancePayload

type StopInstancePayload struct {
	// The ID of the database that owns the instance.
	DatabaseID Identifier
	// The ID of the instance to stop.
	InstanceID Identifier
	// Force stopping an instance even if database in an unmodifiable state
	Force bool
}

StopInstancePayload is the payload type of the control-plane service stop-instance method.

type StopInstanceResponse

type StopInstanceResponse struct {
	// Task representing the stop operation
	Task *Task
}

Returns a task representing the stop operation.

type SwarmOpts

type SwarmOpts struct {
	// A list of extra volumes to mount. Each entry defines a host and container
	// path.
	ExtraVolumes []*ExtraVolumesSpec
	// A list of additional Docker Swarm networks to attach containers in this
	// database to.
	ExtraNetworks []*ExtraNetworkSpec
	// Arbitrary labels to apply to the Docker Swarm service
	ExtraLabels map[string]string
}

Docker Swarm-specific options.

type SwitchoverDatabaseNodePayload

type SwitchoverDatabaseNodePayload struct {
	// ID of the database to operate on.
	DatabaseID Identifier
	// Name of the node to operate on.
	NodeName string
	// Optional instance_id for the replica candidate.
	CandidateInstanceID *string
	// Optional scheduled time (ISO8601) for the switchover. If absent switchover
	// happens immediately.
	ScheduledAt *string
}

SwitchoverDatabaseNodePayload is the payload type of the control-plane service switchover-database-node method.

type SwitchoverDatabaseNodeResponse

type SwitchoverDatabaseNodeResponse struct {
	// The task that will perform the switchover.
	Task *Task
}

SwitchoverDatabaseNodeResponse is the result type of the control-plane service switchover-database-node method.

type Task

type Task struct {
	// The parent task ID of the task.
	ParentID *string
	// The database ID of the task.
	DatabaseID string
	// The name of the node that the task is operating on.
	NodeName *string
	// The ID of the instance that the task is operating on.
	InstanceID *string
	// The ID of the host that the task is running on.
	HostID *string
	// The unique ID of the task.
	TaskID string
	// The time when the task was created.
	CreatedAt string
	// The time when the task was completed.
	CompletedAt *string
	// The type of the task.
	Type string
	// The status of the task.
	Status string
	// The error message if the task failed.
	Error *string
}

Task is the result type of the control-plane service get-database-task method.

type TaskLog

type TaskLog struct {
	// The database ID of the task log.
	DatabaseID string
	// The unique ID of the task log.
	TaskID string
	// The status of the task.
	TaskStatus string
	// The ID of the last entry in the task log.
	LastEntryID *string
	// Entries in the task log.
	Entries []*TaskLogEntry
}

TaskLog is the result type of the control-plane service get-database-task-log method.

type TaskLogEntry

type TaskLogEntry struct {
	// The timestamp of the log entry.
	Timestamp string
	// The log message.
	Message string
	// Additional fields for the log entry.
	Fields map[string]any
}

type UpdateDatabasePayload

type UpdateDatabasePayload struct {
	// ID of the database to update.
	DatabaseID Identifier
	// Force update the database even if the spec is the same.
	ForceUpdate bool
	Request     *UpdateDatabaseRequest
}

UpdateDatabasePayload is the payload type of the control-plane service update-database method.

type UpdateDatabaseRequest

type UpdateDatabaseRequest struct {
	// Unique identifier for the databases's owner.
	TenantID *Identifier
	// The specification for the database.
	Spec *DatabaseSpec
}

type UpdateDatabaseResponse

type UpdateDatabaseResponse struct {
	// The task that will update this database.
	Task *Task
	// The database being updated.
	Database *Database
}

UpdateDatabaseResponse is the result type of the control-plane service update-database method.

type VersionInfo

type VersionInfo struct {
	// The version of the API server.
	Version string
	// The VCS revision of the API server.
	Revision string
	// The timestamp associated with the revision.
	RevisionTime string
	// The CPU architecture of the API server.
	Arch string
}

VersionInfo is the result type of the control-plane service get-version method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL