nomadhelper

package
v0.0.0-...-366694d Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskForConfirmation

func AskForConfirmation() bool

AskForConfirmation prompts the user for confirmation before proceeding

func DisplayJobDiff

func DisplayJobDiff(diff nomad.JobDiff)

DisplayJobDiff prints the simplified diff between job versions

Types

type NomadHelper

type NomadHelper struct {
	Client *nomad.Client
	Config *nomad.Config
	Logger *zap.SugaredLogger
}

NomadHelper provides custodian helper functions

func (*NomadHelper) ApplyChanges

func (n *NomadHelper) ApplyChanges(job *nomad.Job, wg *sync.WaitGroup)

ApplyChanges will register the job and any changes it has with Nomad

func (*NomadHelper) BackupJobs

func (n *NomadHelper) BackupJobs()

BackupJobs will write JSON backups of all registered job

func (*NomadHelper) DeleteAllJobs

func (n *NomadHelper) DeleteAllJobs(force bool, autoApprove bool, purge bool, verbose bool)

DeleteAllJobs deregisters all jobs currently running in Nomad

func (*NomadHelper) Init

func (n *NomadHelper) Init()

Init will initialize the NomadHelper object

func (*NomadHelper) InitConfig

func (n *NomadHelper) InitConfig(config *nomad.Config)

InitConfig will initialize the NomadHelper object

func (*NomadHelper) ListJobs

func (n *NomadHelper) ListJobs(verbose bool, jobType string)

ListJobs scales all jobs in to count=1 or out to the jobs original count

func (*NomadHelper) ScaleInJobs

func (n *NomadHelper) ScaleInJobs(force bool, verbose bool)

ScaleInJobs scales all jobs in to count=1

func (*NomadHelper) ScaleOutJobs

func (n *NomadHelper) ScaleOutJobs(force bool, verbose bool)

ScaleOutJobs scales all jobs the original count

type ScaleType

type ScaleType int

ScaleType specifies scaling in or out

const (
	ScaleIn ScaleType = iota
	ScaleOut
)

ScaleType specifies scaling in or out

func (ScaleType) String

func (d ScaleType) String() string

Jump to

Keyboard shortcuts

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