models

package
v0.0.0-...-6eec0fd Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backup

type Backup struct {
	*common.BackupRestore
	// contains filtered or unexported fields
}

Backup type struct

func (*Backup) Execute

func (b *Backup) Execute() error

Execute - execute backup

type Cluster

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

Cluster type struct

func (*Cluster) AddNode

func (c *Cluster) AddNode(address string, port int) error

AddNode - Add node to cluster struct

func (*Cluster) AddPrivileges

func (c *Cluster) AddPrivileges(role string, privileges []as.Privilege) error

AddPrivileges - grant privs to role

func (*Cluster) AlertsFrom

func (c *Cluster) AlertsFrom(id int64) []*common.Alert

AlertsFrom - get alerts by node id

func (*Cluster) Alias

func (c *Cluster) Alias() *string

Alias - get cluster alias

func (*Cluster) Backup

func (c *Cluster) Backup(
	Namespace string,
	DestinationAddress string,
	DestinationPath string,
	Username string,
	Password string,
	Sets string,
	MetadataOnly bool,
	TerminateOnChange bool,
	ModifiedBefore string,
	ModifiedAfter string,
	ScanPriority int) (*Backup, error)

Backup - backup cluster

func (*Cluster) BuildDetails

func (c *Cluster) BuildDetails() map[string]interface{}

BuildDetails - get build details for all nodes

func (*Cluster) ChangeUserPassword

func (c *Cluster) ChangeUserPassword(user, pass string) error

ChangeUserPassword - change user password

func (*Cluster) CreateIndex

func (c *Cluster) CreateIndex(namespace, setName, indexName, binName, indexType string) error

CreateIndex - create sindex

func (*Cluster) CreateRole

func (c *Cluster) CreateRole(role string, privileges []as.Privilege) error

CreateRole - create role

func (*Cluster) CreateUDF

func (c *Cluster) CreateUDF(name, body string) error

CreateUDF - register UDF module

func (*Cluster) CreateUser

func (c *Cluster) CreateUser(user, password string, roles []string) error

CreateUser - create user

func (*Cluster) CurrentBackup

func (c *Cluster) CurrentBackup() *Backup

CurrentBackup - get current backup settings

func (*Cluster) CurrentRestore

func (c *Cluster) CurrentRestore() *Restore

CurrentRestore - get current resotre info

func (*Cluster) CurrentUserPrivileges

func (c *Cluster) CurrentUserPrivileges() []string

CurrentUserPrivileges - get current user privs

func (*Cluster) DatacenterInfo

func (c *Cluster) DatacenterInfo(sessionID string) common.Stats

DatacenterInfo - get XDR DC info

func (*Cluster) Disk

func (c *Cluster) Disk() common.Stats

Disk - get total disk stats for cluster

func (*Cluster) DropIndex

func (c *Cluster) DropIndex(namespace, setName, indexName string) error

DropIndex - drop sindex

func (*Cluster) DropRole

func (c *Cluster) DropRole(role string) error

DropRole - drop role

func (*Cluster) DropUDF

func (c *Cluster) DropUDF(udf string) error

DropUDF - remove UDF module

func (*Cluster) DropUser

func (c *Cluster) DropUser(user string) error

DropUser - drop user

func (*Cluster) FindNodeByAddress

func (c *Cluster) FindNodeByAddress(address string) *Node

FindNodeByAddress - get node by ip address

func (*Cluster) FindNodeByID

func (c *Cluster) FindNodeByID(ID string) *Node

FindNodeByID - get node by id

func (*Cluster) FindNodesByAddress

func (c *Cluster) FindNodesByAddress(addresses ...string) []*Node

FindNodesByAddress - get node(s) by ip address

func (*Cluster) GrantRoles

func (c *Cluster) GrantRoles(user string, roles []string) error

GrantRoles - grant role to user

func (*Cluster) ID

func (c *Cluster) ID() string

ID - get cluster uuid

func (*Cluster) IsSet

func (c *Cluster) IsSet() bool

IsSet - check if client is set

func (*Cluster) Jobs

func (c *Cluster) Jobs() []common.Stats

Jobs - get scan jobs

func (*Cluster) LatestThroughput

func (c *Cluster) LatestThroughput() map[string]map[string]*common.SinglePointValue

LatestThroughput - get latest throughput for graph

func (*Cluster) Memory

func (c *Cluster) Memory() common.Stats

Memory - get total memory stats for cluster

func (*Cluster) Name

func (c *Cluster) Name() *string

Name - get cluster name

