conn

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: LGPL-3.0 Imports: 1 Imported by: 0

README

Backpack Connection

This package contains all the code that interacts with Nomad's API. This is used to:

  • Deploy generated code from a Backpack
  • Manage existing jobs from generated code

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v0.2.0

func NewClient() (co *Client, err error)

NewClient returns a new client configured with the default values for Nomad See: https://godoc.org/github.com/hashicorp/nomad/api#DefaultConfig

func (*Client) GetJobAllocations added in v0.2.0

func (co *Client) GetJobAllocations(jobId string) (alls []*api.Allocation, err error)

func (*Client) GetJobFromCode added in v0.2.0

func (co *Client) GetJobFromCode(code string) (*api.Job, error)

GetJobFromCode is parsing the HCL code and providing a api.Job{} pointer

func (*Client) GetJobStatus added in v0.2.0

func (co *Client) GetJobStatus(jobId string) (j *api.Job, err error)

func (*Client) IsValid

func (co *Client) IsValid(code string) bool

IsValid that is the question!

func (*Client) Plan added in v0.2.0

func (co *Client) Plan(job *api.Job, diff bool) (plan *api.JobPlanResponse, err error)

Plan is parsing the HCL code and registering the Job into Nomad

func (*Client) Run

func (co *Client) Run(job *api.Job) (jr *api.JobRegisterResponse, err error)

Run is parsing the HCL code and registering the Job into Nomad

func (*Client) Stop added in v0.2.0

func (co *Client) Stop(jobID string, purge bool) (evalID string, err error)

Stop stops a specific Job

Jump to

Keyboard shortcuts

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