configagent

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package configagent implements Config Agent gRPC interface.

Index

Constants

This section is empty.

Variables

View Source
var AccessSecretVersionFunc = func(ctx context.Context, name string) (string, error) {

	client, closeConn, err := newGsmClient(ctx)
	if err != nil {
		return "", fmt.Errorf("configagent/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("configagent/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").

Functions

This section is empty.

Types

type ConfigServer

type ConfigServer struct {
	*pb.UnimplementedConfigAgentServer
	DBService string
	DBPort    int
}

ConfigServer represents a ConfigAgentServer

func (*ConfigServer) BootstrapDatabase

func (s *ConfigServer) BootstrapDatabase(ctx context.Context, req *pb.BootstrapDatabaseRequest) (*lropb.Operation, error)

BootstrapDatabase bootstrap a CDB after creation or restore.

func (*ConfigServer) BootstrapStandby

BootstrapStandby performs bootstrap steps for standby instance.

func (*ConfigServer) BounceDatabase

BounceDatabase shutdown/startup the database as requested.

func (*ConfigServer) CheckStatus

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.

func (*ConfigServer) CreateCDB

func (s *ConfigServer) CreateCDB(ctx context.Context, req *pb.CreateCDBRequest) (*lropb.Operation, error)

CreateCDB creates a CDB using dbca.

func (*ConfigServer) CreateCDBUser

CreateCDBUser creates CDB user as requested.

func (*ConfigServer) CreateDatabase

CreateDatabase creates PDB as requested.

func (*ConfigServer) CreateListener

CreateListener invokes dbdaemon.CreateListener.

func (*ConfigServer) CreateUsers

CreateUsers creates users as requested.

func (*ConfigServer) DataPumpExport

func (s *ConfigServer) DataPumpExport(ctx context.Context, req *pb.DataPumpExportRequest) (*lropb.Operation, error)

DataPumpExport exports data pump file to GCS path provided.

func (*ConfigServer) DataPumpImport

func (s *ConfigServer) DataPumpImport(ctx context.Context, req *pb.DataPumpImportRequest) (*lropb.Operation, error)

DataPumpImport imports data dump file provided in GCS path.

func (*ConfigServer) DeleteOperation

func (s *ConfigServer) DeleteOperation(ctx context.Context, req *lropb.DeleteOperationRequest) (*empty.Empty, error)

DeleteOperation deletes lro given by name.

func (*ConfigServer) FetchServiceImageMetaData

FetchServiceImageMetaData fetches the image metadata from the service image.

func (*ConfigServer) GetOperation

func (s *ConfigServer) GetOperation(ctx context.Context, req *lropb.GetOperationRequest) (*lropb.Operation, error)

GetOperation fetches corresponding lro given operation name.

func (*ConfigServer) GetParameterTypeValue

GetParameterTypeValue returns parameters' type and value by querying DB.

func (*ConfigServer) ListOperations

ListOperations lists all lro.

func (*ConfigServer) PhysicalBackup

func (s *ConfigServer) PhysicalBackup(ctx context.Context, req *pb.PhysicalBackupRequest) (*lropb.Operation, error)

PhysicalBackup starts an RMAN backup and stores it in the GCS bucket provided.

func (*ConfigServer) PhysicalRestore

func (s *ConfigServer) PhysicalRestore(ctx context.Context, req *pb.PhysicalRestoreRequest) (*lropb.Operation, error)

PhysicalRestore restores an RMAN backup (downloaded from GCS).

func (*ConfigServer) RecoverConfigFile

RecoverConfigFile generates the binary spfile from the human readable backup pfile.

func (*ConfigServer) SetParameter

SetParameter sets database parameter as requested.

func (*ConfigServer) UpdateUsers

UpdateUsers update/create users as requested.

func (*ConfigServer) UsersChanged

UsersChanged determines whether there is change on users (update/delete/create).

func (*ConfigServer) VerifyPhysicalBackup

VerifyPhysicalBackup verifies the existence of physical backup.

Jump to

Keyboard shortcuts

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