nomad

package
v0.0.0-...-c0ac931 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(c Config) (*api.Client, error)

NewClient will create a instance of a nomad API Client

func Restart

func Restart(client *api.Client, jobID, group, task, image string) (string, error)

Restart restarts a job to get the latest docker image

func Scale

func Scale(client *api.Client, jobID, group string, scale, min, max int) (string, int, error)

Scale increases or decreases the count of a task group Returns EvaluationID (string), New Count (int), Error

func SetCapacity

func SetCapacity(client *api.Client, jobID, groupID string, count, min, max int) (string, int, error)

SetCapacity sets the count of a task group

Types

type Config

type Config struct {
	Address string `hcl:"address"`
}

Config struct

type Group

type Group struct {
	Name     string
	MinCount int                      `hcl:"min_count"`
	MaxCount int                      `hcl:"max_count"`
	Rules    map[string]*structs.Rule `hcl:"rule"`
}

Group struct

type Job

type Job struct {
	Name   string
	Groups map[string]*Group `hcl:"group"`
}

Job Struct

Jump to

Keyboard shortcuts

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