Documentation
¶
Index ¶
- Constants
- type Client
- type Config
- type Jobs
- func (j *Jobs) Delete(jobName string, purge, global bool) (*openapi.JobDeregisterResponse, *WriteMeta, error)
- func (j *Jobs) Deployment(jobName string) (*openapi.Deployment, *QueryMeta, error)
- func (j *Jobs) Deployments(jobName string) (*[]openapi.Deployment, *QueryMeta, error)
- func (j *Jobs) Dispatch(jobName string, payload string, meta map[string]string) (*openapi.JobDispatchResponse, *WriteMeta, error)
- func (j *Jobs) EnforceRegister(job *openapi.Job, modifyIndex uint64) (*openapi.JobRegisterResponse, *WriteMeta, error)
- func (j *Jobs) Evaluate(jobName string, forceReschedule bool) (*openapi.JobRegisterResponse, *WriteMeta, error)
- func (j *Jobs) GetJob(jobName string) (*openapi.Job, *QueryMeta, error)
- func (j *Jobs) GetJobs() ([]openapi.JobListStub, *QueryMeta, error)
- func (j *Jobs) GetLocation(job *openapi.Job) (*time.Location, error)
- func (j *Jobs) IsMultiRegion(job *openapi.Job) bool
- func (j *Jobs) IsParameterized(job *openapi.Job) bool
- func (j *Jobs) IsPeriodic(job *openapi.Job) bool
- func (j *Jobs) JobsApi() *openapi.JobsApiService
- func (j *Jobs) Next(p *openapi.PeriodicConfig, fromTime time.Time) (time.Time, error)
- func (j *Jobs) Parse(hcl string, canonicalize, hclV1 bool) (*openapi.Job, error)
- func (j *Jobs) PeriodicForce(jobName string) (*openapi.PeriodicForceResponse, *WriteMeta, error)
- func (j *Jobs) Plan(job *openapi.Job, diff bool) (*openapi.JobPlanResponse, *WriteMeta, error)
- func (j *Jobs) PlanOpts(job *openapi.Job, opts *PlanOpts) (*openapi.JobPlanResponse, *WriteMeta, error)
- func (j *Jobs) Post(job *openapi.Job) (*openapi.JobRegisterResponse, *WriteMeta, error)
- func (j *Jobs) Register(job *openapi.Job, registerOpts *RegisterOpts) (*openapi.JobRegisterResponse, *WriteMeta, error)
- func (j *Jobs) Revert(jobName string, versionNumber, enforcePriorVersion int32, ...) (*openapi.JobRegisterResponse, *WriteMeta, error)
- func (j *Jobs) Scale(jobName string, count int64, msg string, target map[string]string) (*openapi.JobRegisterResponse, *WriteMeta, error)
- func (j *Jobs) ScaleStatus(jobName string) (*openapi.JobScaleStatusResponse, *QueryMeta, error)
- func (j *Jobs) Stability(jobName string, versionNumber int32, stable bool) (*openapi.JobStabilityResponse, *WriteMeta, error)
- func (j *Jobs) Summary(jobName string) (*openapi.JobSummary, *QueryMeta, error)
- func (j *Jobs) Versions(jobName string, withDiffs bool) (*openapi.JobVersionsResponse, *QueryMeta, error)
- type PlanOpts
- type QueryMeta
- type QueryOpts
- type RegisterOpts
- type WriteMeta
- type WriteOpts
Constants ¶
View Source
const ( // JobTypeService indicates a long-running processes JobTypeService = "service" // JobTypeBatch indicates a short-lived process JobTypeBatch = "batch" // JobTypeSystem indicates a system process that should run on all clients JobTypeSystem = "system" // PeriodicSpecCron is used for a cron spec. PeriodicSpecCron = "cron" // DefaultNamespace is the default namespace. DefaultNamespace = "default" // GlobalRegion is a sentinel region value dor Job configuration // that users may specify to indicate the job should be run on // the region of the node that the job was submitted to. // For Client configuration, if no region information is given, // the client node will default to be part of the GlobalRegion. GlobalRegion = "global" // RegisterEnforceIndexErrPrefix is the prefix to use in errors caused by // enforcing the job modify index during registers. RegisterEnforceIndexErrPrefix = "Enforcing job modify index" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Jobs ¶
type Jobs struct {
// contains filtered or unexported fields
}
Jobs encapsulates and extends the generated JobsApiService with convenience methods.
func (*Jobs) Deployment ¶
func (*Jobs) Deployments ¶
func (*Jobs) EnforceRegister ¶
func (*Jobs) JobsApi ¶
func (j *Jobs) JobsApi() *openapi.JobsApiService
func (*Jobs) Next ¶
Next returns the closest time instant matching the spec that is after the passed time. If no matching instance exists, the zero value of time.Time is returned. The `time.Location` of the returned value matches that of the passed time.
func (*Jobs) PeriodicForce ¶
func (*Jobs) Register ¶
func (j *Jobs) Register(job *openapi.Job, registerOpts *RegisterOpts) (*openapi.JobRegisterResponse, *WriteMeta, error)
func (*Jobs) ScaleStatus ¶
type QueryMeta ¶
type QueryMeta struct { // LastIndex can be used as a Index to perform // a blocking query LastIndex uint64 // LastContact is the time of last contact from the leader for the // server servicing the request LastContact time.Duration // KnownLeader indicates if there is a known leader KnownLeader bool // RequestTime is how long did the request took RequestTime time.Duration }
QueryMeta is used to return metadata about a query
type QueryOpts ¶
type QueryOpts struct { // Providing a datacenter overwrites the region provided // by the Config Region string // Namespace is the target namespace for the query. Namespace string // AllowStale allows any Nomad server (non-leader) to service // a read. This allows for lower latency and higher throughput AllowStale bool // WaitIndex is used to enable a blocking query. Waits // until the timeout or the next index is reached WaitIndex uint64 // WaitTime is used to bound the duration of a wait. // Defaults to that of the Config, but can be overridden. WaitTime time.Duration // If set, used as prefix for resource list searches Prefix string // Set HTTP parameters on the query. Params map[string]string // AuthToken is the secret ID of an ACL token AuthToken string // PerPage is the number of entries to be returned in queries that support // paginated lists. PerPage int32 // NextToken is the token used indicate where to start paging for queries // that support paginated lists. NextToken string // contains filtered or unexported fields }
QueryOpts are used to parametrize a query
type RegisterOpts ¶
type WriteMeta ¶
type WriteMeta struct { // LastIndex can be used as a Index to perform // a blocking query LastIndex uint64 // RequestTime is how long did the request took RequestTime time.Duration }
WriteMeta is used to return metadata about a write operation
type WriteOpts ¶
type WriteOpts struct { // Providing a datacenter overwrites the region provided // by the Config Region string // Namespace is the target namespace for the operation. Namespace string // AuthToken is the secret ID of an ACL token AuthToken string // IdempotencyToken can be used to ensure the operation is idempotent. IdempotencyToken string // contains filtered or unexported fields }
WriteOpts are used to parametrize a write operation
Click to show internal directories.
Click to hide internal directories.