func (*Cluster) NamespaceDeviceInfo

func (c *Cluster) NamespaceDeviceInfo(namespace string) common.Stats

NamespaceDeviceInfo - get namespace device info

func (*Cluster) NamespaceIndexInfo

func (c *Cluster) NamespaceIndexInfo(namespace string) map[string]common.Info

NamespaceIndexInfo - get namespace sindex info

func (*Cluster) NamespaceIndexes

func (c *Cluster) NamespaceIndexes() map[string][]string

NamespaceIndexes - get namespace sindexes

func (*Cluster) NamespaceInfo

func (c *Cluster) NamespaceInfo(namespaces []string) map[string]common.Stats

NamespaceInfo - get namespace info

func (*Cluster) NamespaceInfoPerNode

func (c *Cluster) NamespaceInfoPerNode(ns string, nodeAddrs []string) map[string]interface{}

NamespaceInfoPerNode - get namespace info per node

func (*Cluster) NamespaceList

func (c *Cluster) NamespaceList() (result []string)

NamespaceList - get namespace list

func (*Cluster) NamespaceSetsInfo

func (c *Cluster) NamespaceSetsInfo(namespace string) []common.Stats

NamespaceSetsInfo - get namespace sets info

func (*Cluster) NodeBuilds

func (c *Cluster) NodeBuilds() (builds []string)

NodeBuilds - get builds of nodes

func (*Cluster) NodeCompatibility

func (c *Cluster) NodeCompatibility() string

NodeCompatibility - get node compatibility

func (*Cluster) NodeList

func (c *Cluster) NodeList() []string

NodeList - get node list

func (*Cluster) Nodes

func (c *Cluster) Nodes() (nodes []*Node)

Nodes - add nodes to cluster

func (*Cluster) OffNodes

func (c *Cluster) OffNodes() []string

OffNodes - turn off node for cluster

func (*Cluster) Password

func (c *Cluster) Password() *string

Password - get user password

func (*Cluster) RandomActiveNode

func (c *Cluster) RandomActiveNode() *Node

RandomActiveNode check if there is a node active

func (*Cluster) RedAlertCount

func (c *Cluster) RedAlertCount() int

RedAlertCount - count red alerts

func (*Cluster) RemoveNodeByAddress

func (c *Cluster) RemoveNodeByAddress(address string) error

RemoveNodeByAddress - remove node by address from cluster struct

func (*Cluster) RemovePrivileges

func (c *Cluster) RemovePrivileges(role string, privileges []as.Privilege) error

RemovePrivileges - revoke privs from role

func (*Cluster) RequestInfoAll

func (c *Cluster) RequestInfoAll(cmd string) (map[*Node]string, error)

RequestInfoAll - get all info attributes

func (*Cluster) Restore

func (c *Cluster) Restore(
	Namespace string,
	DestinationAddress string,
	DestinationPath string,
	Username string,
	Password string,
	Threads int,
	MissingRecordsOnly bool,
	IgnoreGenerationNum bool) (*Restore, error)

Restore - restore

func (*Cluster) RevokeRoles

func (c *Cluster) RevokeRoles(user string, roles []string) error

RevokeRoles - revoke role to user

func (*Cluster) RoleNames

func (c *Cluster) RoleNames() []string

RoleNames - get role names

func (*Cluster) Roles

func (c *Cluster) Roles() []*as.Role

Roles - get roles

func (*Cluster) SameAs

func (c *Cluster) SameAs(other *Cluster) bool

SameAs compares nodes between two clusters and returns true if the two clusters have at least one node in common.

func (*Cluster) SecurityEnabled

func (c *Cluster) SecurityEnabled() bool

SecurityEnabled - check if security enabled

func (*Cluster) SeedAddress

func (c *Cluster) SeedAddress() string

SeedAddress - get see addresses

func (*Cluster) SendEmailNotifications

func (c *Cluster) SendEmailNotifications()

SendEmailNotifications - send email notification for alert

func (*Cluster) ServerTime

func (c *Cluster) ServerTime() time.Time

ServerTime - get server time

func (*Cluster) SetAlias

func (c *Cluster) SetAlias(alias string)

SetAlias - set cluster alias

func (*Cluster) SetUpdateInterval

func (c *Cluster) SetUpdateInterval(val int)

SetUpdateInterval - set update interval

func (*Cluster) ShowInUI

func (c *Cluster) ShowInUI() bool

ShowInUI - get show in UI flag

func (*Cluster) Status

func (c *Cluster) Status() string

Status - check cluster status and connectivity

func (*Cluster) ThroughputSince

