vclusterops

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 31 Imported by: 2

Documentation

Overview

vclusterops is a Go library to administer a Vertica cluster with HTTP RESTful interfaces. These interfaces are exposed through the Node Management Agent (NMA) and an HTTPS service embedded in the server. With this library you can perform administrator-level operations, including: creating a database, scaling up/down, restarting the cluster, and stopping the cluster.

Index

Constants

View Source
const (
	ControlSetSizeDefaultValue = -1
	ControlSetSizeLowerBound   = 1
	ControlSetSizeUpperBound   = 120
)
View Source
const (
	ConfigDirPerm            = 0755
	ConfigFilePerm           = 0600
	CurrentConfigFileVersion = 1
)
View Source
const (
	SUCCESS   resultStatus = 0
	FAILURE   resultStatus = 1
	EXCEPTION resultStatus = 2
)
View Source
const (
	GetMethod    = "GET"
	PutMethod    = "PUT"
	PostMethod   = "POST"
	DeleteMethod = "DELETE"
)
View Source
const (
	// track endpoint versions and the current version
	NMAVersion1    = "v1/"
	HTTPVersion1   = "v1/"
	NMACurVersion  = NMAVersion1
	HTTPCurVersion = HTTPVersion1
)
View Source
const (
	SuccessResult   = "SUCCESS"
	FailureResult   = "FAILURE"
	ExceptionResult = "FAILURE"
)
View Source
const (
	SuccessCode        = 200
	MultipleChoiceCode = 300
	UnauthorizedCode   = 401
	InternalErrorCode  = 500
)
View Source
const (
	CreateDB opType = iota
	StopDB
	StartDB
	ReviveDB
)
View Source
const (
	SandboxCmd = iota
	StartNodeCommand
	StopDBCmd
	ScrutinizeCmd
	DBAddSubclusterCmd
	InstallPackageCmd
)
View Source
const (
	NoVersion = "NO_VERSION"
	DefaultSC = "default_subcluster"
)
View Source
const (
	OneSecond                = 1
	OneMinute                = 60 * OneSecond
	StopDBTimeout            = 5 * OneMinute
	StartupPollingTimeout    = 5 * OneMinute
	ScrutinizePollingTimeout = -1 * OneMinute // no timeout
	PollingInterval          = 3 * OneSecond
)
View Source
const ConfigBackupName = "vertica_cluster.yaml.backup"
View Source
const ConfigFileName = "vertica_cluster.yaml"
View Source
const HTTPSSuccMsg = "REBALANCED SHARDS"
View Source
const RebalanceClusterSuccMsg = "REBALANCED"
View Source
const RebalanceShardsSuccMsg = "REBALANCED SHARDS"
View Source
const VScrutinizeTypeName = "scrutinize"

const to sync cmd, options parsing, and this

Variables

This section is empty.

Functions

func RemoveConfigFile added in v1.2.0

func RemoveConfigFile(configDirectory string, logger vlog.Printer) error

Types

type ClusterConfig

type ClusterConfig map[string]DatabaseConfig

ClusterConfig is a map that stores configuration information for each database in the cluster.

func MakeClusterConfig

func MakeClusterConfig() ClusterConfig

func ReadConfig

func ReadConfig(configDirectory string, logger vlog.Printer) (ClusterConfig, error)

ReadConfig reads cluster configuration information from a YAML-formatted file in configDirectory. It returns a ClusterConfig and any error encountered when reading and parsing the file.

func (*ClusterConfig) WriteConfig

func (c *ClusterConfig) WriteConfig(configFilePath string) error

WriteConfig writes configuration information to configFilePath. It returns any write error encountered.

type ClusterLeaseNotExpiredError

type ClusterLeaseNotExpiredError struct {
	Expiration string
}

ClusterLeaseNotExpiredError is returned when you attempt to access a communal storage location when there is an active cluster lease on it.

func (*ClusterLeaseNotExpiredError) Error

type CmdType

type CmdType int
const (
	StartDBCmd CmdType = iota
	StartNodeCmd
	CreateDBCmd
)

func (CmdType) String

func (cmd CmdType) String() string

type CommandType added in v1.2.0

type CommandType int

type Config

type Config struct {
	Version   int           `yaml:"config_file_version"`
	Databases ClusterConfig `yaml:"databases"`
}

