Documentation
¶
Overview ¶
Package chronos provides a Client for the Chronos REST API.
Index ¶
- Constants
- type Argument
- type Client
- type Constraint
- type Container
- type EnvironmentVariable
- type Error
- type ExternalVolume
- type Fetch
- type Job
- type JobService
- func (j *JobService) Delete(job string) (bool, *http.Response, error)
- func (j *JobService) KillAllTasks(job string) (bool, *http.Response, error)
- func (j *JobService) MarkSuccess(job string) (bool, *http.Response, error)
- func (j *JobService) New(job *Job) (bool, *http.Response, error)
- func (j *JobService) Start(job string, params *JobStartParams) (bool, *http.Response, error)
- type JobStartParams
- type Jobs
- type JobsSearchParams
- type JobsService
- type NetworkInfo
- type Parameter
- type PortMapping
- type Volume
Constants ¶
const ( // ChronosAPI is a constant representing the Chronos REST API entrypoint ChronosAPI = "v1/scheduler/" // ChronosAPIJobs is a constant representing the jobs resource ChronosAPIJobs = "jobs" // ChronosAPIJobsSearch is a constant representing the search resource ChronosAPIJobsSearch = "jobs/search" // ChronosAPIJob is a constant representing the job resource ChronosAPIJob = "job/" // ChronosAPIJobTaskKill is a constant representing the task resource ChronosAPIJobTaskKill = "task/kill/" // ChronosAPIJobSuccess is a constant representing the jobs success resource ChronosAPIJobSuccess = "success/" // ChronosAPIIso8601 is a constant representing the spec for date format ChronosAPIIso8601 = "iso8601" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// Chronos API
Jobs *JobsService
Job *JobService
// contains filtered or unexported fields
}
Client is a Chronos client for making Chronos API requests
type Constraint ¶
type Constraint []string
Constraint contains a string tuple in the form ["LHS", "Comparator", "RHS"]
type Container ¶
type Container struct {
Type string `json:"type,omitempty"`
Image string `json:"image,omitempty"`
ForcePullImage bool `json:"forcePullImage, omitempty"`
Network string `json:"network,omitempty"`
NetworkName string `json:"networkName,omitempty"`
NetworkInfos []NetworkInfo `json:"networkInfos,omitempty"`
Volumes []Volume `json:"volumes,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
}
Container contains a Mesos container description
type EnvironmentVariable ¶
type EnvironmentVariable struct {
Key string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
}
EnvironmentVariable contains a single env kv pair
type ExternalVolume ¶
type ExternalVolume struct {
Name string `json:"name"`
Provider string `json:"provider,omitempty"`
Options []Parameter `json:"options,omitempty"`
}
ExternalVolume contains external volume specification
type Fetch ¶
type Fetch struct {
URI string `json:"uri,omitempty"`
Cache bool `json:"cache,omitempty"`
Extract bool `json:"extract,omitempty"`
Executable bool `json:"executable,omitempty"`
OutputFile string `json:"output_file,omitempty"`
}
Fetch contains a remote executor fetch descriptor
type Job ¶
type Job struct {
Name string `json:"name"`
Command string `json:"command"`
Shell bool `json:"shell,omitempty"`
Epsilon string `json:"epsilon,omitempty"`
Executor string `json:"executor,omitempty"`
ExecutorFlags string `json:"executorFlags,omitempty"`
Retries int `json:"retries,omitempty"`
Owner string `json:"owner,omitempty"`
OwnerName string `json:"ownerName,omitempty"`
Description string `json:"description,omitempty"`
Async bool `json:"async,omitempty"`
SuccessCount int `json:"successCount,omitempty"`
ErrorCount int `json:"errorCount,omitempty"`
LastSuccess string `json:"lastSuccess,omitempty"`
LastError string `json:"lastError,omitempty"`
CPUs float64 `json:"cpus,omitempty"`
Disk float64 `json:"disk,omitempty"`
Mem float64 `json:"mem,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Concurrent bool `json:"concurrent,omitempty"`
SoftError bool `json:"softError,omitempty"`
FetchList []Fetch `json:"fetch,omitempty"`
DataProcessingJobType bool `json:"dataProcessingJobType,omitempty"`
ErrorsSinceLastSuccess int `json:"errorsSinceLastSuccess,omitempty"`
URIs []string `json:"uris,omitempty"`
EnvironmentVariables []EnvironmentVariable `json:"environmentVariables,omitempty"`
Arguments []Argument `json:"arguments,omitempty"`
HighPriority bool `json:"highPriority,omitempty"`
RunAsUser string `json:"runAsUser,omitempty"`
Container *Container `json:"container,omitempty"`
Schedule string `json:"schedule,omitempty"`
ScheduleTimeZone string `json:"scheduleTimeZone,omitempty"`
Constraints []Constraint `json:"constraints,omitempty"`
Parents []string `json:"parents,omitempty"`
TaskInfoData string `json:"taskInfoData,omitempty"`
}
Job contains a Chronos jobs description
type JobService ¶
type JobService struct {
// contains filtered or unexported fields
}
JobService provides methods for Chronos job operations
func (*JobService) KillAllTasks ¶
KillAllTasks is killing all related tasks for a job job: is the name of the job of whoms tasks to be killed
func (*JobService) MarkSuccess ¶
MarkSuccess is marking a job as successful job: is the name of the job to mark as success
func (*JobService) Start ¶
func (j *JobService) Start(job string, params *JobStartParams) (bool, *http.Response, error)
Start is manually starting a job job: is the name of the job to start params: are the parameters of the job to start
type JobStartParams ¶
type JobStartParams struct {
Arguments Argument `url:"arguments,omitempty"`
}
JobStartParams contains the parameters to start a job
type JobsSearchParams ¶
type JobsSearchParams struct {
Name string `url:"name,omitempty"`
Command string `url:"command,omitempty"`
Any string `url:"any,omitempty"`
}
JobsSearchParams is the parameters for job search
type JobsService ¶
type JobsService struct {
// contains filtered or unexported fields
}
JobsService provices methods for Chronos jobs operations
func (*JobsService) List ¶
func (j *JobsService) List() (*[]Job, *http.Response, error)
List returns the list of jobs
func (*JobsService) Search ¶
func (j *JobsService) Search(params *JobsSearchParams) (*[]Job, *http.Response, error)
Search is searching for a job in Chronos params: are the search parameters for the job
type NetworkInfo ¶
type NetworkInfo struct {
Name string `json:"name"`
Protocol string `json:"protocol,omitempty"`
Labels []Parameter `json:"labels,omitempty"`
PortMappings []PortMapping `json:"portMappings,omitempty"`
}
NetworkInfo contains container infos to NetworkInfo
type PortMapping ¶
type PortMapping struct {
HostPort int `json:"hostPort,omitempty"`
ContainerPort int `json:"containerPort,omitempty"`
Protocol string `json:"protocol,omitempty"`
}
PortMapping contains a port map and protocol specifications