atmcfg

package
v0.0.0-...-ad7b3aa Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package atmcfg provides a set of helper methods to help you update the automation config.

Usage

import "go.mongodb.org/ops-manager/atmcfg"

Index

Constants

This section is empty.

Variables

View Source
var ErrMonitoringEnabled = errors.New("monitoring already enabled")
View Source
var ErrProcessNotFound = errors.New("process not found")

ErrProcessNotFound means the process was not found for the given cluster name.

View Source
var ErrUnsupportedMechanism = errors.New("unrecognized SCRAM-SHA format")

ErrUnsupportedMechanism means the provided mechanism wasn't valid.

Functions

func AddIndexConfig

func AddIndexConfig(out *opsmngr.AutomationConfig, newIndex *opsmngr.IndexConfig) error

AddIndexConfig adds an opsmngr.IndexConfig to the opsmngr.AutomationConfig.

func AddUser

func AddUser(out *opsmngr.AutomationConfig, u *opsmngr.MongoDBUser)

AddUser adds a opsmngr.MongoDBUser to the opsmngr.AutomationConfi.

func ConfigureScramCredentials

func ConfigureScramCredentials(user *opsmngr.MongoDBUser, password string) error

ConfigureScramCredentials creates both SCRAM-SHA-1 and SCRAM-SHA-256 credentials. Use this method to guarantee that password can be updated later.

func DisableBackup

func DisableBackup(out *opsmngr.AutomationConfig, hostname string) error

DisableBackup disables backup for the given hostname.

func DisableMonitoring

func DisableMonitoring(out *opsmngr.AutomationConfig, hostname string) error

DisableMonitoring disables monitoring for the given hostname.

func EnableBackup

func EnableBackup(out *opsmngr.AutomationConfig, hostname string) error

EnableBackup enables backup for the given hostname.

func EnableMechanism

func EnableMechanism(out *opsmngr.AutomationConfig, m []string) error

EnableMechanism allows you to enable a given set of authentication mechanisms to an opsmngr.AutomationConfig. This method currently only supports MONGODB-CR, and SCRAM-SHA-256.

func EnableMonitoring

func EnableMonitoring(out *opsmngr.AutomationConfig, hostname string) error

EnableMonitoring enables monitoring for the given hostname.

func IsGoalState

func IsGoalState(s *opsmngr.AutomationStatus) bool

func ReclaimFreeSpace

func ReclaimFreeSpace(out *opsmngr.AutomationConfig, clusterName string)

ReclaimFreeSpace sets all process of a cluster to reclaim free space.

func ReclaimFreeSpaceForProcessesByClusterName

func ReclaimFreeSpaceForProcessesByClusterName(out *opsmngr.AutomationConfig, clusterName, lastCompact string, processes []string) error

ReclaimFreeSpaceForProcessesByClusterName reclaims free space for a cluster. Processes are provided in the format {"hostname:port","hostname2:port2"}.

func ReclaimFreeSpaceWithLastCompact

func ReclaimFreeSpaceWithLastCompact(out *opsmngr.AutomationConfig, clusterName, lastCompact string)

func RemoveByClusterName

func RemoveByClusterName(out *opsmngr.AutomationConfig, name string)

RemoveByClusterName removes a cluster and its associated processes from the config. This won't shutdown any running process.

func RemoveUser

func RemoveUser(out *opsmngr.AutomationConfig, username, database string) error

RemoveUser removes a MongoDBUser from the authentication config.

func Restart

func Restart(out *opsmngr.AutomationConfig, name string)

Restart sets all process of a cluster to restart.

func RestartProcessesByClusterName

func RestartProcessesByClusterName(out *opsmngr.AutomationConfig, clusterName string, processes []string) error

RestartProcessesByClusterName restart the entire cluster or its processes. Processes are provided in the format {"hostname:port","hostname2:port2"}.

func Shutdown

func Shutdown(out *opsmngr.AutomationConfig, clusterName string)

Shutdown disables all processes of the given cluster name.

func ShutdownProcessesByClusterName

func ShutdownProcessesByClusterName(out *opsmngr.AutomationConfig, clusterName string, processes []string) error

ShutdownProcessesByClusterName disables the entire cluster or its processes. Processes are provided in the format {"hostname:port","hostname2:port2"}.

func StartInitialSync

func StartInitialSync(out *opsmngr.AutomationConfig, clusterName string)

StartInitialSync the MongoDB Agent checks whether the specified timestamp is later than the time of the last resync, and if confirmed, starts init sync on the secondary nodes in a rolling fashion. The MongoDB Agent waits until you ask the primary node to become the secondary with the rs.stepDown() method, and then starts init sync on this node.

Warning: Use this method with caution. During initial sync, Automation removes the entire contents of the node’s dbPath directory.

See also: https://www.mongodb.com/docs/manual/core/replica-set-sync/#replica-set-initial-sync

func StartInitialSyncAt

func StartInitialSyncAt(out *opsmngr.AutomationConfig, clusterName, lastResync string)

StartInitialSyncAt specify the type to start the initial sync at,

Warning: Use this method with caution. During initial sync, Automation removes the entire contents of the node’s dbPath directory.

See also: https://www.mongodb.com/docs/manual/core/replica-set-sync/#replica-set-initial-sync

func StartInitialSyncAtForProcessesByClusterName

func StartInitialSyncAtForProcessesByClusterName(out *opsmngr.AutomationConfig, clusterName, lastResync string, processes []string) error

StartInitialSyncAtForProcessesByClusterName trigger initial sync for a cluster. Processes are provided in the format {"hostname:port","hostname2:port2"}.

See also: https://www.mongodb.com/docs/manual/core/replica-set-sync/#replica-set-initial-sync

func Startup

func Startup(out *opsmngr.AutomationConfig, name string)

Startup enables all processes of the given cluster name.

func StartupProcessesByClusterName

func StartupProcessesByClusterName(out *opsmngr.AutomationConfig, clusterName string, processes []string) error

StartupProcessesByClusterName enables the entire cluster or its processes. Processes are provided in the format {"hostname:port","hostname2:port2"}.

func Suspend

func Suspend(out *opsmngr.AutomationConfig, clusterName string)

Suspend suspends automation for all processes.

func SuspendProcessesByClusterName

func SuspendProcessesByClusterName(out *opsmngr.AutomationConfig, clusterName string, processes []string) error

SuspendProcessesByClusterName suspends automation for the entire cluster or its processes. Processes are provided in the format {"hostname:port","hostname2:port2"}.

Types

This section is empty.

Jump to

Keyboard shortcuts

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