type DBIsRunningError added in v1.1.0

type DBIsRunningError struct {
	Detail string
}

DBIsRunningError is an error to indicate we found the database still running. This is emitted from this op. Callers can do type checking to perform an action based on the error.

func (*DBIsRunningError) Error added in v1.1.0

func (e *DBIsRunningError) Error() string

Error returns the message details. This is added so that it is compatible with the error interface.

type DatabaseConfig

type DatabaseConfig struct {
	Nodes                   []*NodeConfig `yaml:"nodes"`
	IsEon                   bool          `yaml:"eon_mode"`
	CommunalStorageLocation string        `yaml:"communal_storage_location"`
	Ipv6                    bool          `yaml:"ipv6"`
}

func MakeDatabaseConfig

func MakeDatabaseConfig() DatabaseConfig

type DatabaseOptions

type DatabaseOptions struct {

	// name of the database
	DBName *string
	// expected to be IP addresses or hostnames
	RawHosts []string
	// expected to be IP addresses resolved from RawHosts
	Hosts []string
	// whether using IPv6 for host addresses
	Ipv6 vstruct.NullableBool
	// path of catalog directory
	CatalogPrefix *string
	// path of data directory
	DataPrefix *string
	// directory of the YAML config file
	ConfigDirectory *string

	// path of depot directory
	DepotPrefix *string
	// whether the database is in Eon mode
	IsEon vstruct.NullableBool
	// path of the communal storage
	CommunalStorageLocation *string
	// database configuration parameters
	ConfigurationParameters map[string]string

	// user name
	UserName *string
	// password
	Password *string
	// TLS Key
	Key string
	// TLS Certificate
	Cert string
	// TLS CA Certificate
	CaCert string

	// path of the log file
	LogPath *string
	// whether honor user's input rather than reading values from the config file
	HonorUserInput *bool

	// pointer to the cluster config object
	Config *ClusterConfig
	// contains filtered or unexported fields
}

func (*DatabaseOptions) GetDBConfig

func (opt *DatabaseOptions) GetDBConfig(vcc VClusterCommands) (config *ClusterConfig, e error)

GetDBConfig reads database configurations from vertica_cluster.yaml into a ClusterConfig struct. It returns the ClusterConfig and any error encountered.

func (*DatabaseOptions) ParseHostList

func (opt *DatabaseOptions) ParseHostList(hosts string) error

ParseHostList converts a comma-separated string of hosts into a slice of host names. During parsing, the hosts names are converted to lowercase. It returns any parsing error encountered.

type InstallPackageStatus added in v1.2.0

type InstallPackageStatus struct {
	Packages []PackageStatus `json:"packages"`
}

InstallPackageStatus provides status for each package install attempted.

type NodeConfig

type NodeConfig struct {
	Name        string `yaml:"name"`
	Address     string `yaml:"address"`
	Subcluster  string `yaml:"subcluster"`
	CatalogPath string `yaml:"catalog_path"`
	DataPath    string `yaml:"data_path"`
	DepotPath   string `yaml:"depot_path"`
}

type NodeInfo

type NodeInfo struct {
	Address     string `json:"address"`
	Name        string `json:"name"` // vnode name, e.g., v_dbname_node0001
	State       string `json:"state"`
	CatalogPath string `json:"catalog_path"`
}

NodeInfo represents information to identify a node.

type PackageStatus added in v1.2.0

type PackageStatus struct {
	// Name of the package this status is for
	PackageName string `json:"package_name"`
	// One word outcome of the install status:
	// Skipped, Success or Failure
	InstallStatus string `json:"install_status"`
}

PackageStatus has install status for a single package.

type ReIPInfo

type ReIPInfo struct {
	NodeName               string `json:"node_name"`
	NodeAddress            string `json:"-"`
	TargetAddress          string `json:"address"`
	TargetControlAddress   string `json:"control_address"`
	TargetControlBroadcast string `json:"control_broadcast"`
}

type ReIPNoClusterQuorumError added in v1.2.0

type ReIPNoClusterQuorumError struct {
	Detail string
}

ReIPNoClusterQuorumError is an error to indicate that cluster quorum was lost before a re-ip. This is emitted from this op. Callers can do type checking to perform an action based on the error.

func (*ReIPNoClusterQuorumError) Error added in v1.2.0