func (c *Cluster) ThroughputSince(tm time.Time) map[string]map[string][]*common.SinglePointValue

ThroughputSince - get throughput info since time

func (*Cluster) UpdateInterval

func (c *Cluster) UpdateInterval() int

UpdateInterval - get update interval for cluster

func (*Cluster) UpdatePassword

func (c *Cluster) UpdatePassword(user, currentPass, newPass string) error

UpdatePassword - update password

func (*Cluster) User

func (c *Cluster) User() *string

User - get user name

func (*Cluster) Users

func (c *Cluster) Users() []*as.UserRoles

Users - get user list

func (*Cluster) ValidCurrentUser

func (c *Cluster) ValidCurrentUser(user, password string) bool

ValidCurrentUser - check if current value is valid

type DebugStatus

type DebugStatus struct {
	On        bool
	StartTime time.Time
	Duration  time.Duration
	Initiator string
}

DebugStatus type struct

type Namespace

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

Namespace type struct

func NewNamespace

func NewNamespace(node *Node, name string) *Namespace

NewNamespace - create new namespace strunct

func (*Namespace) CheckAvailablePct

func (ns *Namespace) CheckAvailablePct(latestState common.Stats)

CheckAvailablePct - check namespace available percents

func (*Namespace) CheckDiskPctHighWatermark

func (ns *Namespace) CheckDiskPctHighWatermark(latestState common.Stats)

CheckDiskPctHighWatermark - check disk high water mark

func (*Namespace) CheckDiskPctStopWrites

func (ns *Namespace) CheckDiskPctStopWrites(latestState common.Stats)

CheckDiskPctStopWrites - check disk stop writes limit

func (*Namespace) CheckMemoryPctHighWatermark

func (ns *Namespace) CheckMemoryPctHighWatermark(latestState common.Stats)

CheckMemoryPctHighWatermark - check memory high water mark

func (*Namespace) CheckMemoryPctStopWrites

func (ns *Namespace) CheckMemoryPctStopWrites(latestState common.Stats)

CheckMemoryPctStopWrites - check memory stop writes limit

func (*Namespace) ConfigAttrs

func (ns *Namespace) ConfigAttrs(names ...string) common.Stats

ConfigAttrs - get config attribution

func (*Namespace) Disk

func (ns *Namespace) Disk() common.Stats

Disk - get disk space stat struct

func (*Namespace) DiskPercent

func (ns *Namespace) DiskPercent() common.Stats

DiskPercent - get disk perecent stat struct

func (*Namespace) IndexStats

func (ns *Namespace) IndexStats(name string) common.Stats

IndexStats - get index stat

func (*Namespace) InfoAttr

func (ns *Namespace) InfoAttr(name string) string

InfoAttr - get latency info attribute

func (*Namespace) InfoAttrs

func (ns *Namespace) InfoAttrs(names ...string) common.Info

InfoAttrs - get namespace attribute

func (*Namespace) Memory

func (ns *Namespace) Memory() common.Stats

Memory - get memory stat struct

func (*Namespace) MemoryPercent

func (ns *Namespace) MemoryPercent() common.Stats

MemoryPercent - get memory stat perecent struct

func (*Namespace) ServerTime

func (ns *Namespace) ServerTime() time.Time

ServerTime - return server time

func (*Namespace) SetConfig

func (ns *Namespace) SetConfig(config common.Info) ([]string, error)

SetConfig - set config attribution

func (*Namespace) SetsInfo

func (ns *Namespace) SetsInfo() map[string]common.Stats

SetsInfo - get Sets stats

func (*Namespace) Stats

func (ns *Namespace) Stats() common.Stats

Stats - get general stats

func (*Namespace) StatsAttr

func (ns *Namespace) StatsAttr(name string) interface{}

StatsAttr - get namespace stat attribute

func (*Namespace) StatsAttrs

func (ns *Namespace) StatsAttrs(names ...string) common.Stats

StatsAttrs - get namespace stat attribute

type Node

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

Node type struct

func (*Node) Address

func (n *Node) Address() string

Address - get node ip address

func (*Node) AlertsFrom

func (n *Node) AlertsFrom(id int64) []*common.Alert

AlertsFrom - alert from node

func (*Node) AnyAttrs

func (n *Node) AnyAttrs(names ...string) common.Stats

AnyAttrs - get attribute(s) from any stat structure

func (*Node) Bins

func (n *Node) Bins() common.Stats

Bins - get count of bins

func (*Node) Build

func (n *Node) Build() string

Build - get node build

