Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyDataPatch(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (*lropb.Operation, error)
- func BootstrapDatabase(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (*lropb.Operation, error)
- func BounceDatabase(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) error
- func CreateCDB(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (*lropb.Operation, error)
- func CreateDatabase(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (string, error)
- func CreateListener(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) error
- func CreateStandby(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (*lropb.Operation, error)
- func CreateUsers(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (string, error)
- func DataPumpExport(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (*lropb.Operation, error)
- func DataPumpImport(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (*lropb.Operation, error)
- func DeleteDatabase(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) error
- func DeleteLROOperation(ctx context.Context, dbClientFactory DatabaseClientFactory, r client.Reader, ...) error
- func DiskSpecs(inst *v1alpha1.Instance, config *v1alpha1.Config) []commonv1alpha1.DiskSpec
- func GetBackupGcsPath(backup *v1alpha1.Backup) string
- func GetDBDomain(inst *v1alpha1.Instance) string
- func GetLROOperation(ctx context.Context, dbClientFactory DatabaseClientFactory, r client.Reader, ...) (*lropb.Operation, error)
- func GetLogLevelArgs(config *v1alpha1.Config) map[string][]string
- func GetPVCNameAndMount(instName, diskName string) (string, string)
- func IsAlreadyExistsError(err error) bool
- func IsLROOperationDone(ctx context.Context, dbClientFactory DatabaseClientFactory, r client.Reader, ...) (bool, error)
- func IsNotFoundError(err error) bool
- func MonitoringPodTemplate(inst *v1alpha1.Instance, monitoringSecret *corev1.Secret, ...) corev1.PodTemplateSpec
- func NewAgentSvc(inst *v1alpha1.Instance, scheme *runtime.Scheme) (*corev1.Service, error)
- func NewConfigMap(inst *v1alpha1.Instance, scheme *runtime.Scheme, cmName string) (*corev1.ConfigMap, error)
- func NewDBDaemonSvc(inst *v1alpha1.Instance, scheme *runtime.Scheme) (*corev1.Service, error)
- func NewPVCs(sp StsParams) ([]corev1.PersistentVolumeClaim, error)
- func NewPodTemplate(sp StsParams, cdbName, DBDomain string) corev1.PodTemplateSpec
- func NewSnapshotInst(inst *v1alpha1.Instance, scheme *runtime.Scheme, ...) (*snapv1.VolumeSnapshot, error)
- func NewSts(sp StsParams, pvcs []corev1.PersistentVolumeClaim, ...) (*appsv1.StatefulSet, error)
- func PhysicalBackup(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (*lropb.Operation, error)
- func PhysicalBackupDelete(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) error
- func PhysicalRestore(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) (*lropb.Operation, error)
- func PromoteStandby(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) error
- func RecoverConfigFile(ctx context.Context, dbClientFactory DatabaseClientFactory, r client.Reader, ...) error
- func RequestedMemoryInMi() (int, error)
- func SetParameter(ctx context.Context, dbClientFactory DatabaseClientFactory, r client.Reader, ...) (bool, error)
- func SetUpDataGuard(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) error
- func UpdateUsers(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, ...) error
- type ApplyDataPatchRequest
- type BootstrapDatabaseRequest
- type BootstrapDatabaseRequestBootstrapMode
- type BootstrapStandbyRequest
- type BootstrapStandbyResponsePDB
- type BootstrapStandbyResponseUser
- type BounceDatabaseRequest
- type CheckStatusRequest
- type CheckStatusRequest_Type
- type CheckStatusResponse
- type ConnCloseFunc
- type CreateCDBRequest
- type CreateDatabaseRequest
- type CreateDatabaseResponse
- type CreateListenerRequest
- type CreateStandbyRequest
- type CreateUsersRequest
- type Credential
- type CredentialGsmSecretReference
- type DataGuardStatusRequest
- type DataGuardStatusResponse
- type DataPumpExportRequest
- type DataPumpImportRequest
- type DatabaseClientFactory
- type DeleteDatabaseRequest
- type ExecCmdParams
- type FetchDatabaseIncarnationResponse
- type GRPCDatabaseClientFactory
- type GetParameterTypeValueRequest
- type GetParameterTypeValueResponse
- type GsmSecretReference
- type LROInput
- type PhysicalBackupDeleteRequest
- type PhysicalBackupMetadataRequest
- type PhysicalBackupMetadataResponse
- type PhysicalBackupRequest
- type PhysicalBackupRequest_Type
- type PhysicalRestoreRequest
- type PromoteStandbyRequest
- type SetUpDataGuardRequest
- type StsParams
- type UpdateUsersRequest
- type User
- type UsersChangedRequest
- type UsersChangedResponse
- type UsersChangedResponseSuppressed
- type UsersChangedResponseType
- type VerifyPhysicalBackupRequest
- type VerifyPhysicalBackupResponse
- type VerifyStandbySettingsRequest
- type VerifyStandbySettingsResponse
Constants ¶
const ( FinalizerName = "oracle.db.anthosapis.com" PhysBackupTimeLimitDefault = 60 * time.Minute StatusReady = "Ready" StatusInProgress = "InProgress" RestoreInProgress = "Restore" + StatusInProgress CreateInProgress = "Create" + StatusInProgress PITRLabel = "pitr" IncarnationLabel = "incarnation" ParentIncarnationLabel = "parent-incarnation" SCNAnnotation = "scn" TimestampAnnotation = "timestamp" DatabaseImageAnnotation = "database-image" ParameterUpdateStateMachine = "ParameterUpdateStateMachine" DatabaseContainerName = "oracledb" )
const ( // OperatorName is the default operator name. OperatorName = "operator" // DefaultUID is the default Database pod user uid. DefaultUID = int64(54321) // DefaultGID is the default Database pod user gid. DefaultGID = int64(54322) StoppedReplicaCnt = 0 DefaultReplicaCnt = 1 )
Variables ¶
var ( // SvcName is a string template for service names. SvcName = "%s-svc" // AgentSvcName is a string template for agent service names. AgentSvcName = "%s-agent-svc" // DbdaemonSvcName is a string template for dbdaemon service names. DbdaemonSvcName = "%s-dbdaemon-svc" // SvcEndpoint is a string template for service endpoints. SvcEndpoint = "%s.%s" // SvcName.namespaceName // StsName is a string template for Database stateful set names. StsName = "%s-sts" // AgentDeploymentName is a string template for agent deployment names. AgentDeploymentName = "%s-agent-deployment" // PvcMountName is a string template for pvc names. PvcMountName = "%s-pvc-%s" // inst.name-pvc-mount, e.g. mydb-pvc-u02 // CmName is a string template for config map names. CmName = "%s-cm" // DatabaseTaskType is the value of the 'task-type' label assigned to db pod. DatabaseTaskType = "oracle-db" // MonitorTaskType is the value of the 'task-type' label assigned to the monitoring deployment. MonitorTaskType = "monitor" // DefaultDiskSpecs is the default DiskSpec settings. DefaultDiskSpecs = map[string]commonv1alpha1.DiskSpec{ "DataDisk": { Name: "DataDisk", Size: resource.MustParse("100Gi"), }, "LogDisk": { Name: "LogDisk", Size: resource.MustParse("150Gi"), }, "BackupDisk": { Name: "BackupDisk", Size: resource.MustParse("100Gi"), }, } )
var AccessSecretVersionFunc = func(ctx context.Context, name string) (string, error) { client, closeConn, err := newGsmClient(ctx) if err != nil { return "", fmt.Errorf("config_agent_helpers/AccessSecretVersionFunc: failed to create secretmanager client: %v", err) } defer closeConn() req := &secretmanagerpb.AccessSecretVersionRequest{ Name: name, } result, err := client.AccessSecretVersion(ctx, req) if err != nil { return "", fmt.Errorf("config_agent_helpers/AccessSecretVersionFunc: failed to access secret version: %v", err) } return string(result.Payload.Data[:]), nil }
AccessSecretVersionFunc accesses the payload for the given secret version if one exists. The version can be a version number as a string (e.g. "5") or an alias (e.g. "latest").
var AllowedImpdpParams = map[string]bool{ "TABLE_EXISTS_ACTION": true, "REMAP_TABLE": true, "REMAP_SCHEMA": true, "REMAP_TABLESPACE": true, "REMAP_DATAFILE": true, "PARALLEL": true, "NETWORK_LINK": true, }
var CheckStatusInstanceFunc = func(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, instName, cdbName, namespace, clusterIP, DBDomain string, log logr.Logger) (string, error) { if clusterIP != "" { log.Info("resources/checkStatusInstance", "inst name", instName, "clusterIP", clusterIP) } else { log.Info("resources/checkStatusInstance", "inst name", instName) } checkStatusReq := &CheckStatusRequest{ Name: instName, CdbName: cdbName, CheckStatusType: CheckStatusRequest_INSTANCE, DbDomain: DBDomain, } cdOut, err := CheckStatus(ctx, r, dbClientFactory, namespace, instName, *checkStatusReq) if err != nil { return "", fmt.Errorf("resource/checkStatusInstance: failed on CheckStatus call: %v", err) } log.Info("resource/CheckStatusInstance: DONE with this output", "out", cdOut) return cdOut.Status, nil }
checkStatusInstance attempts to determine a state of an database instance. In particular:
- has provisioning finished?
- is Instance up and accepting connection requests?
var ExecCmdFunc = func(p ExecCmdParams, cmd string) (string, error) { var cmdOut, cmdErr bytes.Buffer cmdShell := []string{"sh", "-c", cmd} req := p.Client.CoreV1().RESTClient().Post().Resource("pods").Name(p.Pod). Namespace(p.Ns).SubResource("exec") req.VersionedParams(&corev1.PodExecOptions{ Container: p.Con.Name, Command: cmdShell, Stdout: true, Stderr: true, }, scheme.ParameterCodec) exec, err := remotecommand.NewSPDYExecutor(p.RestConfig, "POST", req.URL()) if err != nil { return "", fmt.Errorf("failed to init executor: %v", err) } // exec.Stream might return timout error, use a backoff with 4 retries // 100ms, 500ms, 2.5s, 12.5s var backoff = wait.Backoff{ Steps: 4, Duration: 100 * time.Millisecond, Factor: 5.0, Jitter: 0.1, } if err := retry.OnError(backoff, func(error) bool { return true }, func() error { e := exec.Stream(remotecommand.StreamOptions{ Stdout: &cmdOut, Stderr: &cmdErr, Tty: false, }) if e != nil { log.Error(fmt.Sprintf("exec.Stream failed, retrying, err: %v, stderr: %v, stdout: %v", e, cmdErr.String(), cmdOut.String())) } return e }); err != nil { return "", fmt.Errorf("failed to run a command [%v], err: %v, stderr: %v, stdout: %v", cmd, err, cmdErr.String(), cmdOut.String()) } if cmdErr.Len() > 0 { return "", fmt.Errorf("stderr: %v", cmdErr.String()) } return cmdOut.String(), nil }
ExecCmdFunc invokes pod/exec.
Functions ¶
func ApplyDataPatch ¶
func ApplyDataPatch(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req ApplyDataPatchRequest) (*lropb.Operation, error)
ApplyDataPatch calls dbdaemon->ApplyDataPatch()
func BootstrapDatabase ¶
func BootstrapDatabase(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req BootstrapDatabaseRequest) (*lropb.Operation, error)
BootstrapDatabase bootstrap a CDB after creation or restore.
func BounceDatabase ¶
func BounceDatabase(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req BounceDatabaseRequest) error
BounceDatabase shutdown/startup the database as requested.
func CreateCDB ¶
func CreateCDB(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req CreateCDBRequest) (*lropb.Operation, error)
CreateCDB creates a CDB using dbca.
func CreateDatabase ¶
func CreateDatabase(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req CreateDatabaseRequest) (string, error)
CreateDatabase creates PDB as requested.
func CreateListener ¶
func CreateListener(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req *CreateListenerRequest) error
CreateListener invokes dbdaemon.CreateListener.
func CreateStandby ¶
func CreateStandby(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req CreateStandbyRequest) (*lropb.Operation, error)
CreateStandby creates a standby database.
func CreateUsers ¶
func CreateUsers(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req CreateUsersRequest) (string, error)
CreateUsers creates users as requested.
func DataPumpExport ¶
func DataPumpExport(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req DataPumpExportRequest) (*lropb.Operation, error)
DataPumpExport exports data pump file to GCS path provided.
func DataPumpImport ¶
func DataPumpImport(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req DataPumpImportRequest) (*lropb.Operation, error)
DataPumpImport imports data dump file provided in GCS path.
func DeleteDatabase ¶
func DeleteDatabase(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req DeleteDatabaseRequest) error
DeleteDatabase deletes the specified Database(PDB)
func DeleteLROOperation ¶
func DeleteLROOperation(ctx context.Context, dbClientFactory DatabaseClientFactory, r client.Reader, id, namespace, instName string) error
DeleteLROOperation deletes LRO operation for the specified namespace instance and operation id.
func GetBackupGcsPath ¶
GetBackupGcsPath resolves the actual gcs path based on backup spec.
func GetDBDomain ¶
GetDBDomain figures out DBDomain from DBUniqueName and DBDomain.
func GetLROOperation ¶
func GetLROOperation(ctx context.Context, dbClientFactory DatabaseClientFactory, r client.Reader, id, namespace, instName string) (*lropb.Operation, error)
GetLROOperation returns LRO operation for the specified namespace instance and operation id.
func GetLogLevelArgs ¶
GetLogLevelArgs returns agent args for log level.
func GetPVCNameAndMount ¶
GetPVCNameAndMount returns PVC names and their corresponding mount.
func IsAlreadyExistsError ¶
IsAlreadyExistsError returns true if given error is caused by object already exists.
func IsLROOperationDone ¶
func IsLROOperationDone(ctx context.Context, dbClientFactory DatabaseClientFactory, r client.Reader, id, namespace, instName string) (bool, error)
Check for LRO job status Return (true, nil) if LRO is done without errors. Return (true, err) if LRO is done with an error. Return (false, nil) if LRO still in progress. Return (false, err) if other error occurred.
func IsNotFoundError ¶
IsNotFoundError returns true if given error is caused by object not found.
func MonitoringPodTemplate ¶
func NewAgentSvc ¶
NewAgentSvc returns the service for the agent.
func NewConfigMap ¶
func NewConfigMap(inst *v1alpha1.Instance, scheme *runtime.Scheme, cmName string) (*corev1.ConfigMap, error)
NewConfigMap returns the config map for database env variables.
func NewDBDaemonSvc ¶
NewDBDaemonSvc returns the service for the database daemon server.
func NewPVCs ¶
func NewPVCs(sp StsParams) ([]corev1.PersistentVolumeClaim, error)
NewPVCs returns PVCs.
func NewPodTemplate ¶
func NewPodTemplate(sp StsParams, cdbName, DBDomain string) corev1.PodTemplateSpec
NewPodTemplate returns the pod template for the database statefulset.
func NewSnapshotInst ¶
func NewSnapshotInst(inst *v1alpha1.Instance, scheme *runtime.Scheme, pvcName, snapName, volumeSnapshotClassName string) (*snapv1.VolumeSnapshot, error)
NewSnapshot returns the snapshot for the given instance and pv.
func NewSts ¶
func NewSts(sp StsParams, pvcs []corev1.PersistentVolumeClaim, podTemplate corev1.PodTemplateSpec) (*appsv1.StatefulSet, error)
NewSts returns the statefulset for the database pod.
func PhysicalBackup ¶
func PhysicalBackup(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req PhysicalBackupRequest) (*lropb.Operation, error)
PhysicalBackup starts an RMAN backup and stores it in the GCS bucket provided.
func PhysicalBackupDelete ¶
func PhysicalBackupDelete(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req PhysicalBackupDeleteRequest) error
PhysicalBackupDelete deletes backup data on local or GCS.
func PhysicalRestore ¶
func PhysicalRestore(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req PhysicalRestoreRequest) (*lropb.Operation, error)
PhysicalRestore restores an RMAN backup (downloaded from GCS).
func PromoteStandby ¶
func PromoteStandby(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req PromoteStandbyRequest) error
PromoteStandby promotes standby database to primary.
func RecoverConfigFile ¶
func RequestedMemoryInMi ¶
func SetParameter ¶
func SetParameter(ctx context.Context, dbClientFactory DatabaseClientFactory, r client.Reader, namespace, instName, key, value string) (bool, error)
SetParameter sets database parameter as requested.
func SetUpDataGuard ¶
func SetUpDataGuard(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req SetUpDataGuardRequest) error
SetUpDataGuard updates Data Guard configuration.
func UpdateUsers ¶
func UpdateUsers(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req UpdateUsersRequest) error
UpdateUsers update/create users as requested.
Types ¶
type ApplyDataPatchRequest ¶
type ApplyDataPatchRequest struct {
LroInput *LROInput
}
type BootstrapDatabaseRequestBootstrapMode ¶
type BootstrapDatabaseRequestBootstrapMode int32
const ( BootstrapDatabaseRequest_ProvisionUnseeded BootstrapDatabaseRequestBootstrapMode = 0 BootstrapDatabaseRequest_ProvisionSeeded BootstrapDatabaseRequestBootstrapMode = 1 BootstrapDatabaseRequest_Restore BootstrapDatabaseRequestBootstrapMode = 2 )
type BootstrapStandbyRequest ¶
type BootstrapStandbyResponsePDB ¶
type BootstrapStandbyResponsePDB struct { PdbName string Users []*BootstrapStandbyResponseUser }
func BootstrapStandby ¶
func BootstrapStandby(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req BootstrapStandbyRequest) ([]*BootstrapStandbyResponsePDB, error)
BootstrapStandby performs bootstrap steps for standby instance.
type BounceDatabaseRequest ¶
type CheckStatusRequest ¶
type CheckStatusRequest struct { Name string CdbName string CheckStatusType CheckStatusRequest_Type DbDomain string }
type CheckStatusRequest_Type ¶
type CheckStatusRequest_Type int32
const ( CheckStatusRequest_UNKNOWN_TYPE CheckStatusRequest_Type = 0 CheckStatusRequest_INSTANCE CheckStatusRequest_Type = 1 )
type CheckStatusResponse ¶
func CheckStatus ¶
func CheckStatus(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req CheckStatusRequest) (*CheckStatusResponse, error)
CheckStatus runs a requested set of state checks. The Instance state check consists of:
- checking the provisioning done file.
- running a CDB connection test via DB Daemon.
type ConnCloseFunc ¶
type ConnCloseFunc func()
type CreateCDBRequest ¶
type CreateDatabaseRequest ¶
type CreateDatabaseRequest struct { CdbName string Name string // only being used for plaintext password scenario. // GSM doesn't use this field. Password string DbDomain string AdminPasswordGsmSecretRef *GsmSecretReference // only being used for plaintext password scenario. // GSM doesn't use this field. LastPassword string }
type CreateDatabaseResponse ¶
type CreateListenerRequest ¶
type CreateStandbyRequest ¶
type CreateUsersRequest ¶
type Credential ¶
type Credential struct { // Types that are assignable to Source: // *Credential_GsmSecretReference Source isCredentialSource }
func (*Credential) GetGsmSecretReference ¶
func (x *Credential) GetGsmSecretReference() *GsmSecretReference
type CredentialGsmSecretReference ¶
type CredentialGsmSecretReference struct {
GsmSecretReference *GsmSecretReference
}
type DataGuardStatusRequest ¶
type DataGuardStatusRequest struct {
StandbyDbUniqueName string
}
type DataGuardStatusResponse ¶
type DataGuardStatusResponse struct {
Output []string
}
func DataGuardStatus ¶
func DataGuardStatus(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req DataGuardStatusRequest) (*DataGuardStatusResponse, error)
DataGuardStatus returns Data Guard configuration status and standby DB status.
type DataPumpExportRequest ¶
type DataPumpImportRequest ¶
type DatabaseClientFactory ¶
type DatabaseClientFactory interface { // New returns new Client. // connection close function should be invoked by the caller if // error is nil. New(ctx context.Context, r client.Reader, namespace, instName string) (dbdpb.DatabaseDaemonClient, func() error, error) }
DatabaseClientFactory is a GRPC implementation of DatabaseClientFactory. Exists for test mock.
type DeleteDatabaseRequest ¶
type ExecCmdParams ¶
type ExecCmdParams struct { Pod string Ns string Con *corev1.Container Sch *runtime.Scheme RestConfig *rest.Config Client kubernetes.Interface }
ExecCmdParams stores parameters for invoking pod/exec.
type FetchDatabaseIncarnationResponse ¶
type FetchDatabaseIncarnationResponse struct {
Incarnation string
}
func FetchDatabaseIncarnation ¶
func FetchDatabaseIncarnation(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string) (*FetchDatabaseIncarnationResponse, error)
FetchDatabaseIncarnation fetches the database incarnation number.
type GRPCDatabaseClientFactory ¶
type GRPCDatabaseClientFactory struct {
// contains filtered or unexported fields
}
type GetParameterTypeValueRequest ¶
type GetParameterTypeValueRequest struct {
Keys []string
}
type GetParameterTypeValueResponse ¶
func GetParameterTypeValue ¶
func GetParameterTypeValue(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req GetParameterTypeValueRequest) (*GetParameterTypeValueResponse, error)
GetParameterTypeValue returns parameters' type and value by querying DB.
type GsmSecretReference ¶
type PhysicalBackupMetadataRequest ¶
type PhysicalBackupMetadataRequest struct {
BackupTag string
}
type PhysicalBackupMetadataResponse ¶
type PhysicalBackupMetadataResponse struct { BackupScn string BackupIncarnation string BackupTimestamp *timestamppb.Timestamp }
func PhysicalBackupMetadata ¶
func PhysicalBackupMetadata(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req PhysicalBackupMetadataRequest) (*PhysicalBackupMetadataResponse, error)
PhysicalBackupMetadata fetches backup scn/timestamp/incarnation with provided backup tag.
type PhysicalBackupRequest ¶
type PhysicalBackupRequest struct { BackupSubType PhysicalBackupRequest_Type BackupItems []string Backupset bool Compressed bool CheckLogical bool // DOP = degree of parallelism for physical backup. Dop int32 Level int32 Filesperset int32 SectionSize int32 LocalPath string GcsPath string LroInput *LROInput BackupTag string }
type PhysicalBackupRequest_Type ¶
type PhysicalBackupRequest_Type int32
const ( PhysicalBackupRequest_UNKNOWN_TYPE PhysicalBackupRequest_Type = 0 PhysicalBackupRequest_INSTANCE PhysicalBackupRequest_Type = 1 PhysicalBackupRequest_DATABASE PhysicalBackupRequest_Type = 2 PhysicalBackupRequest_TABLESPACE PhysicalBackupRequest_Type = 3 PhysicalBackupRequest_DATAFILE PhysicalBackupRequest_Type = 4 )
type PhysicalRestoreRequest ¶
type PhysicalRestoreRequest struct { InstanceName string CdbName string // DOP = degree of parallelism for a restore from a physical backup. Dop int32 LocalPath string GcsPath string LroInput *LROInput LogGcsPath string Incarnation string BackupIncarnation string StartTime *timestamppb.Timestamp EndTime *timestamppb.Timestamp StartScn int64 EndScn int64 }
type PromoteStandbyRequest ¶
type SetUpDataGuardRequest ¶
type StsParams ¶
type StsParams struct { Inst *v1alpha1.Instance Scheme *runtime.Scheme Namespace string Images map[string]string SvcName string StsName string PrivEscalation bool ConfigMap *corev1.ConfigMap Restore *v1alpha1.RestoreSpec Disks []commonv1alpha1.DiskSpec Config *v1alpha1.Config Log logr.Logger Services []commonv1alpha1.Service }
StsParams stores parameters for creating a database stateful set.
type UpdateUsersRequest ¶
type User ¶
type User struct { Name string // only being used for plaintext password scenario. // GSM doesn't use this field. Password string Privileges []string PasswordGsmSecretRef *GsmSecretReference // only being used for plaintext password scenario. // GSM doesn't use this field. LastPassword string }
type UsersChangedRequest ¶
type UsersChangedResponse ¶
type UsersChangedResponse struct { Changed bool Suppressed []*UsersChangedResponseSuppressed }
func UsersChanged ¶
func UsersChanged(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req UsersChangedRequest) (*UsersChangedResponse, error)
UsersChanged determines whether there is change on users (update/delete/create).
type UsersChangedResponseSuppressed ¶
type UsersChangedResponseSuppressed struct { SuppressType UsersChangedResponseType UserName string // sql is the suppressed cmd which can update the user to the spec defined // state Sql string }
type UsersChangedResponseType ¶
type UsersChangedResponseType int32
const ( UsersChangedResponse_UNKNOWN_TYPE UsersChangedResponseType = 0 UsersChangedResponse_DELETE UsersChangedResponseType = 1 UsersChangedResponse_CREATE UsersChangedResponseType = 2 )
type VerifyPhysicalBackupRequest ¶
type VerifyPhysicalBackupRequest struct {
GcsPath string
}
type VerifyPhysicalBackupResponse ¶
type VerifyPhysicalBackupResponse struct {
ErrMsgs []string
}
func VerifyPhysicalBackup ¶
func VerifyPhysicalBackup(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req VerifyPhysicalBackupRequest) (*VerifyPhysicalBackupResponse, error)
VerifyPhysicalBackup verifies the existence of physical backup.
type VerifyStandbySettingsResponse ¶
type VerifyStandbySettingsResponse struct {
Errors []*standbyhelpers.StandbySettingErr
}
func VerifyStandbySettings ¶
func VerifyStandbySettings(ctx context.Context, r client.Reader, dbClientFactory DatabaseClientFactory, namespace, instName string, req VerifyStandbySettingsRequest) (*VerifyStandbySettingsResponse, error)
VerifyStandbySettings does preflight checks on standby settings.