func (e *ReIPNoClusterQuorumError) Error() string

type RestorePoint added in v1.2.0

type RestorePoint struct {
	// Name of the archive that this restore point was created in.
	Archive string `json:"archive,omitempty"`
	// The ID of the restore point. This is a form of a UID that is static for the restore point.
	ID string `json:"id,omitempty"`
	// The current index of this restore point. Lower value means it was taken more recently.
	// This changes when new restore points are created.
	Index int `json:"index,omitempty"`
	// The timestamp when the restore point was created.
	Timestamp string `json:"timestamp,omitempty"`
	// The version of Vertica running when the restore point was created.
	VerticaVersion string `json:"vertica_version,omitempty"`
}

RestorePoint contains information about a single restore point.

type RestorePointPolicy added in v1.1.0

type RestorePointPolicy struct {
	// Name of the restore archive to use for bootstrapping
	Archive *string
	// The (1-based) index of the restore point in the restore archive to restore from
	Index *int
	// The identifier of the restore point in the restore archive to restore from
	ID *string
}

type ReviveDBNodeCountMismatchError

type ReviveDBNodeCountMismatchError struct {
	ReviveDBStep  string
	FailureHost   string
	NumOfNewNodes int
	NumOfOldNodes int
}

ReviveDBNodeCountMismatchError is the error that is returned when the number of nodes in the revived cluster does not match the number of nodes in the original cluster.

func (*ReviveDBNodeCountMismatchError) Error

type ReviveDBRestorePointNotFoundError added in v1.2.0

type ReviveDBRestorePointNotFoundError struct {
	Archive      string
	InvalidID    string
	InvalidIndex int
}

ReviveDBRestorePointNotFoundError is the error that is returned when the retore point specified by the user either via index or id is not found among all restore points in the specified archive. Either InvalidID or InvalidIndex will be set depending on whether the user specified the retore point by index or id.

func (*ReviveDBRestorePointNotFoundError) Error added in v1.2.0

type ShowRestorePointFilterOptions added in v1.2.0

type ShowRestorePointFilterOptions struct {
	// Only list restore points with given archive name
	ArchiveName *string
	// Only list restore points created no earlier than this timestamp (must be UTC timezone)
	StartTimestamp *string
	// Only list restore points created no later than this timestamp (must be UTC timezone)
	EndTimestamp *string
	// Only list restore points with given ID
	ArchiveID *string
	// Only list restore points with given index
	ArchiveIndex *string
}

Optional arguments to list only restore points that meet the specified condition(s)

func (*ShowRestorePointFilterOptions) ValidateAndStandardizeTimestampsIfAny added in v1.2.0

func (p *ShowRestorePointFilterOptions) ValidateAndStandardizeTimestampsIfAny() (err error)

Check that all non-empty timestamps specified have valid date time or date only format, convert date only format to date time format when applicable, and make sure end timestamp is no earlier than start timestamp

type VAddNodeOptions

type VAddNodeOptions struct {
	DatabaseOptions
	// Hosts to add to database
	NewHosts []string
	// Name of the subcluster that the new nodes will be added to
	SCName *string
	// A primary up host that will be used to execute add_node operations
	Initiator string
	// Depot size, e.g. 10G
	DepotSize *string
	// Skip rebalance shards if true
	SkipRebalanceShards *bool
	// Use force remove if true
	ForceRemoval *bool
	// If the path is set, the NMA will store the Vertica start command at the path
	// instead of executing it. This is useful in containerized environments where
	// you may not want to have both the NMA and Vertica server in the same container.
	// This feature requires version 24.2.0+.
	StartUpConf *string
	// Names of the existing nodes in the cluster. This option can be
	// used to remove partially added nodes from catalog.
	ExpectedNodeNames []string
}

VAddNodeOptions represents the available options for VAddNode.

func VAddNodeOptionsFactory

func VAddNodeOptionsFactory() VAddNodeOptions

type VAddSubclusterInfo

type VAddSubclusterInfo struct {
	DBName         string
	Hosts          []string
	UserName       string
	Password       *string
	SCName         string
	SCHosts        []string
	IsPrimary      bool
	ControlSetSize int
	CloneSC        string
}

type VAddSubclusterOptions