func (*Node) CheckClusterVisibility

func (n *Node) CheckClusterVisibility(latestState common.Stats)

CheckClusterVisibility - check if node available

func (*Node) CheckDiskSpace

func (n *Node) CheckDiskSpace(latestState common.Stats)

CheckDiskSpace - check available free disk

func (*Node) CheckFileDescriptors

func (n *Node) CheckFileDescriptors(latestState common.Stats)

CheckFileDescriptors - check number of file descriptors

func (*Node) CheckMemory

func (n *Node) CheckMemory(latestState common.Stats)

CheckMemory - check available memory

func (*Node) CheckStatus

func (n *Node) CheckStatus(latestState common.Stats)

CheckStatus - check status of last state

func (*Node) CheckTransactionQueue

func (n *Node) CheckTransactionQueue(latestState common.Stats)

CheckTransactionQueue - alert on transaction queue

func (*Node) ClusterName

func (n *Node) ClusterName() string

ClusterName - get cluster name

func (*Node) ConfigAttr

func (n *Node) ConfigAttr(name string) interface{}

ConfigAttr - get config attribute

func (*Node) ConfigAttrs

func (n *Node) ConfigAttrs(names ...string) common.Stats

ConfigAttrs - get config attributes

func (*Node) DataCenters

func (n *Node) DataCenters() map[string]common.Stats

DataCenters - build DC list

func (*Node) Disk

func (n *Node) Disk() common.Stats

Disk - build disk stats

func (*Node) Enterprise

func (n *Node) Enterprise() bool

Enterprise - check if EE

func (*Node) Host

func (n *Node) Host() string

Host - get node hostname

func (*Node) ID

func (n *Node) ID() string

ID - get node ID

func (*Node) Indexes

func (n *Node) Indexes(namespace string) map[string]common.Info

Indexes - get sindex stat

func (*Node) InfoAttr

func (n *Node) InfoAttr(name string) string

InfoAttr - get info attribute

func (*Node) InfoAttrFirstValidValueAmong

func (n *Node) InfoAttrFirstValidValueAmong(names ...string) string

InfoAttrFirstValidValueAmong - get attribute if not error value

func (*Node) InfoAttrs

func (n *Node) InfoAttrs(names ...string) common.Info

InfoAttrs - get node info attribute

func (*Node) Jobs

func (n *Node) Jobs() map[string]common.Stats

Jobs - get jobs from node

func (*Node) LatencySince

func (n *Node) LatencySince(tms string) []map[string]common.Stats

LatencySince - get latency since time

func (*Node) LatencyUnits

func (n *Node) LatencyUnits() string

LatencyUnits - get latency units (ms/us)

func (*Node) LatestLatency

func (n *Node) LatestLatency() map[string]common.Stats

LatestLatency get latest latency

func (*Node) LatestThroughput

func (n *Node) LatestThroughput() map[string]map[string]*common.SinglePointValue

LatestThroughput - get latest throughput for bucket

func (*Node) Memory

func (n *Node) Memory() common.Stats

Memory - build memory stats

func (*Node) MigrationStats

func (n *Node) MigrationStats() common.Info

MigrationStats - get migration stats from node

func (*Node) NamespaceByName

func (n *Node) NamespaceByName(ns string) *Namespace

NamespaceByName get namespace id by name

func (*Node) NamespaceIndexes

func (n *Node) NamespaceIndexes() map[string][]string

NamespaceIndexes - get sindex by namespace

func (*Node) NamespaceList

func (n *Node) NamespaceList() []string

NamespaceList - get list of namespaces in the node

func (*Node) Namespaces

func (n *Node) Namespaces() map[string]*Namespace

Namespaces - get namespace

func (*Node) Port

func (n *Node) Port() uint16

Port - get node port

func (*Node) RequestInfo

func (n *Node) RequestInfo(reties int, cmd ...string) (result map[string]string, err error)

RequestInfo get node info

func (*Node) ServerTime

func (n *Node) ServerTime() time.Time

ServerTime - get server time

func (*Node) SetServerConfig

func (n *Node) SetServerConfig(context string, config map[string]string) ([]string, error)

SetServerConfig - set server config for node

func (*Node) SetXDRConfig

func (n *Node) SetXDRConfig(name string, value interface{}) error

SetXDRConfig - set XDR configuration

func (*Node) StatsAttr

func (n *Node) StatsAttr(name string) interface{}

StatsAttr - get stat attribute

func (*Node) StatsAttrs

func (n *Node) StatsAttrs(names ...string) common.Stats

