Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type AddHeatWaveClusterIn
- type BGChannelIn
- type BGTargetIn
- type Backup
- type BackupListIn
- type BackupPolicy
- type BackupPolicyIn
- type BackupValidation
- type BlueGreen
- type BlueGreenListIn
- type BlueGreenTarget
- type Channel
- type ChannelListIn
- type ChannelLive
- type ChannelServer
- type ChannelSource
- type ChannelSourceIn
- type ChannelTarget
- type ChannelTargetIn
- type ConfigListIn
- type ConfigProvider
- type Configuration
- type ControlledRec
- type ControlledUpdateIn
- type CopyBackupIn
- type CreateBackupIn
- type CreateBlueGreenIn
- type CreateChannelIn
- type CreateConfigurationIn
- type CreateDBSystemIn
- type CreateReplicaIn
- type DBSystem
- type DBSystemListIn
- type DataStorageIn
- type DeletionPolicy
- type DeletionPolicyIn
- type Doc
- type DockerConfig
- type EngineConfigProvider
- type EstimateRec
- type GenerateStatusIn
- type Handler
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Shutdown(ctx context.Context)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- func (h *Handler) Trusted() echo.HandlerFunc
- type HeatWaveCluster
- type InMemoryBackend
- func (b *InMemoryBackend) AddHeatWaveCluster(in AddHeatWaveClusterIn) (Doc, string, string, error)
- func (b *InMemoryBackend) CancelBackupDeletion(id, ifMatch string) (string, error)
- func (b *InMemoryBackend) CancelWorkRequest(id, ifMatch, token string) error
- func (b *InMemoryBackend) ChangeBackupCompartment(id, ifMatch, compartment string) error
- func (b *InMemoryBackend) ChangeBlueGreenCompartment(id, ifMatch, compartment string) (string, error)
- func (b *InMemoryBackend) Close()
- func (b *InMemoryBackend) Compartments() []string
- func (b *InMemoryBackend) Configure(s Settings)
- func (b *InMemoryBackend) ControlledUpdateDBSystem(id, ifMatch, token string, in ControlledUpdateIn) (string, error)
- func (b *InMemoryBackend) CopyBackup(in CopyBackupIn) (Doc, string, string, error)
- func (b *InMemoryBackend) CreateBackup(in CreateBackupIn) (Doc, string, string, error)
- func (b *InMemoryBackend) CreateBlueGreen(in CreateBlueGreenIn) (Doc, string, string, error)
- func (b *InMemoryBackend) CreateChannel(in CreateChannelIn) (Doc, string, string, error)
- func (b *InMemoryBackend) CreateConfiguration(in CreateConfigurationIn) (Doc, string, error)
- func (b *InMemoryBackend) CreateDBSystem(in CreateDBSystemIn) (Doc, string, string, error)
- func (b *InMemoryBackend) CreateReplica(in CreateReplicaIn) (Doc, string, string, error)
- func (b *InMemoryBackend) DeleteBackup(id, ifMatch string) (string, error)
- func (b *InMemoryBackend) DeleteBlueGreen(id, ifMatch string) (string, error)
- func (b *InMemoryBackend) DeleteChannel(id, ifMatch string) (string, error)
- func (b *InMemoryBackend) DeleteConfiguration(id, ifMatch string) error
- func (b *InMemoryBackend) DeleteDBSystem(id, ifMatch string) (string, error)
- func (b *InMemoryBackend) DeleteHeatWaveCluster(id, ifMatch string) (string, error)
- func (b *InMemoryBackend) DeleteReplica(id, ifMatch string) (string, error)
- func (b *InMemoryBackend) EnableDockerEngine(cfg DockerConfig) error
- func (b *InMemoryBackend) GenerateChannelStatus(id, token string) (Doc, string, error)
- func (b *InMemoryBackend) GenerateDBSystemStatus(id string, in GenerateStatusIn) (Doc, string, error)
- func (b *InMemoryBackend) GenerateHeatWaveEstimate(id, token string) (Doc, string, error)
- func (b *InMemoryBackend) GetBackup(id string) (Doc, string, error)
- func (b *InMemoryBackend) GetBlueGreen(id string) (Doc, string, error)
- func (b *InMemoryBackend) GetChannel(id string) (Doc, string, error)
- func (b *InMemoryBackend) GetChannelStatus(id string) (Doc, error)
- func (b *InMemoryBackend) GetConfiguration(id string) (Doc, string, error)
- func (b *InMemoryBackend) GetDBSystem(id string) (Doc, string, error)
- func (b *InMemoryBackend) GetDBSystemStatus(id string) (Doc, error)
- func (b *InMemoryBackend) GetHeatWaveCluster(id string) (Doc, string, error)
- func (b *InMemoryBackend) GetHeatWaveEstimate(id string) (Doc, error)
- func (b *InMemoryBackend) GetReplica(id string) (Doc, string, error)
- func (b *InMemoryBackend) GetWorkRequest(id string) (WorkRequestWire, error)
- func (b *InMemoryBackend) ListBackups(in BackupListIn) (page.Page[Doc], error)
- func (b *InMemoryBackend) ListBlueGreens(in BlueGreenListIn) (page.Page[Doc], error)
- func (b *InMemoryBackend) ListChannels(in ChannelListIn) (page.Page[Doc], error)
- func (b *InMemoryBackend) ListConfigurations(in ConfigListIn) (page.Page[Doc], error)
- func (b *InMemoryBackend) ListDBSystems(in DBSystemListIn) (page.Page[Doc], error)
- func (b *InMemoryBackend) ListMaintenanceEvents(in MaintenanceListIn) (page.Page[Doc], error)
- func (b *InMemoryBackend) ListReplicas(in ReplicaListIn) (page.Page[Doc], error)
- func (b *InMemoryBackend) ListShapes(compartment string, supportedFor []string, name string) ([]Doc, error)
- func (b *InMemoryBackend) ListVersions(compartment string) ([]Doc, error)
- func (b *InMemoryBackend) ListWorkRequests(compartment string, o ListOpts) (page.Page[WorkRequestWire], error)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) ResetChannel(id, ifMatch, token string) (string, error)
- func (b *InMemoryBackend) RestartDBSystem(id, ifMatch, token, shutdown string) (string, error)
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) ResumeChannel(id, ifMatch, token string) (string, error)
- func (b *InMemoryBackend) SetClock(now func() time.Time)
- func (b *InMemoryBackend) SetCompartmentChecker(fn func(string) bool)
- func (b *InMemoryBackend) SetLauncher(l Launcher, image string)
- func (b *InMemoryBackend) SetNetwork(n Network)
- func (b *InMemoryBackend) SetTransition(d time.Duration)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartDBSystem(id, ifMatch, token string) (string, error)
- func (b *InMemoryBackend) StopDBSystem(id, ifMatch, token, shutdown string) (string, error)
- func (b *InMemoryBackend) Sweep()
- func (b *InMemoryBackend) SwitchoverBlueGreen(id, ifMatch, token string, waitSeconds *int) (Doc, string, string, error)
- func (b *InMemoryBackend) UpdateBackup(id, ifMatch string, in UpdateBackupIn) (Doc, string, error)
- func (b *InMemoryBackend) UpdateBlueGreen(id, ifMatch string, in UpdateBlueGreenIn) (string, error)
- func (b *InMemoryBackend) UpdateChannel(id, ifMatch, token string, in UpdateChannelIn) (string, error)
- func (b *InMemoryBackend) UpdateConfiguration(id, ifMatch string, in UpdateConfigurationIn) (Doc, string, error)
- func (b *InMemoryBackend) UpdateDBSystem(id, ifMatch string, in UpdateDBSystemIn) (string, error)
- func (b *InMemoryBackend) UpdateHeatWaveCluster(id, ifMatch string, in UpdateHeatWaveClusterIn) (string, error)
- func (b *InMemoryBackend) UpdateReplica(id, ifMatch string, in UpdateReplicaIn) (string, error)
- func (b *InMemoryBackend) ValidateBackup(id, ifMatch, token string, in ValidateBackupIn) (Doc, string, string, error)
- func (b *InMemoryBackend) WorkRequestErrors(id string, o ListOpts) (page.Page[wrErrorWire], error)
- func (b *InMemoryBackend) WorkRequestLogs(id string, o ListOpts) (page.Page[wrLogWire], error)
- type Instance
- type LaunchSpec
- type Launcher
- type ListOpts
- type MaintenanceEvent
- type MaintenanceListIn
- type Network
- type Provider
- type Querier
- type Recoverer
- type Replica
- type ReplicaListIn
- type ReplicaOverrides
- type ReplicaOverridesIn
- type Replicable
- type SchemaEstimate
- type Seeder
- type Settings
- type Source
- type SourceIn
- type StatusRec
- type SubnetInfo
- type TableEstimate
- type Tags
- type UpdateBackupIn
- type UpdateBlueGreenIn
- type UpdateChannelIn
- type UpdateConfigurationIn
- type UpdateDBSystemIn
- type UpdateHeatWaveClusterIn
- type UpdateReplicaIn
- type ValidateBackupIn
- type WorkRequest
- type WorkRequestWire
- type XEndpointer
Constants ¶
const ( DefaultMaxManualBackups = 1200 DefaultMaxStorageGB = 100000 DefaultMaxShapeInstances = 100 DefaultMaxParallelCopies = 5 )
Service limits of https://docs.oracle.com/en-us/iaas/Content/General/Concepts/servicelimits.htm (MySQL HeatWave, Oracle Universal Credits column). MySQL.256 is limited to a tenth of the other shapes.
const ( EngineStub = "stub" EngineDocker = "docker" )
Engine modes (OCI_MYSQL_ENGINE).
const DefaultPort = 8159
DefaultPort is the dedicated listener's default TCP port.
const (
// Region is the emulated region name.
Region = "us-ashburn-1"
)
Variables ¶
var ErrNilAppContext = errors.New("ocimysql: nil app context")
ErrNilAppContext is returned when Init is called with a nil AppContext.
var ErrSnapshotNull = errors.New("ocimysql: null entry in snapshot")
ErrSnapshotNull is returned when a snapshot contains a null entry.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.
type AddHeatWaveClusterIn ¶
type AddHeatWaveClusterIn struct {
ClusterSize *int `json:"clusterSize"`
Lakehouse *bool `json:"isLakehouseEnabled"`
ShapeName string `json:"shapeName"`
RetryToken string `json:"-"`
IfMatch string `json:"-"`
DBSystemID string `json:"-"`
}
AddHeatWaveClusterIn is the AddHeatWaveCluster body.
type BGChannelIn ¶
type BGChannelIn struct {
SourceUsername string `json:"sourceUsername"`
SourcePassword string `json:"sourcePassword"`
SslMode string `json:"sslMode"`
ApplierUsername string `json:"applierUsername"`
SslCaCertificate jsontext.Value `json:"sslCaCertificate"`
}
BGChannelIn is the channelDetails of CreateBlueGreenDeployment.
type BGTargetIn ¶
type BGTargetIn struct {
DataGB *int `json:"dataStorageSizeInGBs"`
MysqlVersion string `json:"mysqlVersion"`
ShapeName string `json:"shapeName"`
ConfigurationID string `json:"configurationId"`
}
BGTargetIn is the targetDbSystemDetails of CreateBlueGreenDeployment.
type Backup ¶
type Backup struct {
TimeCreated time.Time `json:"timeCreated"`
TimeUpdated time.Time `json:"timeUpdated"`
TransitionAt *time.Time `json:"transitionAt,omitempty"`
ScheduledAt *time.Time `json:"scheduledAt,omitempty"`
RetainFrom *time.Time `json:"retainFrom,omitempty"`
Snapshot *DBSystem `json:"snapshot,omitempty"`
Tags Tags `json:"tags"`
ID string `json:"id"`
CompartmentID string `json:"compartmentId"`
DBSystemID string `json:"dbSystemId"`
Name string `json:"displayName"`
Description string `json:"description,omitempty"`
State string `json:"state"`
Details string `json:"details,omitempty"`
BackupType string `json:"backupType"`
CreationType string `json:"creationType"`
SoftDelete string `json:"softDelete"`
Etag string `json:"etag"`
Validation *BackupValidation `json:"validation,omitempty"`
TimeCopied *time.Time `json:"timeCopyCreated,omitempty"`
ImmediateSrc string `json:"immediateSourceBackupId,omitempty"`
OriginalSrc string `json:"originalSourceBackupId,omitempty"`
Dump []byte `json:"dump,omitempty"`
Retention int `json:"retentionInDays"`
SizeGB int `json:"backupSizeInGBs"`
Seq int64 `json:"seq"`
}
Backup is a DB system backup. Dump holds the logical dump when the docker engine took it.
type BackupListIn ¶
type BackupListIn struct {
Compartment string
ID string
DBSystemID string
Name string
State string
CreationType string
ListOpts
}
BackupListIn are the ListBackups filters.
type BackupPolicy ¶
type BackupPolicy struct {
Tags Tags `json:"tags"`
WindowStartTime string `json:"windowStartTime"`
SoftDelete string `json:"softDelete"`
CopyPolicies jsontext.Value `json:"copyPolicies,omitempty"`
RetentionInDays int `json:"retentionInDays"`
IsEnabled bool `json:"isEnabled"`
PitrEnabled bool `json:"pitrEnabled"`
}
BackupPolicy is the automatic backup policy of a DB system.
type BackupPolicyIn ¶
type BackupPolicyIn struct {
Tags
IsEnabled *bool `json:"isEnabled"`
PitrPolicy *struct{ IsEnabled *bool } `json:"pitrPolicy"`
WindowStartTime *string `json:"windowStartTime"`
RetentionInDays *int `json:"retentionInDays"`
SoftDelete string `json:"softDelete"`
CopyPolicies jsontext.Value `json:"copyPolicies"`
}
BackupPolicyIn is the create/update backup policy.
type BackupValidation ¶
type BackupValidation struct {
TimeLast *time.Time `json:"timeLastValidated,omitempty"`
PreparedAt *time.Time `json:"timePrepared,omitempty"`
Status string `json:"validationStatus"`
Duration string `json:"estimatedRestoreDuration,omitempty"`
Error string `json:"errorMessage,omitempty"`
Prepared bool `json:"prepared"`
}
BackupValidation is the outcome of the last ValidateBackup.
type BlueGreen ¶
type BlueGreen struct {
TimeCreated time.Time `json:"timeCreated"`
TimeUpdated time.Time `json:"timeUpdated"`
Tags Tags `json:"tags"`
TransitionAt *time.Time `json:"transitionAt,omitempty"`
ID string `json:"id"`
CompartmentID string `json:"compartmentId"`
Name string `json:"displayName"`
State string `json:"state"`
After string `json:"after,omitempty"`
Details string `json:"details,omitempty"`
Etag string `json:"etag"`
SourceID string `json:"sourceDbSystemId"`
TargetID string `json:"targetDbSystemId"`
ActiveID string `json:"activeDbSystemId"`
ChannelID string `json:"replicationChannelId"`
SslMode string `json:"sslMode"`
Switchover string `json:"switchoverStatus"`
Target BlueGreenTarget `json:"target"`
Seq int64 `json:"seq"`
}
BlueGreen is a blue/green deployment: a green copy of a DB system kept in sync by a channel until switchover.
type BlueGreenListIn ¶
type BlueGreenListIn struct {
Compartment string
SourceID string
TargetID string
Name string
State string
ListOpts
}
BlueGreenListIn are the ListBlueGreenDeployments filters.
type BlueGreenTarget ¶
type BlueGreenTarget struct {
MysqlVersion string `json:"mysqlVersion"`
ShapeName string `json:"shapeName,omitempty"`
ConfigurationID string `json:"configurationId,omitempty"`
DataGB int `json:"dataStorageSizeInGBs,omitempty"`
}
BlueGreenTarget are the overrides of the green DB system.
type Channel ¶
type Channel struct {
TimeCreated time.Time `json:"timeCreated"`
TimeUpdated time.Time `json:"timeUpdated"`
Tags Tags `json:"tags"`
TransitionAt *time.Time `json:"transitionAt,omitempty"`
Live *ChannelLive `json:"-"`
Details string `json:"details,omitempty"`
ID string `json:"id"`
CompartmentID string `json:"compartmentId"`
Name string `json:"displayName"`
Description string `json:"description,omitempty"`
State string `json:"state"`
After string `json:"after,omitempty"`
Etag string `json:"etag"`
Target ChannelTarget `json:"target"`
Status *StatusRec `json:"status,omitempty"`
Source ChannelSource `json:"source"`
Seq int64 `json:"seq"`
Enabled bool `json:"isEnabled"`
}
Channel is a replication channel; under the docker engine its target server replicates from the source.
type ChannelListIn ¶
type ChannelListIn struct {
Compartment string
DBSystemID string
ID string
Name string
State string
IsEnabled *bool
ListOpts
}
ChannelListIn are the ListChannels filters.
type ChannelLive ¶
ChannelLive is the replication health last read from the target server.
type ChannelServer ¶
type ChannelServer interface {
JoinNetwork(ctx context.Context, src mysqlengine.ReplSource) error
AddChannel(ctx context.Context, c mysqlengine.ChannelSpec, start bool) error
SetChannel(ctx context.Context, name string, on bool) error
RemoveChannel(ctx context.Context, name string) error
ChannelStatus(ctx context.Context, name string) (mysqlengine.ChannelState, error)
}
ChannelServer is implemented by servers that run inbound replication channels.
type ChannelSource ¶
type ChannelSource struct {
Extra map[string]jsontext.Value `json:"extra,omitempty"`
SourceType string `json:"sourceType"`
Hostname string `json:"hostname"`
Username string `json:"username"`
SslMode string `json:"sslMode"`
Password string `json:"-"`
Port int `json:"port"`
HasPassword bool `json:"hasPassword"`
}
ChannelSource is the replication source of a channel; the password is never stored.
type ChannelSourceIn ¶
type ChannelSourceIn struct {
Port *int `json:"port"`
SourceType string `json:"sourceType"`
Hostname string `json:"hostname"`
Username string `json:"username"`
Password string `json:"password"`
SslMode string `json:"sslMode"`
}
ChannelSourceIn is the channel source details; the password is validated and discarded.
type ChannelTarget ¶
type ChannelTarget struct {
TargetType string `json:"targetType"`
DBSystemID string `json:"dbSystemId"`
ChannelName string `json:"channelName"`
ApplierUsername string `json:"applierUsername"`
TablesWithoutPrimaryKeyHandling string `json:"tablesWithoutPrimaryKeyHandling"`
Filters jsontext.Value `json:"filters,omitempty"`
DelayInSeconds int `json:"delayInSeconds"`
}
ChannelTarget is the DB system a channel replicates into.
type ChannelTargetIn ¶
type ChannelTargetIn struct {
DelayInSeconds *int `json:"delayInSeconds"`
TargetType string `json:"targetType"`
DBSystemID string `json:"dbSystemId"`
ChannelName string `json:"channelName"`
ApplierUsername string `json:"applierUsername"`
TablesWithoutPrimaryKeyHandling string `json:"tablesWithoutPrimaryKeyHandling"`
Filters jsontext.Value `json:"filters"`
}
ChannelTargetIn is the channel target details.
type ConfigListIn ¶
type ConfigListIn struct {
Compartment string
ID string
State string
Name string
Shape string
Types []string
ListOpts
}
ConfigListIn are the ListConfigurations filters.
type ConfigProvider ¶
type ConfigProvider interface {
GetOCIMySQLSettings() Settings
}
ConfigProvider extracts OCI MySQL configuration from the AppContext Config.
type Configuration ¶
type Configuration struct {
TimeCreated time.Time `json:"timeCreated"`
TimeUpdated time.Time `json:"timeUpdated"`
Variables map[string]any `json:"variables"`
Tags Tags `json:"tags"`
ID string `json:"id"`
CompartmentID string `json:"compartmentId"`
Shape string `json:"shapeName"`
Type string `json:"type"`
State string `json:"state"`
Name string `json:"displayName"`
Description string `json:"description,omitempty"`
ParentID string `json:"parentConfigurationId,omitempty"`
LowerCase string `json:"lowerCaseTableNames,omitempty"`
Etag string `json:"etag"`
Seq int64 `json:"seq"`
}
Configuration is a DEFAULT or CUSTOM set of MySQL variables for a shape.
type ControlledRec ¶
type ControlledRec struct {
Version string `json:"targetMysqlVersion,omitempty"`
Targets string `json:"targetDbInstances,omitempty"`
}
ControlledRec is the last controlled update processed on a DB system.
type ControlledUpdateIn ¶
type ControlledUpdateIn struct {
TargetMysqlVersion string `json:"targetMysqlVersion"`
TargetDBInstances string `json:"targetDbInstances"`
}
ControlledUpdateIn is the ControlledUpdateDbSystem body.
type CopyBackupIn ¶
type CopyBackupIn struct {
RetryToken string `json:"-"`
IfMatch string `json:"-"`
Retention *int `json:"backupCopyRetentionInDays"`
CompartmentID string `json:"compartmentId"`
SourceBackupID string `json:"sourceBackupId"`
SourceRegion string `json:"sourceRegion"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
}
CopyBackupIn is the CopyBackup body.
type CreateBackupIn ¶
type CreateBackupIn struct {
RetryToken string `json:"-"`
Tags
Retention *int `json:"retentionInDays"`
DBSystemID string `json:"dbSystemId"`
Name string `json:"displayName"`
Description string `json:"description"`
SoftDelete string `json:"softDelete"`
BackupType string `json:"backupType"`
}
CreateBackupIn is the CreateBackup body.
type CreateBlueGreenIn ¶
type CreateBlueGreenIn struct {
Tags
RetryToken string `json:"-"`
CompartmentID string `json:"compartmentId"`
DisplayName string `json:"displayName"`
SourceID string `json:"sourceDbSystemId"`
Target BGTargetIn `json:"targetDbSystemDetails"`
Channel BGChannelIn `json:"channelDetails"`
}
CreateBlueGreenIn is the CreateBlueGreenDeployment body.
type CreateChannelIn ¶
type CreateChannelIn struct {
RetryToken string `json:"-"`
Tags
IsEnabled *bool `json:"isEnabled"`
Source ChannelSourceIn `json:"source"`
CompartmentID string `json:"compartmentId"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
Target ChannelTargetIn `json:"target"`
}
CreateChannelIn is the CreateChannel body.
type CreateConfigurationIn ¶
type CreateConfigurationIn struct {
RetryToken string `json:"-"`
Tags
Variables map[string]any `json:"variables"`
InitVariables *struct {
LowerCaseTableNames string `json:"lowerCaseTableNames"`
} `json:"initVariables"`
CompartmentID string `json:"compartmentId"`
ShapeName string `json:"shapeName"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
ParentID string `json:"parentConfigurationId"`
}
CreateConfigurationIn is the CreateConfiguration body.
type CreateDBSystemIn ¶
type CreateDBSystemIn struct {
RetryToken string `json:"-"`
Tags
Extra map[string]jsontext.Value `json:"-"`
IsHighlyAvailable *bool `json:"isHighlyAvailable"`
DataStorageGBs *int `json:"dataStorageSizeInGBs"`
Port *int `json:"port"`
PortX *int `json:"portX"`
DataStorage *DataStorageIn `json:"dataStorage"`
BackupPolicy *BackupPolicyIn `json:"backupPolicy"`
Source *SourceIn `json:"source"`
DeletionPolicy *DeletionPolicyIn `json:"deletionPolicy"`
Maintenance map[string]any `json:"maintenance"`
Description string `json:"description"`
AdminPassword string `json:"adminPassword"`
DisplayName string `json:"displayName"`
ShapeName string `json:"shapeName"`
AvailabilityDom string `json:"availabilityDomain"`
FaultDomain string `json:"faultDomain"`
ConfigurationID string `json:"configurationId"`
MysqlVersion string `json:"mysqlVersion"`
AdminUsername string `json:"adminUsername"`
SubnetID string `json:"subnetId"`
HostnameLabel string `json:"hostnameLabel"`
IPAddress string `json:"ipAddress"`
CrashRecovery string `json:"crashRecovery"`
DBManagement string `json:"databaseManagement"`
DatabaseMode string `json:"databaseMode"`
AccessMode string `json:"accessMode"`
CompartmentID string `json:"compartmentId"`
}
CreateDBSystemIn is the CreateDBSystem body.
type CreateReplicaIn ¶
type CreateReplicaIn struct {
RetryToken string `json:"-"`
Tags
IsDeleteProtected *bool `json:"isDeleteProtected"`
ReplicaOverrides *ReplicaOverridesIn `json:"replicaOverrides"`
DBSystemID string `json:"dbSystemId"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
}
CreateReplicaIn is the CreateReplica body.
type DBSystem ¶
type DBSystem struct {
TimeCreated time.Time `json:"timeCreated"`
TimeUpdated time.Time `json:"timeUpdated"`
LastAutoBackup time.Time `json:"lastAutoBackup"`
Tags Tags `json:"tags"`
PitrBase *time.Time `json:"pitrBase,omitempty"`
PitrFreeze *time.Time `json:"pitrFreeze,omitempty"`
TransitionAt *time.Time `json:"transitionAt,omitempty"`
Source *Source `json:"source,omitempty"`
HeatWave *HeatWaveCluster `json:"heatWaveCluster,omitempty"`
Extra map[string]jsontext.Value `json:"extra,omitempty"`
Maintenance map[string]any `json:"maintenance,omitempty"`
Status *StatusRec `json:"status,omitempty"`
Estimate *EstimateRec `json:"memoryEstimate,omitempty"`
Controlled *ControlledRec `json:"controlledUpdate,omitempty"`
Hostname string `json:"hostnameLabel,omitempty"`
RootSecret string `json:"rootSecret,omitempty"`
ID string `json:"id"`
CompartmentID string `json:"compartmentId"`
Name string `json:"displayName"`
Description string `json:"description,omitempty"`
SubnetID string `json:"subnetId"`
Shape string `json:"shapeName"`
Version string `json:"mysqlVersion"`
ConfigID string `json:"configurationId"`
FD string `json:"faultDomain"`
AD string `json:"availabilityDomain"`
EngineHost string `json:"engineHost,omitempty"`
State string `json:"state"`
After string `json:"after,omitempty"`
Details string `json:"details,omitempty"`
Etag string `json:"etag"`
IP string `json:"ipAddress"`
AdminPass string `json:"adminPassword,omitempty"`
AdminUser string `json:"adminUsername"`
DatabaseMode string `json:"databaseMode"`
AccessMode string `json:"accessMode"`
CrashRecovery string `json:"crashRecovery"`
DBManagement string `json:"databaseManagement"`
AppliedConfig string `json:"appliedConfig,omitempty"`
ReadIP string `json:"readEndpointIp,omitempty"`
Deletion DeletionPolicy `json:"deletionPolicy"`
BackupPolicy BackupPolicy `json:"backupPolicy"`
DataGB int `json:"dataStorageSizeInGBs"`
MaxGB int `json:"maxStorageSizeInGBs,omitempty"`
Port int `json:"port"`
PortX int `json:"portX"`
EnginePort int `json:"enginePort,omitempty"`
EngineXPort int `json:"engineXPort,omitempty"`
Seq int64 `json:"seq"`
ServerID uint32 `json:"serverID,omitempty"`
AutoExpand bool `json:"isAutoExpandStorageEnabled"`
HA bool `json:"isHighlyAvailable"`
}
DBSystem is a MySQL DB system. AdminPassword and RootSecret are never returned by the API.
type DBSystemListIn ¶
type DBSystemListIn struct {
Compartment string
ID string
Name string
State string
ConfigurationID string
HeatWave *bool
ListOpts
}
DBSystemListIn are the ListDBSystems filters.
type DataStorageIn ¶
type DataStorageIn struct {
IsAutoExpandStorageEnabled *bool `json:"isAutoExpandStorageEnabled"`
MaxStorageSizeInGBs *int `json:"maxStorageSizeInGBs"`
}
DataStorageIn is dataStorage.
type DeletionPolicy ¶
type DeletionPolicy struct {
AutomaticBackupRetention string `json:"automaticBackupRetention"`
FinalBackup string `json:"finalBackup"`
IsDeleteProtected bool `json:"isDeleteProtected"`
}
DeletionPolicy controls what DeleteDBSystem does.
type DeletionPolicyIn ¶
type DeletionPolicyIn struct {
IsDeleteProtected *bool `json:"isDeleteProtected"`
AutomaticBackupRetention string `json:"automaticBackupRetention"`
FinalBackup string `json:"finalBackup"`
}
DeletionPolicyIn is the create/update deletion policy.
type DockerConfig ¶
type DockerConfig struct {
Runtime mysqlengine.Runtime
Volumes container.VolumeRuntime
Ports *portalloc.Allocator
Logger *slog.Logger
Image string
StartTimeout time.Duration
}
DockerConfig configures the docker engine: each DB system runs a mysql container with a named data volume.
type EngineConfigProvider ¶
type EngineConfigProvider interface {
GetOCIMySQLEngine() string
}
EngineConfigProvider exposes the effective engine mode (stub or docker).
type EstimateRec ¶
type EstimateRec struct {
TimeCreated time.Time `json:"timeCreated"`
TimeUpdated time.Time `json:"timeUpdated"`
State string `json:"state"`
Schemas []SchemaEstimate `json:"schemas"`
}
EstimateRec is the last HeatWave memory estimate of a DB system.
type GenerateStatusIn ¶
type GenerateStatusIn struct {
GtidSetType string `json:"gtidSetType"`
GtidSetToApply string `json:"gtidSetToApply"`
RetryToken string `json:"-"`
ChannelIDs []string `json:"channelIds"`
}
GenerateStatusIn is the GenerateDbSystemStatus body.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
Port int
EnforceAuth bool
// contains filtered or unexported fields
}
Handler serves OCI MySQL HeatWave Database Service.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a Handler; callers override Port and EnforceAuth from Settings.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name for metrics.
func (*Handler) ExtractResource ¶
ExtractResource returns the addressed resource id for metrics.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists the supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler for all OCIMySQL requests.
func (*Handler) MatchPriority ¶
MatchPriority is irrelevant because RouteMatcher never matches.
func (*Handler) RouteMatcher ¶
RouteMatcher never matches: OCIMySQL runs on its own listener.
func (*Handler) Snapshot ¶
Snapshot implements persistence.Persistable by delegating to the backend.
func (*Handler) StartWorker ¶
StartWorker binds the dedicated listener synchronously so a port conflict is returned to the caller.
func (*Handler) Trusted ¶
func (h *Handler) Trusted() echo.HandlerFunc
Trusted returns a handler that skips request-signature verification, for the in-process dashboard proxy.
type HeatWaveCluster ¶
type HeatWaveCluster struct {
TimeCreated time.Time `json:"timeCreated"`
TimeUpdated time.Time `json:"timeUpdated"`
TransitionAt *time.Time `json:"transitionAt,omitempty"`
Shape string `json:"shapeName"`
State string `json:"state"`
After string `json:"after,omitempty"`
Etag string `json:"etag"`
NodeIDs []string `json:"nodeIds"`
Size int `json:"clusterSize"`
Lakehouse bool `json:"isLakehouseEnabled"`
}
HeatWaveCluster is the analytics cluster attached to a DB system.
type InMemoryBackend ¶
InMemoryBackend holds every DB system, backup, channel, configuration and work request under one lock.
func NewInMemoryBackend ¶
func NewInMemoryBackend() *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) AddHeatWaveCluster ¶
func (b *InMemoryBackend) AddHeatWaveCluster(in AddHeatWaveClusterIn) (Doc, string, string, error)
AddHeatWaveCluster attaches a HeatWave cluster to an ACTIVE DB system.
func (*InMemoryBackend) CancelBackupDeletion ¶
func (b *InMemoryBackend) CancelBackupDeletion(id, ifMatch string) (string, error)
CancelBackupDeletion returns a DELETE_SCHEDULED backup to ACTIVE with a fresh retention window.
func (*InMemoryBackend) CancelWorkRequest ¶
func (b *InMemoryBackend) CancelWorkRequest(id, ifMatch, token string) error
CancelWorkRequest cancels a work request that has not finished; the resource transition it describes still runs.
func (*InMemoryBackend) ChangeBackupCompartment ¶
func (b *InMemoryBackend) ChangeBackupCompartment(id, ifMatch, compartment string) error
ChangeBackupCompartment moves a backup to another compartment.
func (*InMemoryBackend) ChangeBlueGreenCompartment ¶
func (b *InMemoryBackend) ChangeBlueGreenCompartment(id, ifMatch, compartment string) (string, error)
ChangeBlueGreenCompartment moves a deployment to another compartment.
func (*InMemoryBackend) Close ¶
func (b *InMemoryBackend) Close()
Close stops engine goroutines and removes the servers; data volumes are kept.
func (*InMemoryBackend) Compartments ¶
func (b *InMemoryBackend) Compartments() []string
Compartments lists the distinct compartments that hold DB systems.
func (*InMemoryBackend) Configure ¶
func (b *InMemoryBackend) Configure(s Settings)
Configure applies the service limits.
func (*InMemoryBackend) ControlledUpdateDBSystem ¶
func (b *InMemoryBackend) ControlledUpdateDBSystem(id, ifMatch, token string, in ControlledUpdateIn) (string, error)
ControlledUpdateDBSystem updates the chosen subset of a highly available DB system's instances.
func (*InMemoryBackend) CopyBackup ¶
func (b *InMemoryBackend) CopyBackup(in CopyBackupIn) (Doc, string, string, error)
CopyBackup creates a copy of a backup held in another region.
func (*InMemoryBackend) CreateBackup ¶
func (b *InMemoryBackend) CreateBackup(in CreateBackupIn) (Doc, string, string, error)
CreateBackup starts a manual backup of an ACTIVE DB system.
func (*InMemoryBackend) CreateBlueGreen ¶
func (b *InMemoryBackend) CreateBlueGreen(in CreateBlueGreenIn) (Doc, string, string, error)
CreateBlueGreen creates the green DB system and the channel that keeps it in sync with the blue one.
func (*InMemoryBackend) CreateChannel ¶
func (b *InMemoryBackend) CreateChannel(in CreateChannelIn) (Doc, string, string, error)
CreateChannel creates a replication channel record.
func (*InMemoryBackend) CreateConfiguration ¶
func (b *InMemoryBackend) CreateConfiguration(in CreateConfigurationIn) (Doc, string, error)
CreateConfiguration creates a CUSTOM configuration.
func (*InMemoryBackend) CreateDBSystem ¶
func (b *InMemoryBackend) CreateDBSystem(in CreateDBSystemIn) (Doc, string, string, error)
CreateDBSystem creates a DB system in CREATING state and returns its body, etag and work request.
func (*InMemoryBackend) CreateReplica ¶
func (b *InMemoryBackend) CreateReplica(in CreateReplicaIn) (Doc, string, string, error)
CreateReplica creates a read replica of an ACTIVE DB system.
func (*InMemoryBackend) DeleteBackup ¶
func (b *InMemoryBackend) DeleteBackup(id, ifMatch string) (string, error)
DeleteBackup deletes a backup and returns its work request.
func (*InMemoryBackend) DeleteBlueGreen ¶
func (b *InMemoryBackend) DeleteBlueGreen(id, ifMatch string) (string, error)
DeleteBlueGreen removes the deployment and its channel; both DB systems are kept.
func (*InMemoryBackend) DeleteChannel ¶
func (b *InMemoryBackend) DeleteChannel(id, ifMatch string) (string, error)
DeleteChannel deletes a channel.
func (*InMemoryBackend) DeleteConfiguration ¶
func (b *InMemoryBackend) DeleteConfiguration(id, ifMatch string) error
DeleteConfiguration deletes a custom configuration that no DB system uses.
func (*InMemoryBackend) DeleteDBSystem ¶
func (b *InMemoryBackend) DeleteDBSystem(id, ifMatch string) (string, error)
DeleteDBSystem deletes a DB system, honouring its deletion policy.
func (*InMemoryBackend) DeleteHeatWaveCluster ¶
func (b *InMemoryBackend) DeleteHeatWaveCluster(id, ifMatch string) (string, error)
DeleteHeatWaveCluster detaches the cluster; it disappears when the work request finishes.
func (*InMemoryBackend) DeleteReplica ¶
func (b *InMemoryBackend) DeleteReplica(id, ifMatch string) (string, error)
DeleteReplica deletes a read replica and returns its work request.
func (*InMemoryBackend) EnableDockerEngine ¶
func (b *InMemoryBackend) EnableDockerEngine(cfg DockerConfig) error
EnableDockerEngine switches the backend to docker mode. Call it before serving.
func (*InMemoryBackend) GenerateChannelStatus ¶
func (b *InMemoryBackend) GenerateChannelStatus(id, token string) (Doc, string, error)
GenerateChannelStatus collects the status of a channel and returns it with its work request.
func (*InMemoryBackend) GenerateDBSystemStatus ¶
func (b *InMemoryBackend) GenerateDBSystemStatus(id string, in GenerateStatusIn) (Doc, string, error)
GenerateDBSystemStatus collects the status of a DB system and returns it with its work request.
func (*InMemoryBackend) GenerateHeatWaveEstimate ¶
func (b *InMemoryBackend) GenerateHeatWaveEstimate(id, token string) (Doc, string, error)
GenerateHeatWaveEstimate starts a memory estimate for the user tables of a DB system.
func (*InMemoryBackend) GetBackup ¶
func (b *InMemoryBackend) GetBackup(id string) (Doc, string, error)
GetBackup returns one backup.
func (*InMemoryBackend) GetBlueGreen ¶
func (b *InMemoryBackend) GetBlueGreen(id string) (Doc, string, error)
GetBlueGreen returns one blue/green deployment.
func (*InMemoryBackend) GetChannel ¶
func (b *InMemoryBackend) GetChannel(id string) (Doc, string, error)
GetChannel returns one channel.
func (*InMemoryBackend) GetChannelStatus ¶
func (b *InMemoryBackend) GetChannelStatus(id string) (Doc, error)
GetChannelStatus returns the status most recently collected.
func (*InMemoryBackend) GetConfiguration ¶
func (b *InMemoryBackend) GetConfiguration(id string) (Doc, string, error)
GetConfiguration returns a default or custom configuration.
func (*InMemoryBackend) GetDBSystem ¶
func (b *InMemoryBackend) GetDBSystem(id string) (Doc, string, error)
GetDBSystem returns one DB system.
func (*InMemoryBackend) GetDBSystemStatus ¶
func (b *InMemoryBackend) GetDBSystemStatus(id string) (Doc, error)
GetDBSystemStatus returns the status most recently collected.
func (*InMemoryBackend) GetHeatWaveCluster ¶
func (b *InMemoryBackend) GetHeatWaveCluster(id string) (Doc, string, error)
GetHeatWaveCluster returns the HeatWave cluster of a DB system and its etag.
func (*InMemoryBackend) GetHeatWaveEstimate ¶
func (b *InMemoryBackend) GetHeatWaveEstimate(id string) (Doc, error)
GetHeatWaveEstimate returns the most recent memory estimate.
func (*InMemoryBackend) GetReplica ¶
func (b *InMemoryBackend) GetReplica(id string) (Doc, string, error)
GetReplica returns one read replica.
func (*InMemoryBackend) GetWorkRequest ¶
func (b *InMemoryBackend) GetWorkRequest(id string) (WorkRequestWire, error)
GetWorkRequest returns one work request.
func (*InMemoryBackend) ListBackups ¶
func (b *InMemoryBackend) ListBackups(in BackupListIn) (page.Page[Doc], error)
ListBackups lists the backups of a compartment.
func (*InMemoryBackend) ListBlueGreens ¶
func (b *InMemoryBackend) ListBlueGreens(in BlueGreenListIn) (page.Page[Doc], error)
ListBlueGreens lists the blue/green deployments of a compartment.
func (*InMemoryBackend) ListChannels ¶
func (b *InMemoryBackend) ListChannels(in ChannelListIn) (page.Page[Doc], error)
ListChannels lists the channels of a compartment.
func (*InMemoryBackend) ListConfigurations ¶
func (b *InMemoryBackend) ListConfigurations(in ConfigListIn) (page.Page[Doc], error)
ListConfigurations lists the default configurations and the custom ones of a compartment.
func (*InMemoryBackend) ListDBSystems ¶
func (b *InMemoryBackend) ListDBSystems(in DBSystemListIn) (page.Page[Doc], error)
ListDBSystems lists the DB systems of a compartment.
func (*InMemoryBackend) ListMaintenanceEvents ¶
func (b *InMemoryBackend) ListMaintenanceEvents(in MaintenanceListIn) (page.Page[Doc], error)
ListMaintenanceEvents lists the maintenance events of a DB system.
func (*InMemoryBackend) ListReplicas ¶
func (b *InMemoryBackend) ListReplicas(in ReplicaListIn) (page.Page[Doc], error)
ListReplicas lists the read replicas of a compartment.
func (*InMemoryBackend) ListShapes ¶
func (b *InMemoryBackend) ListShapes(compartment string, supportedFor []string, name string) ([]Doc, error)
ListShapes lists the documented MySQL shapes.
func (*InMemoryBackend) ListVersions ¶
func (b *InMemoryBackend) ListVersions(compartment string) ([]Doc, error)
ListVersions lists the available MySQL versions by family.
func (*InMemoryBackend) ListWorkRequests ¶
func (b *InMemoryBackend) ListWorkRequests(compartment string, o ListOpts) (page.Page[WorkRequestWire], error)
ListWorkRequests lists the work requests of a compartment.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all state and tears down engine servers.
func (*InMemoryBackend) ResetChannel ¶
func (b *InMemoryBackend) ResetChannel(id, ifMatch, token string) (string, error)
ResetChannel resets a channel's replication state.
func (*InMemoryBackend) RestartDBSystem ¶
func (b *InMemoryBackend) RestartDBSystem(id, ifMatch, token, shutdown string) (string, error)
RestartDBSystem restarts an ACTIVE DB system.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a snapshot and relaunches engine servers.
func (*InMemoryBackend) ResumeChannel ¶
func (b *InMemoryBackend) ResumeChannel(id, ifMatch, token string) (string, error)
ResumeChannel enables a channel.
func (*InMemoryBackend) SetClock ¶
func (b *InMemoryBackend) SetClock(now func() time.Time)
SetClock injects the time source used for lifecycle transitions, backup windows and retention.
func (*InMemoryBackend) SetCompartmentChecker ¶
func (b *InMemoryBackend) SetCompartmentChecker(fn func(string) bool)
SetCompartmentChecker validates compartmentId arguments against another service (OCI Identity).
func (*InMemoryBackend) SetLauncher ¶
func (b *InMemoryBackend) SetLauncher(l Launcher, image string)
SetLauncher switches the backend to engine mode with a custom Launcher; image overrides the per-version image.
func (*InMemoryBackend) SetNetwork ¶
func (b *InMemoryBackend) SetNetwork(n Network)
SetNetwork wires subnet validation and endpoint address allocation against OCI Core; nil disconnects.
func (*InMemoryBackend) SetTransition ¶
func (b *InMemoryBackend) SetTransition(d time.Duration)
SetTransition sets how long CREATING, UPDATING and DELETING states last without the docker engine.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state, including registered API keys.
func (*InMemoryBackend) StartDBSystem ¶
func (b *InMemoryBackend) StartDBSystem(id, ifMatch, token string) (string, error)
StartDBSystem starts an INACTIVE DB system.
func (*InMemoryBackend) StopDBSystem ¶
func (b *InMemoryBackend) StopDBSystem(id, ifMatch, token, shutdown string) (string, error)
StopDBSystem stops an ACTIVE DB system; data is kept.
func (*InMemoryBackend) Sweep ¶
func (b *InMemoryBackend) Sweep()
Sweep applies due lifecycle transitions, automatic backups and backup retention against the backend clock.
func (*InMemoryBackend) SwitchoverBlueGreen ¶
func (b *InMemoryBackend) SwitchoverBlueGreen( id, ifMatch, token string, waitSeconds *int, ) (Doc, string, string, error)
SwitchoverBlueGreen waits for the green DB system to apply the blue GTID set and then swaps their endpoints.
func (*InMemoryBackend) UpdateBackup ¶
func (b *InMemoryBackend) UpdateBackup(id, ifMatch string, in UpdateBackupIn) (Doc, string, error)
UpdateBackup updates a backup in place.
func (*InMemoryBackend) UpdateBlueGreen ¶
func (b *InMemoryBackend) UpdateBlueGreen(id, ifMatch string, in UpdateBlueGreenIn) (string, error)
UpdateBlueGreen changes the name and tags of a deployment.
func (*InMemoryBackend) UpdateChannel ¶
func (b *InMemoryBackend) UpdateChannel(id, ifMatch, token string, in UpdateChannelIn) (string, error)
UpdateChannel updates a channel and returns its work request.
func (*InMemoryBackend) UpdateConfiguration ¶
func (b *InMemoryBackend) UpdateConfiguration(id, ifMatch string, in UpdateConfigurationIn) (Doc, string, error)
UpdateConfiguration updates a custom configuration.
func (*InMemoryBackend) UpdateDBSystem ¶
func (b *InMemoryBackend) UpdateDBSystem(id, ifMatch string, in UpdateDBSystemIn) (string, error)
UpdateDBSystem updates a DB system and returns its work request.
func (*InMemoryBackend) UpdateHeatWaveCluster ¶
func (b *InMemoryBackend) UpdateHeatWaveCluster(id, ifMatch string, in UpdateHeatWaveClusterIn) (string, error)
UpdateHeatWaveCluster changes the shape, size or Lakehouse flag; shape and size rebuild the cluster.
func (*InMemoryBackend) UpdateReplica ¶
func (b *InMemoryBackend) UpdateReplica(id, ifMatch string, in UpdateReplicaIn) (string, error)
UpdateReplica updates a read replica and returns its work request.
func (*InMemoryBackend) ValidateBackup ¶
func (b *InMemoryBackend) ValidateBackup(id, ifMatch, token string, in ValidateBackupIn) (Doc, string, string, error)
ValidateBackup restores a backup onto a throwaway server to check that it can be restored.
func (*InMemoryBackend) WorkRequestErrors ¶
WorkRequestErrors returns the errors of a work request.
func (*InMemoryBackend) WorkRequestLogs ¶
WorkRequestLogs returns the log entries of a work request.
type Instance ¶
type Instance interface {
Endpoint() (string, int)
EnsureAdmin(ctx context.Context, user, password string) error
DropUser(ctx context.Context, user string) error
Stop(ctx context.Context) error
Start(ctx context.Context) error
Dump(ctx context.Context) ([]byte, error)
Restore(ctx context.Context, data []byte) error
// Close removes the server; purge also deletes its data volume.
Close(ctx context.Context, purge bool)
}
Instance is one running MySQL server of a DB system.
type LaunchSpec ¶
type LaunchSpec struct {
ID string
Image string
RootSecret string
Network string
NetworkID string
ServerID uint32
Fresh bool
PublishX bool
}
LaunchSpec describes the server of one DB system. Fresh discards any earlier data volume.
type Launcher ¶
type Launcher interface {
Launch(ctx context.Context, spec LaunchSpec) (Instance, error)
RemoveVolume(ctx context.Context, id string)
}
Launcher starts servers.
type MaintenanceEvent ¶
type MaintenanceEvent struct {
TimeCreated time.Time `json:"timeCreated"`
TimeStarted *time.Time `json:"timeStarted,omitempty"`
TimeEnded *time.Time `json:"timeEnded,omitempty"`
ID string `json:"id"`
DBSystemID string `json:"dbSystemId"`
CompartmentID string `json:"compartmentId"`
VersionBefore string `json:"mysqlVersionBeforeMaintenance"`
VersionAfter string `json:"mysqlVersionAfterMaintenance"`
Type string `json:"maintenanceType"`
Action string `json:"maintenanceAction"`
Status string `json:"maintenanceStatus"`
Scope string `json:"maintenanceScope,omitempty"`
Notes string `json:"maintenanceNotes,omitempty"`
Seq int64 `json:"seq"`
}
MaintenanceEvent records an upgrade or shape change the service performed on a DB system.
type MaintenanceListIn ¶
MaintenanceListIn are the ListMaintenanceEvents filters.
type Network ¶
type Network interface {
Subnet(id string) (SubnetInfo, bool)
}
Network is the narrow view of OCI Core the service needs.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for OCI MySQL. It runs on its own listener (see Handler.StartWorker) and never matches on the shared AWS router.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init creates the backend and handler; the port is bound in StartWorker.
type Querier ¶
Querier is implemented by servers that answer SQL queries; the first row holds the column names.
type Recoverer ¶
type Recoverer interface {
UserDatabases(ctx context.Context) ([]string, error)
EnablePITR(ctx context.Context, dbs []string) (time.Time, error)
DisablePITR(ctx context.Context) error
PrepareRecovery(ctx context.Context, at time.Time) (mysqlengine.Recovery, error)
ApplyRecovery(ctx context.Context, rec mysqlengine.Recovery) error
}
Recoverer is implemented by servers that keep a binary log base for point-in-time recovery.
type Replica ¶
type Replica struct {
TimeCreated time.Time `json:"timeCreated"`
TimeUpdated time.Time `json:"timeUpdated"`
Tags Tags `json:"tags"`
TransitionAt *time.Time `json:"transitionAt,omitempty"`
State string `json:"state"`
Etag string `json:"etag"`
DBSystemID string `json:"dbSystemId"`
CompartmentID string `json:"compartmentId"`
Name string `json:"displayName"`
Description string `json:"description,omitempty"`
AppliedConfig string `json:"appliedConfig,omitempty"`
After string `json:"after,omitempty"`
Details string `json:"details,omitempty"`
ID string `json:"id"`
IP string `json:"ipAddress"`
RootSecret string `json:"rootSecret,omitempty"`
EngineHost string `json:"engineHost,omitempty"`
Overrides ReplicaOverrides `json:"overrides"`
Seq int64 `json:"seq"`
EnginePort int `json:"enginePort,omitempty"`
ServerID uint32 `json:"serverID,omitempty"`
DeleteProtected bool `json:"isDeleteProtected"`
}
Replica is a read replica of a DB system.
type ReplicaListIn ¶
type ReplicaListIn struct {
UpToDate *bool
Compartment string
ID string
DBSystemID string
Name string
State string
ConfigurationID string
ListOpts
}
ReplicaListIn are the ListReplicas filters.
type ReplicaOverrides ¶
type ReplicaOverrides struct {
SecurityAttributes map[string]map[string]any `json:"securityAttributes,omitempty"`
Telemetry jsontext.Value `json:"telemetryConfiguration,omitempty"`
MysqlVersion string `json:"mysqlVersion,omitempty"`
ShapeName string `json:"shapeName,omitempty"`
ConfigurationID string `json:"configurationId,omitempty"`
NsgIDs []string `json:"nsgIds,omitempty"`
}
ReplicaOverrides are the properties a read replica sets itself instead of inheriting them.
type ReplicaOverridesIn ¶
type ReplicaOverridesIn struct {
SecurityAttributes map[string]map[string]any `json:"securityAttributes"`
Telemetry jsontext.Value `json:"telemetryConfiguration"`
MysqlVersion *string `json:"mysqlVersion"`
ShapeName *string `json:"shapeName"`
ConfigurationID *string `json:"configurationId"`
NsgIDs []string `json:"nsgIds"`
}
ReplicaOverridesIn is the replicaOverrides request object.
type Replicable ¶
type Replicable interface {
UserDatabases(ctx context.Context) ([]string, error)
ReplicationSource(ctx context.Context) (mysqlengine.ReplSource, error)
ReplicaSeed(ctx context.Context, dbs []string) ([]byte, error)
AttachReplica(ctx context.Context, src mysqlengine.ReplSource, seed []byte) error
}
Replicable is implemented by servers that can feed or follow a read replica.
type SchemaEstimate ¶
type SchemaEstimate struct {
Name string `json:"name"`
Tables []TableEstimate `json:"tables"`
}
SchemaEstimate groups the table estimates of a schema.
type Seeder ¶
Seeder is implemented by servers that can reset their binary log state and load a ReplicaSeed dump.
type Settings ¶
type Settings struct {
Engine string `` //nolint:lll // config struct tags are intentionally verbose
/* 223-byte string literal not displayed */
Port int `` //nolint:lll // config struct tags are intentionally verbose
/* 226-byte string literal not displayed */
MaxManualBackups int `` //nolint:lll // config struct tags are intentionally verbose
/* 165-byte string literal not displayed */
MaxStorageGB int `` //nolint:lll // config struct tags are intentionally verbose
/* 170-byte string literal not displayed */
MaxShapeInstances int `` //nolint:lll // config struct tags are intentionally verbose
/* 205-byte string literal not displayed */
MaxParallelCopies int `` //nolint:lll // config struct tags are intentionally verbose
/* 174-byte string literal not displayed */
EnforceAuth bool `` //nolint:lll // config struct tags are intentionally verbose
/* 243-byte string literal not displayed */
}
Settings holds service-level configuration, embedded in the root CLI as CLI.OCIMySQL.
func DefaultSettings ¶
func DefaultSettings() Settings
DefaultSettings returns the settings used when no ConfigProvider is available.
type Source ¶
type Source struct {
RecoveryPoint *time.Time `json:"recoveryPoint,omitempty"`
SourceType string `json:"sourceType"`
BackupID string `json:"backupId,omitempty"`
DBSystemID string `json:"dbSystemId,omitempty"`
}
Source says where a DB system's data came from.
type SourceIn ¶
type SourceIn struct {
RecoveryPoint *time.Time `json:"recoveryPoint"`
SourceType string `json:"sourceType"`
BackupID string `json:"backupId"`
DBSystemID string `json:"dbSystemId"`
}
SourceIn is the create source details.
type StatusRec ¶
type StatusRec struct {
TimeCreated time.Time `json:"timeCreated"`
TimeUpdated time.Time `json:"timeUpdated"`
Result map[string]any `json:"result,omitempty"`
}
StatusRec is the last status collected for a DB system or channel.
type SubnetInfo ¶
SubnetInfo is the slice of an OCI Core subnet the service validates references against.
type TableEstimate ¶
type TableEstimate struct {
Name string `json:"name"`
ErrorComment string `json:"errorComment,omitempty"`
Columns int `json:"columns"`
VarlenCols int `json:"varlenColumns"`
Rows int64 `json:"rows"`
FootprintMB int64 `json:"footprintMB"`
}
TableEstimate is the estimate for one user table.
type Tags ¶
type Tags struct {
FreeformTags map[string]string `json:"freeformTags,omitempty"`
DefinedTags map[string]map[string]any `json:"definedTags,omitempty"`
}
Tags are the shared freeform and defined tag sets of a resource.
type UpdateBackupIn ¶
type UpdateBackupIn struct {
Tags
Name *string `json:"displayName"`
Description *string `json:"description"`
Retention *int `json:"retentionInDays"`
SoftDelete string `json:"softDelete"`
}
UpdateBackupIn is the UpdateBackup body.
type UpdateBlueGreenIn ¶
UpdateBlueGreenIn is the UpdateBlueGreenDeployment body.
type UpdateChannelIn ¶
type UpdateChannelIn struct {
Tags
IsEnabled *bool `json:"isEnabled"`
DisplayName *string `json:"displayName"`
Description *string `json:"description"`
Source ChannelSourceIn `json:"source"`
Target ChannelTargetIn `json:"target"`
}
UpdateChannelIn is the UpdateChannel body.
type UpdateConfigurationIn ¶
type UpdateConfigurationIn struct {
DisplayName *string `json:"displayName"`
Description *string `json:"description"`
Tags
}
UpdateConfigurationIn is the UpdateConfiguration body.
type UpdateDBSystemIn ¶
type UpdateDBSystemIn struct {
Tags
DataStorageGBs *int `json:"dataStorageSizeInGBs"`
HostnameLabel *string `json:"hostnameLabel"`
SubnetID *string `json:"subnetId"`
ShapeName *string `json:"shapeName"`
MysqlVersion *string `json:"mysqlVersion"`
ConfigID *string `json:"configurationId"`
AdminUsername *string `json:"adminUsername"`
Port *int `json:"port"`
Extra map[string]jsontext.Value `json:"-"`
IPAddress *string `json:"ipAddress"`
Description *string `json:"description"`
HA *bool `json:"isHighlyAvailable"`
AdminPassword *string `json:"adminPassword"`
PortX *int `json:"portX"`
DataStorage *DataStorageIn `json:"dataStorage"`
BackupPolicy *BackupPolicyIn `json:"backupPolicy"`
Deletion *DeletionPolicyIn `json:"deletionPolicy"`
Maintenance map[string]any `json:"maintenance"`
DisplayName *string `json:"displayName"`
DBManagement string `json:"databaseManagement"`
DatabaseMode string `json:"databaseMode"`
AccessMode string `json:"accessMode"`
CrashRecovery string `json:"crashRecovery"`
// contains filtered or unexported fields
}
UpdateDBSystemIn is the UpdateDBSystem body.
type UpdateHeatWaveClusterIn ¶
type UpdateHeatWaveClusterIn struct {
ClusterSize *int `json:"clusterSize"`
Lakehouse *bool `json:"isLakehouseEnabled"`
ShapeName *string `json:"shapeName"`
}
UpdateHeatWaveClusterIn is the UpdateHeatWaveCluster body.
type UpdateReplicaIn ¶
type UpdateReplicaIn struct {
Tags
IsDeleteProtected *bool `json:"isDeleteProtected"`
ReplicaOverrides *ReplicaOverridesIn `json:"replicaOverrides"`
DisplayName *string `json:"displayName"`
Description *string `json:"description"`
}
UpdateReplicaIn is the UpdateReplica body.
type ValidateBackupIn ¶
type ValidateBackupIn struct {
IsPreparedBackupRequired *bool `json:"isPreparedBackupRequired"`
}
ValidateBackupIn is the ValidateBackup body.
type WorkRequest ¶
type WorkRequest struct {
Accepted time.Time `json:"accepted"`
FinishAt *time.Time `json:"finishAt,omitempty"`
ID string `json:"id"`
Operation string `json:"operation"`
CompartmentID string `json:"compartmentId"`
EntityType string `json:"entityType"`
EntityID string `json:"entityId"`
EntityURI string `json:"entityUri"`
Action string `json:"action"`
Failure string `json:"failure,omitempty"`
Seq int64 `json:"seq"`
Canceled bool `json:"canceled,omitempty"`
}
WorkRequest records an asynchronous operation.
type WorkRequestWire ¶
type WorkRequestWire struct {
TimeAccepted time.Time `json:"timeAccepted"`
TimeStarted *time.Time `json:"timeStarted,omitempty"`
TimeFinished *time.Time `json:"timeFinished,omitempty"`
OperationType string `json:"operationType"`
Status string `json:"status"`
ID string `json:"id"`
CompartmentID string `json:"compartmentId"`
Resources []wrResourceWire `json:"resources"`
PercentComplete float32 `json:"percentComplete"`
}
WorkRequestWire is the WorkRequest and WorkRequestSummary body.
type XEndpointer ¶
XEndpointer is implemented by servers that publish the X protocol port.
Source Files
¶
- backup_ops.go
- backups.go
- bluegreen.go
- bluegreen_engine.go
- catalog.go
- channels.go
- channels_engine.go
- configapply.go
- configurations.go
- configvars.go
- dbsettings.go
- dbsystems.go
- engine.go
- errors.go
- handler.go
- heatwave.go
- inproc.go
- lifecycle.go
- limits.go
- maintenance.go
- models.go
- ops.go
- persistence.go
- pitr.go
- provider.go
- readendpoint.go
- recorded.go
- replicas.go
- replicas_engine.go
- route.go
- settings.go
- statuses.go
- store.go
- workreq.go