type VAddSubclusterOptions struct {
	// part 1: basic db info
	DatabaseOptions
	// part 2: subcluster info
	SCName         *string
	SCHosts        []string
	SCRawHosts     []string
	IsPrimary      *bool
	ControlSetSize *int
	CloneSC        *string
}

func VAddSubclusterOptionsFactory

func VAddSubclusterOptionsFactory() VAddSubclusterOptions

type VClusterCommands

type VClusterCommands struct {
	Log vlog.Printer
}

VClusterCommands passes state around for all top-level administrator commands (e.g. create db, add node, etc.).

func (*VClusterCommands) VAddNode

func (vcc *VClusterCommands) VAddNode(options *VAddNodeOptions) (VCoordinationDatabase, error)

VAddNode adds one or more nodes to an existing database. It returns a VCoordinationDatabase that contains catalog information and any error encountered.

func (*VClusterCommands) VAddSubcluster

func (vcc *VClusterCommands) VAddSubcluster(options *VAddSubclusterOptions) error

VAddSubcluster adds to a running database a new subcluster with provided options. It returns any error encountered.

func (*VClusterCommands) VCreateDatabase

func (vcc *VClusterCommands) VCreateDatabase(options *VCreateDatabaseOptions) (VCoordinationDatabase, error)

func (*VClusterCommands) VDropDatabase

func (vcc *VClusterCommands) VDropDatabase(options *VDropDatabaseOptions) error

func (*VClusterCommands) VFetchNodeState

func (vcc *VClusterCommands) VFetchNodeState(options *VFetchNodeStateOptions) ([]NodeInfo, error)

VFetchNodeState returns the node state (e.g., up or down) for each node in the cluster and any error encountered.

func (*VClusterCommands) VInstallPackages added in v1.2.0

func (vcc *VClusterCommands) VInstallPackages(options *VInstallPackagesOptions) (*InstallPackageStatus, error)

func (*VClusterCommands) VReIP

func (vcc *VClusterCommands) VReIP(options *VReIPOptions) error

VReIP changes the node address, control address, and control broadcast for a node. It returns any error encountered.

func (*VClusterCommands) VRemoveNode

func (vcc *VClusterCommands) VRemoveNode(options *VRemoveNodeOptions) (VCoordinationDatabase, error)

func (*VClusterCommands) VRemoveSubcluster

func (vcc *VClusterCommands) VRemoveSubcluster(removeScOpt *VRemoveScOptions) (VCoordinationDatabase, error)

VRemoveSubcluster removes a subcluster. It returns updated database catalog information and any error encountered. VRemoveSubcluster has three major phases:

  1. Pre-check: check the subcluster name and get nodes for the subcluster.
  2. Removes nodes: Optional. If there are any nodes still associated with the subcluster, runs VRemoveNode.
  3. Drop the subcluster: Remove the subcluster name from the database catalog.

func (*VClusterCommands) VReviveDatabase

func (vcc *VClusterCommands) VReviveDatabase(options *VReviveDatabaseOptions) (dbInfo string, vdbPtr *VCoordinationDatabase, err error)

VReviveDatabase revives a database that was terminated but whose communal storage data still exists. It returns the database information retrieved from communal storage and any error encountered.

func (*VClusterCommands) VSandbox added in v1.1.0

func (vcc *VClusterCommands) VSandbox(options *VSandboxOptions) error

func (*VClusterCommands) VScrutinize

func (vcc *VClusterCommands) VScrutinize(options *VScrutinizeOptions) error

func (*VClusterCommands) VShowRestorePoints added in v1.2.0

func (vcc *VClusterCommands) VShowRestorePoints(options *VShowRestorePointsOptions) (restorePoints []RestorePoint, err error)

VShowRestorePoints can query the restore points from an archive

func (*VClusterCommands) VStartDatabase

func (vcc *VClusterCommands) VStartDatabase(options *VStartDatabaseOptions) error

func (*VClusterCommands) VStartNodes

func (vcc *VClusterCommands) VStartNodes(options *VStartNodesOptions) error

VStartNodes starts the given nodes for a cluster that has not yet lost cluster quorum. Returns any error encountered. If necessary, it updates the node's IP in the Vertica catalog. If cluster quorum is already lost, use VStartDatabase. It will skip any nodes given that no longer exist in the catalog.

func (*VClusterCommands) VStopDatabase

func (vcc *VClusterCommands) VStopDatabase(options *VStopDatabaseOptions) error