StatsAttrs - set stat attribute(s)

func (*Node) Status

func (n *Node) Status() NodeStatus

Status - get node status

func (*Node) SwitchXDR

func (n *Node) SwitchXDR(on bool) error

SwitchXDR - switch XDR on for a node

func (*Node) ThroughputSince

func (n *Node) ThroughputSince(tm time.Time) map[string]map[string][]*common.SinglePointValue

ThroughputSince - get throughput since time for bucket

func (*Node) UDFs

func (n *Node) UDFs() map[string]common.Stats

UDFs - get UDF modules list

func (*Node) VisibilityStatus

func (n *Node) VisibilityStatus() NodeVisibilityStatus

VisibilityStatus - check if node is active, enable/disable visibility

func (*Node) XdrConfig

func (n *Node) XdrConfig() common.Stats

XdrConfig - get XDR config

func (*Node) XdrEnabled

func (n *Node) XdrEnabled() bool

XdrEnabled - is XDR enabled?

func (*Node) XdrStats

func (n *Node) XdrStats() common.Stats

XdrStats - get XDR statistics

func (*Node) XdrStatus

func (n *Node) XdrStatus() XDRStatus

XdrStatus - get XDR status

type NodeStatus

type NodeStatus string

NodeStatus type

type NodeVisibilityStatus

type NodeVisibilityStatus string

NodeVisibilityStatus type

type ObserverT

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

ObserverT type struct

func New

func New(config *common.Config) *ObserverT

New - add monitoring server to the cluster

func (*ObserverT) AppendCluster

func (o *ObserverT) AppendCluster(sessionID string, cluster *Cluster)

AppendCluster add cluster for monitoring

func (*ObserverT) AutoClusters

func (o *ObserverT) AutoClusters() []*Cluster

AutoClusters - Add automatic clusters which have been required to show up in the UI

func (*ObserverT) Clusters

func (o *ObserverT) Clusters() []*Cluster

Clusters - get list of clusters observed

func (*ObserverT) Config

func (o *ObserverT) Config() *common.Config

Config - return config

func (*ObserverT) DatacenterInfo

func (o *ObserverT) DatacenterInfo(sessionID string) common.Stats

DatacenterInfo - Add auto clusters to the mix DO NOT add auto-clusters which are already included in the cluster.

func (*ObserverT) DebugStatus

func (o *ObserverT) DebugStatus() DebugStatus

DebugStatus - check debug status

func (*ObserverT) FindClusterByID

func (o *ObserverT) FindClusterByID(id string) *Cluster

FindClusterByID - get cluster by id

func (*ObserverT) FindClusterBySeed

func (o *ObserverT) FindClusterBySeed(sid string, host *as.Host, user, password string) *Cluster

FindClusterBySeed Checks for the cluster; If the cluster exists in the session, it won't check the user/pass since it has already been checked Otherwise, will search for the cluster in all the list and check user/pass in case the cluster exists

func (*ObserverT) MonitoringClusters

func (o *ObserverT) MonitoringClusters(sessionID string) ([]*Cluster, bool)

MonitoringClusters - get list of monitored cluster by sessionID

func (*ObserverT) NodeHasBeenDiscovered

func (o *ObserverT) NodeHasBeenDiscovered(sessionID string, alias string) *Cluster

NodeHasBeenDiscovered - check if a node has been discovered

func (*ObserverT) Register

func (o *ObserverT) Register(sessionID string, policy *as.ClientPolicy, alias string, hosts ...*as.Host) (*Cluster, error)

Register - register cluster to observer

func (*ObserverT) RemoveCluster

func (o *ObserverT) RemoveCluster(sessionID string, cluster *Cluster) int

RemoveCluster - remove cluster from observer

func (*ObserverT) SessionExists

func (o *ObserverT) SessionExists(sessionID string) bool

SessionExists - check if session exist in observer

func (*ObserverT) StartDebug

func (o *ObserverT) StartDebug(initiator string, duration time.Duration) DebugStatus

StartDebug - start debug

func (*ObserverT) StopDebug

func (o *ObserverT) StopDebug() DebugStatus

StopDebug - stop debug

type Restore

type Restore struct {
	*common.BackupRestore

	Threads             int
	MissingRecordsOnly  bool
	IgnoreGenerationNum bool
	// contains filtered or unexported fields
}

Restore type struct

func (*Restore) Execute

func (r *Restore) Execute() error

Execute - execute restore

type XDRStatus

type XDRStatus string

XDRStatus type

Jump to

Keyboard shortcuts

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