Documentation
¶
Index ¶
- type Client
- type DefaultClient
- func (c *DefaultClient) GetLatestDeployment(name string) (Deployment, error)
- func (c *DefaultClient) ParseJob(hcl string) (string, string, error)
- func (c *DefaultClient) ReadDeployment(ID string) (Deployment, error)
- func (c *DefaultClient) ReadEvaluation(ID string) (Evaluation, error)
- func (c *DefaultClient) ReadJob(ID string) (ReadJobResponse, error)
- func (c *DefaultClient) StopJob(ID string, purge bool) error
- func (c *DefaultClient) UpdateJob(name string, data string) (UpdateJobResponse, error)
- type Deployment
- type DeploymentTaskGroup
- type Evaluation
- type Job
- type Periodic
- type ReadJobResponse
- type TaskGroup
- type UpdateJobResponse
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) (Deployment, error) // Evaluation ReadEvaluation(ID string) (Evaluation, error) // Job ParseJob(hcl string) (string, string, error) UpdateJob(name string, data string) (UpdateJobResponse, error) GetLatestDeployment(name string) (Deployment, error) StopJob(ID string, purge bool) error ReadJob(ID string) (ReadJobResponse, error) }
Client interface.
type DefaultClient ¶
type DefaultClient struct {
Address string
}
DefaultClient is the default nomad client.
func (*DefaultClient) GetLatestDeployment ¶
func (c *DefaultClient) GetLatestDeployment(name string) (Deployment, error)
GetLatestDeployment returns the most recent deployment for a job.
func (*DefaultClient) ParseJob ¶
func (c *DefaultClient) ParseJob(hcl string) (string, string, error)
ParseJob takes a hcl job file and converts it to json.
func (*DefaultClient) ReadDeployment ¶
func (c *DefaultClient) ReadDeployment(ID string) (Deployment, error)
ReadDeployment returns the data for a given deployment id.
func (*DefaultClient) ReadEvaluation ¶
func (c *DefaultClient) ReadEvaluation(ID string) (Evaluation, error)
ReadEvaluation reads the requested evaluation.
func (*DefaultClient) ReadJob ¶
func (c *DefaultClient) ReadJob(ID string) (ReadJobResponse, 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(name string, data string) (UpdateJobResponse, error)
UpdateJob registers the given job with nomad.
type Deployment ¶
type Deployment struct { ID string JobID string Status string StatusDescription string CreateIndex int ModifyIndex int JobCreateIndex int JobModifyIndex int JobVersion int TaskGroups map[string]DeploymentTaskGroup }
Deployment status.
type DeploymentTaskGroup ¶
type DeploymentTaskGroup struct { Promoted bool DesiredCanaries int DesiredTotal int PlacedAllocs int HealthyAllocs int UnhealthyAllocs int }
DeploymentTaskGroup is the task group for the deployment
type Evaluation ¶
type Evaluation struct { ID string Type string TriggeredBy string JobID string Status string StatusDescription string }
Evaluation details.
type Periodic ¶
type Periodic struct { Enabled bool ProhibitOverlap bool Spec string SpecType string TimeZone string }
Periodic is the configuration for a periodic job.
type ReadJobResponse ¶
type ReadJobResponse struct { ID string Name string Periodic Periodic TaskGroups []TaskGroup Type string }
ReadJobResponse is the returned job when reading a job.
type UpdateJobResponse ¶
UpdateJobResponse contains the state of the job that was created/updated.