func (*VClusterCommands) VUnsandbox added in v1.1.0

func (vcc *VClusterCommands) VUnsandbox(options *VUnsandboxOptions) error

type VClusterOpEngine

type VClusterOpEngine struct {
	// contains filtered or unexported fields
}

type VCoordinationDatabase

type VCoordinationDatabase struct {
	Name string
	// processed path prefixes
	CatalogPrefix string
	DataPrefix    string
	HostNodeMap   vHostNodeMap
	// for convenience
	HostList []string // expected to be resolved IP addresses

	// Eon params, the boolean values are for convenience
	IsEon                   bool
	CommunalStorageLocation string
	UseDepot                bool
	DepotPrefix             string
	DepotSize               string
	AwsIDKey                string
	AwsSecretKey            string
	NumShards               int

	// authentication
	LicensePathOnNode string

	// more to add when useful
	Ipv6 bool

	PrimaryUpNodes []string
}

VCoordinationDatabase represents catalog and node information for a database. The VCreateDatabase command returns a VCoordinationDatabase struct. Operations on an existing database (e.g. VStartDatabase) consume a VCoordinationDatabase struct.

func (*VCoordinationDatabase) WriteClusterConfig

func (vdb *VCoordinationDatabase) WriteClusterConfig(configDir *string, logger vlog.Printer) error

WriteClusterConfig updates cluster configuration with the YAML-formatted file in configDir and writes to the log and stdout. It returns any error encountered.

type VCoordinationNode

type VCoordinationNode struct {
	Name    string `json:"name"`
	Address string
	// complete paths, not just prefix
	CatalogPath          string `json:"catalog_path"`
	StorageLocations     []string
	UserStorageLocations []string
	DepotPath            string
	// DB client port, should be 5433 by default
	Port int
	// default should be ipv4
	ControlAddressFamily string
	IsPrimary            bool
	State                string
	// empty string if it is not an eon db
	Subcluster string
	// empty string if it is not in a sandbox
	Sandbox string
}

VCoordinationNode represents node information from the database catalog.

type VCreateDatabaseOptions

type VCreateDatabaseOptions struct {
	/* part 1: basic db info */
	DatabaseOptions
	Policy            *string // database restart policy
	SQLFile           *string // SQL file to run (as dbadmin) immediately on database creation
	LicensePathOnNode *string // required to be a fully qualified path

	ShardCount               *int    // number of shards in the database"
	DepotSize                *string // depot size with two supported formats: % and KMGT, e.g., 50% or 10G
	GetAwsCredentialsFromEnv *bool   // whether get AWS credentials from environmental variables
	// part 3: optional info
	ForceCleanupOnFailure     *bool // whether force remove existing directories on failure
	ForceRemovalAtCreation    *bool // whether force remove existing directories before creating the database
	SkipPackageInstall        *bool // whether skip package installation
	TimeoutNodeStartupSeconds *int  // timeout in seconds for polling node start up state

	Broadcast          *bool // configure Spread to use UDP broadcast traffic between nodes on the same subnet
	P2p                *bool // configure Spread to use point-to-point communication between all Vertica nodes
	LargeCluster       *int  // whether enables a large cluster layout
	ClientPort         *int  // for internal QA test only, do not abuse
	SpreadLogging      *bool // whether enable spread logging
	SpreadLoggingLevel *int  // spread logging level

	SkipStartupPolling *bool // whether skip startup polling
	GenerateHTTPCerts  *bool // whether generate http certificates
	// If the path is set, the NMA will store the Vertica start command at the path
	// instead of executing it. This is useful in containerized environments where
	// you may not want to have both the NMA and Vertica server in the same container.
	// This feature requires version 24.2.0+.
	StartUpConf *string
	// contains filtered or unexported fields
}

VCreateDatabaseOptions represents the available options when you create a database with VCreateDatabase.

func VCreateDatabaseOptionsFactory

func VCreateDatabaseOptionsFactory() VCreateDatabaseOptions

type VDropDatabaseOptions

type VDropDatabaseOptions struct {
	VCreateDatabaseOptions
	ForceDelete *bool // whether force delete directories
}

VDropDatabaseOptions adds to VCreateDatabaseOptions the option to force delete directories.

func VDropDatabaseOptionsFactory

