nomad

package
v0.0.0-...-29e28e0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

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, groupID string, scale, min, max int) (string, int, error)

Scale increases or decreases the count of a task group

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