Documentation
¶
Index ¶
- type Client
- type DefaultClient
- func (c *DefaultClient) GetLatestDeployment(name string) (*nomad.Deployment, error)
- func (c *DefaultClient) ParseJob(hcl string) (*nomad.Job, error)
- func (c *DefaultClient) ReadDeployment(ID string) (*nomad.Deployment, error)
- func (c *DefaultClient) ReadEvaluation(ID string) (*nomad.Evaluation, error)
- func (c *DefaultClient) ReadJob(ID string) (*nomad.Job, error)
- func (c *DefaultClient) StopJob(ID string, purge bool) error
- func (c *DefaultClient) UpdateJob(job *nomad.Job) (*nomad.JobRegisterResponse, error)
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.
Click to show internal directories.
Click to hide internal directories.