func VDropDatabaseOptionsFactory() VDropDatabaseOptions

func (*VDropDatabaseOptions) AnalyzeOptions

func (options *VDropDatabaseOptions) AnalyzeOptions() error

AnalyzeOptions verifies the host options for the VDropDatabaseOptions struct and returns any error encountered.

type VFetchNodeStateOptions

type VFetchNodeStateOptions struct {
	DatabaseOptions
}

func VFetchNodeStateOptionsFactory

func VFetchNodeStateOptionsFactory() VFetchNodeStateOptions

type VInstallPackagesOptions added in v1.2.0

type VInstallPackagesOptions struct {
	/* part 1: basic db info */
	DatabaseOptions

	// If true, the packages will be reinstalled even if they are already installed.
	ForceReinstall *bool
}

func VInstallPackagesOptionsFactory added in v1.2.0

func VInstallPackagesOptionsFactory() VInstallPackagesOptions

type VReIPOptions

type VReIPOptions struct {
	DatabaseOptions

	// re-ip list
	ReIPList []ReIPInfo

	// whether trim re-ip list based on the catalog info
	TrimReIPList bool
}

func VReIPFactory

func VReIPFactory() VReIPOptions

func (*VReIPOptions) ReadReIPFile

func (opt *VReIPOptions) ReadReIPFile(path string) error

ReadReIPFile reads the re-IP file and builds a slice of ReIPInfo. It returns any error encountered.

type VRemoveNodeOptions

type VRemoveNodeOptions struct {
	DatabaseOptions
	HostsToRemove []string // Hosts to remove from database
	Initiator     string   // A primary up host that will be used to execute remove_node operations.
	ForceDelete   *bool    // whether force delete directories
}

VRemoveNodeOptions represents the available options to remove one or more nodes from the database.

func VRemoveNodeOptionsFactory

func VRemoveNodeOptionsFactory() VRemoveNodeOptions

func (*VRemoveNodeOptions) ParseHostToRemoveList

func (o *VRemoveNodeOptions) ParseHostToRemoveList(hosts string) error

ParseHostToRemoveList converts a comma-separated string list of hosts into a slice of host names to remove from the database. During parsing, the hosts are converted to lowercase. It returns any parsing error encountered.

type VRemoveScOptions

type VRemoveScOptions struct {
	DatabaseOptions
	SubclusterToRemove *string // subcluster to remove from database
	ForceDelete        *bool   // whether force delete directories
}

VRemoveScOptions represents the available options when you remove a subcluster from a database.

func VRemoveScOptionsFactory

func VRemoveScOptionsFactory() VRemoveScOptions

type VReviveDatabaseOptions

type VReviveDatabaseOptions struct {
	/* part 1: basic db info */
	DatabaseOptions

	// timeout in seconds of loading remote catalog
	LoadCatalogTimeout *uint
	// whether force remove existing directories before revive the database
	ForceRemoval *bool
	// describe the database on communal storage, and exit
	DisplayOnly *bool
	// whether ignore the cluster lease
	IgnoreClusterLease *bool
	// the restore policy
	RestorePoint *RestorePointPolicy
}

func VReviveDBOptionsFactory

func VReviveDBOptionsFactory() VReviveDatabaseOptions

type VSandboxOptions added in v1.1.0

type VSandboxOptions struct {
	DatabaseOptions
	SandboxName *string
	SCName      *string
	SCHosts     []string
	SCRawHosts  []string
}

func VSandboxOptionsFactory added in v1.1.0

func VSandboxOptionsFactory() VSandboxOptions

func (*VSandboxOptions) ValidateAnalyzeOptions added in v1.1.0

func (options *VSandboxOptions) ValidateAnalyzeOptions(vcc *VClusterCommands) error

type VSandboxSubclusterInfo added in v1.2.0

type VSandboxSubclusterInfo struct {
	DBName string
	// Hosts should contain at least one primary host for performing sandboxing,
	// as sandboxing requires the subcluster to be secondary.
	Hosts       []string
	SCHosts     []string
	UserName    string
	Password    *string
	SCName      string
	SandboxName string
}

type VScrutinizeOptions

type VScrutinizeOptions struct {
	DatabaseOptions
	ID string // generated: "VerticaScrutinize.yyyymmddhhmmss"
}

func VScrutinizOptionsFactory

