nomad

package
v0.0.0-...-2eb1f2f Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocationFSClient

type AllocationFSClient interface {
	Logs(
		alloc *api.Allocation,
		follow bool,
		task string,
		logType string,
		origin string,
		offset int64,
		cancel <-chan struct{},
		query *api.QueryOptions) (<-chan *api.StreamFrame, <-chan error)
}

type NamespaceClient

type NamespaceClient interface {
	List(*api.QueryOptions) ([]*api.Namespace, *api.QueryMeta, error)
}

type NodePoolsClient

type NodePoolsClient interface {
	List(*api.QueryOptions) ([]*api.NodePool, *api.QueryMeta, error)
	Info(string, *api.QueryOptions) (*api.NodePool, *api.QueryMeta, error)
	ListJobs(string, *api.QueryOptions) ([]*api.JobListStub, *api.QueryMeta, error)
	ListNodes(string, *api.QueryOptions) ([]*api.NodeListStub, *api.QueryMeta, error)
}

type NodesClient

type NodesClient interface {
	List(*api.QueryOptions) ([]*api.NodeListStub, *api.QueryMeta, error)
	Allocations(string, *api.QueryOptions) ([]*api.Allocation, *api.QueryMeta, error)
}

type Nomad

type Nomad struct {
	Client             *api.Client
	RegionClient       RegionClient
	NamespaceClient    NamespaceClient
	JobClient          JobClient
	AllocationClient   AllocationClient
	AllocationFSClient AllocationFSClient
	NodePoolsClient    NodePoolsClient
	NodesClient        NodesClient
	Namespace          string
	Logger             *utils.Logger
}

func New

func New(logger *utils.Logger) (*Nomad, error)

func (*Nomad) AllocationEvents

func (n *Nomad) AllocationEvents(allocation *api.AllocationListStub) ([]models.Events, string)

func (*Nomad) AllocationStats

func (n *Nomad) AllocationStats(params *models.NomadParams, allocation *api.Allocation) (models.AllocationStats, error)

func (*Nomad) AllocationTask

func (n *Nomad) AllocationTask(params *models.NomadParams, allocationId string) ([]models.Tasks, error)

func (*Nomad) Allocations

func (n *Nomad) Allocations(allocName string, params *models.NomadParams) ([]models.Allocations, error)

func (*Nomad) Deregister

func (n *Nomad) Deregister(jobId string, purge bool, params *models.NomadParams) error

Deregister job

func (*Nomad) DryRun

func (n *Nomad) DryRun(jobHcl string) (*api.Job, error)

DryRun Job HCL

func (*Nomad) GetAllocCounts

func (n *Nomad) GetAllocCounts(nodeId string, params *models.NomadParams) int

func (*Nomad) GetJob

func (n *Nomad) GetJob(jobId string) (*api.Job, error)

func (*Nomad) Jobs

func (n *Nomad) Jobs(params *models.NomadParams) ([]models.Jobs, error)

Get jobs list

func (*Nomad) Logs

func (n *Nomad) Logs(allocID, taskName, logType, origin string, follow bool, offset int64, cancel <-chan struct{}) (<-chan *api.StreamFrame, <-chan error)

func (*Nomad) Namespaces

func (n *Nomad) Namespaces() ([]models.Namespaces, error)

func (*Nomad) NodeList

func (n *Nomad) NodeList(params *models.NomadParams) ([]models.Nodes, error)

func (*Nomad) NodePoolList

func (n *Nomad) NodePoolList(params *models.NomadParams) ([]models.NodePools, error)

func (*Nomad) Regions

func (n *Nomad) Regions() ([]models.Regions, error)

func (*Nomad) Register

func (n *Nomad) Register(job *api.Job, params *models.NomadParams) error

Register Job

func (*Nomad) Restart

func (n *Nomad) Restart(allocId, taskName string, params *models.NomadParams) error

func (*Nomad) Revert

func (n *Nomad) Revert(jobId string, version uint64, params *models.NomadParams) error

Revert job by version

func (*Nomad) Submission

func (n *Nomad) Submission(jobId, version string, params *models.NomadParams) (*api.JobSubmission, error)

Get Definitionn of Job(.hcl source file)

func (*Nomad) TaskGroups

func (n *Nomad) TaskGroups(jobId, region, namespace string) ([]models.TaskGroups, error)

Get TaskGroup list by jobId

func (*Nomad) Versions

func (n *Nomad) Versions(jobId string, params *models.NomadParams) ([]models.JobVersion, []models.JobVersionDiff, error)

Get versions List by jobId

type RegionClient

type RegionClient interface {
	List() ([]string, error)
}

Jump to

Keyboard shortcuts

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