nomad

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Deployment
	ReadDeployment(ID string) (*nomad.Deployment, error)

	// Evaluation
	ReadEvaluation(ID string) (*nomad.Evaluation, error)

	// Job
	ParseJob(hcl string) (*nomad.Job, error)
	UpdateJob(*nomad.Job) (*nomad.JobRegisterResponse, error)
	GetLatestDeployment(name string) (*nomad.Deployment, error)
	StopJob(ID string, purge bool) error
	ReadJob(ID string) (*nomad.Job, error)
}

Client interface.

type DefaultClient

type DefaultClient struct {
	Address string
	Client  *nomad.Client
	// contains filtered or unexported fields
}

DefaultClient is the default nomad client.

func NewDefaultClient added in v1.0.7

func NewDefaultClient(addr string, httpRetryAttempts int) (*DefaultClient, error)

NewDefaultClient creates a new client for the given address.

func (*DefaultClient) GetLatestDeployment

func (c *DefaultClient) GetLatestDeployment(name string) (*nomad.Deployment, error)

GetLatestDeployment returns the most recent deployment for a job.

func (*DefaultClient) ParseJob

func (c *DefaultClient) ParseJob(hcl string) (*nomad.Job, error)

ParseJob takes a hcl job file and converts it to json.

func (*DefaultClient) ReadDeployment

func (c *DefaultClient) ReadDeployment(ID string) (*nomad.Deployment, error)

ReadDeployment returns the data for a given deployment id.

func (*DefaultClient) ReadEvaluation

func (c *DefaultClient) ReadEvaluation(ID string) (*nomad.Evaluation, error)

ReadEvaluation reads the requested evaluation.

func (*DefaultClient) ReadJob

func (c *DefaultClient) ReadJob(ID string) (*nomad.Job, error)

ReadJob reads a job by id.

func (*DefaultClient) StopJob

func (c *DefaultClient) StopJob(ID string, purge bool) error

StopJob stops a given job.

func (*DefaultClient) UpdateJob

func (c *DefaultClient) UpdateJob(job *nomad.Job) (*nomad.JobRegisterResponse, error)

UpdateJob registers the given job with nomad.

Jump to

Keyboard shortcuts

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