func VScrutinizOptionsFactory() VScrutinizeOptions

func (*VScrutinizeOptions) ValidateAnalyzeOptions

func (options *VScrutinizeOptions) ValidateAnalyzeOptions(logger vlog.Printer) error

type VShowRestorePointsOptions added in v1.2.0

type VShowRestorePointsOptions struct {
	DatabaseOptions
	// Optional arguments to list only restore points that
	// meet the specified condition(s)
	FilterOptions *ShowRestorePointFilterOptions
}

func VShowRestorePointsFactory added in v1.2.0

func VShowRestorePointsFactory() VShowRestorePointsOptions

type VStartDatabaseOptions

type VStartDatabaseOptions struct {
	// basic db info
	DatabaseOptions
	// timeout for polling the states of all nodes in the database in HTTPSPollNodeStateOp
	StatePollingTimeout *int
	// whether trim the input host list based on the catalog info
	TrimHostList *bool
	// If the path is set, the NMA will store the Vertica start command at the path
	// instead of executing it. This is useful in containerized environments where
	// you may not want to have both the NMA and Vertica server in the same container.
	// This feature requires version 24.2.0+.
	StartUpConf *string
}

VStartDatabaseOptions represents the available options when you start a database with VStartDatabase.

func VStartDatabaseOptionsFactory

func VStartDatabaseOptionsFactory() VStartDatabaseOptions

type VStartNodesInfo

type VStartNodesInfo struct {
	// The IP address that we intend to re-IP can be obtained from a set of nodes provided as input
	// within VStartNodesOptions struct
	ReIPList []string
	// The names of the nodes that we intend to re-IP can be acquired from a set of nodes provided as input
	// within the VStartNodesOptions struct
	NodeNamesToStart []string
	// the hosts that we want to start
	HostsToStart []string
}

type VStartNodesOptions

type VStartNodesOptions struct {
	// basic db info
	DatabaseOptions
	// A set of nodes(nodename - host) that we want to start in the database
	Nodes map[string]string
	// timeout for polling nodes that we want to start in httpsPollNodeStateOp
	StatePollingTimeout int
	// If the path is set, the NMA will store the Vertica start command at the path
	// instead of executing it. This is useful in containerized environments where
	// you may not want to have both the NMA and Vertica server in the same container.
	// This feature requires version 24.2.0+.
	StartUpConf *string
}

VStartNodesOptions represents the available options when you start one or more nodes with VStartNodes.

func VStartNodesOptionsFactory

func VStartNodesOptionsFactory() VStartNodesOptions

func (*VStartNodesOptions) ParseNodesList

func (options *VStartNodesOptions) ParseNodesList(nodeListStr string) error

ParseNodesList builds and returns a map of nodes from a comma-separated list of nodes. For example, vnodeName1=host1,vnodeName2=host2 is converted to map[string]string{vnodeName1: host1, vnodeName2: host2}

type VStopDatabaseInfo

type VStopDatabaseInfo struct {
	DBName       string
	Hosts        []string
	UserName     string
	Password     *string
	DrainSeconds *int
	IsEon        bool
	Sandbox      string
	MainCluster  bool
}

type VStopDatabaseOptions

type VStopDatabaseOptions struct {
	/* part 1: basic db info */
	DatabaseOptions

	/* part 2: eon db info */
	DrainSeconds *int    // time in seconds to wait for database users' disconnection
	Sandbox      *string // Stop db on given sandbox
	MainCluster  *bool   // Stop db on main cluster only
	/* part 3: hidden info */
	CheckUserConn *bool // whether check user connection
	ForceKill     *bool // whether force kill connections
}

func VStopDatabaseOptionsFactory

func VStopDatabaseOptionsFactory() VStopDatabaseOptions

type VUnsandboxOptions added in v1.1.0

type VUnsandboxOptions struct {
	DatabaseOptions
	SCName *string
}

func VUnsandboxOptionsFactory added in v1.1.0

func VUnsandboxOptionsFactory() VUnsandboxOptions

func (*VUnsandboxOptions) ValidateAnalyzeOptions added in v1.1.0

func (options *VUnsandboxOptions) ValidateAnalyzeOptions(vcc *VClusterCommands) error

type VclusterOpVersion

type VclusterOpVersion struct {
	Origin string `json:"origin"`
	SemVer semVer
}

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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