scheduler

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package scheduler contains the main API of Scheduler service.

Package scheduler is a generated protocol buffer package.

It is generated from these files:

github.com/luci/luci-go/scheduler/api/scheduler/v1/scheduler.proto

It has these top-level messages:

JobsRequest
JobsReply
InvocationsRequest
InvocationsReply
JobRef
InvocationRef
Job
JobState
Invocation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileDescriptorSet

func FileDescriptorSet() *descriptor.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterSchedulerServer

func RegisterSchedulerServer(s prpc.Registrar, srv SchedulerServer)

Types

type Invocation

type Invocation struct {
	InvocationRef *InvocationRef `protobuf:"bytes,1,opt,name=invocation_ref,json=invocationRef" json:"invocation_ref,omitempty"`
	// start_ts is unix timestamp in microseconds.
	StartedTs int64 `protobuf:"varint,2,opt,name=started_ts,json=startedTs" json:"started_ts,omitempty"`
	// finished_ts is unix timestamp in microseconds. Set only if final is true.
	FinishedTs int64 `protobuf:"varint,3,opt,name=finished_ts,json=finishedTs" json:"finished_ts,omitempty"`
	// triggered_by is an identity ("kind:value") which is specified only if
	// invocation was triggered by not the scheduler service itself.
	TriggeredBy string `protobuf:"bytes,4,opt,name=triggered_by,json=triggeredBy" json:"triggered_by,omitempty"`
	// Latest status of a job.
	Status string `protobuf:"bytes,5,opt,name=status" json:"status,omitempty"`
	// If true, this invocation properties are final and won't be changed.
	Final bool `protobuf:"varint,6,opt,name=final" json:"final,omitempty"`
	// config_revision pins project/job config version according to which this
	// invocation was created.
	ConfigRevision string `protobuf:"bytes,7,opt,name=config_revision,json=configRevision" json:"config_revision,omitempty"`
	// view_url points to human readable page for a given invocation if available.
	ViewUrl string `protobuf:"bytes,8,opt,name=view_url,json=viewUrl" json:"view_url,omitempty"`
}

Invocation describes properties of one job execution.

func (*Invocation) Descriptor

func (*Invocation) Descriptor() ([]byte, []int)

func (*Invocation) GetConfigRevision

func (m *Invocation) GetConfigRevision() string

func (*Invocation) GetFinal

func (m *Invocation) GetFinal() bool

func (*Invocation) GetFinishedTs

func (m *Invocation) GetFinishedTs() int64

func (*Invocation) GetInvocationRef

func (m *Invocation) GetInvocationRef() *InvocationRef

func (*Invocation) GetStartedTs

func (m *Invocation) GetStartedTs() int64

func (*Invocation) GetStatus

func (m *Invocation) GetStatus() string

func (*Invocation) GetTriggeredBy

func (m *Invocation) GetTriggeredBy() string

func (*Invocation) GetViewUrl

func (m *Invocation) GetViewUrl() string

func (*Invocation) ProtoMessage

func (*Invocation) ProtoMessage()

func (*Invocation) Reset

func (m *Invocation) Reset()

func (*Invocation) String

func (m *Invocation) String() string

type InvocationRef

type InvocationRef struct {
	JobRef *JobRef `protobuf:"bytes,1,opt,name=job_ref,json=jobRef" json:"job_ref,omitempty"`
	// invocation_id is a unique integer among all invocations for a given job.
	// However, there could be invocations with the same invocation_id but
	// belonging to different jobs.
	InvocationId int64 `protobuf:"varint,2,opt,name=invocation_id,json=invocationId" json:"invocation_id,omitempty"`
}

InvocationRef uniquely identifies an invocation of a job.

func (*InvocationRef) Descriptor

func (*InvocationRef) Descriptor() ([]byte, []int)

func (*InvocationRef) GetInvocationId

func (m *InvocationRef) GetInvocationId() int64

func (*InvocationRef) GetJobRef

func (m *InvocationRef) GetJobRef() *JobRef

func (*InvocationRef) ProtoMessage

func (*InvocationRef) ProtoMessage()

func (*InvocationRef) Reset

func (m *InvocationRef) Reset()

func (*InvocationRef) String

func (m *InvocationRef) String() string

type InvocationsReply

type InvocationsReply struct {
	Invocations []*Invocation `protobuf:"bytes,1,rep,name=invocations" json:"invocations,omitempty"`
	NextCursor  string        `protobuf:"bytes,2,opt,name=next_cursor,json=nextCursor" json:"next_cursor,omitempty"`
}

func (*InvocationsReply) Descriptor

func (*InvocationsReply) Descriptor() ([]byte, []int)

func (*InvocationsReply) GetInvocations

func (m *InvocationsReply) GetInvocations() []*Invocation

func (*InvocationsReply) GetNextCursor

func (m *InvocationsReply) GetNextCursor() string

func (*InvocationsReply) ProtoMessage

func (*InvocationsReply) ProtoMessage()

func (*InvocationsReply) Reset

func (m *InvocationsReply) Reset()

func (*InvocationsReply) String

func (m *InvocationsReply) String() string

type InvocationsRequest

type InvocationsRequest struct {
	JobRef *JobRef `protobuf:"bytes,1,opt,name=job_ref,json=jobRef" json:"job_ref,omitempty"`
	Cursor string  `protobuf:"bytes,2,opt,name=cursor" json:"cursor,omitempty"`
	// page_size defaults to 50 which is maximum.
	PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"`
}

func (*InvocationsRequest) Descriptor

func (*InvocationsRequest) Descriptor() ([]byte, []int)

func (*InvocationsRequest) GetCursor

func (m *InvocationsRequest) GetCursor() string

func (*InvocationsRequest) GetJobRef

func (m *InvocationsRequest) GetJobRef() *JobRef

func (*InvocationsRequest) GetPageSize

func (m *InvocationsRequest) GetPageSize() int32

func (*InvocationsRequest) ProtoMessage

func (*InvocationsRequest) ProtoMessage()

func (*InvocationsRequest) Reset

func (m *InvocationsRequest) Reset()

func (*InvocationsRequest) String

func (m *InvocationsRequest) String() string

type Job

type Job struct {
	JobRef   *JobRef   `protobuf:"bytes,1,opt,name=job_ref,json=jobRef" json:"job_ref,omitempty"`
	Schedule string    `protobuf:"bytes,2,opt,name=schedule" json:"schedule,omitempty"`
	State    *JobState `protobuf:"bytes,3,opt,name=state" json:"state,omitempty"`
	Paused   bool      `protobuf:"varint,4,opt,name=paused" json:"paused,omitempty"`
}

Job descibes currently configured job.

func (*Job) Descriptor

func (*Job) Descriptor() ([]byte, []int)

func (*Job) GetJobRef

func (m *Job) GetJobRef() *JobRef

func (*Job) GetPaused

func (m *Job) GetPaused() bool

func (*Job) GetSchedule

func (m *Job) GetSchedule() string

func (*Job) GetState

func (m *Job) GetState() *JobState

func (*Job) ProtoMessage

func (*Job) ProtoMessage()

func (*Job) Reset

func (m *Job) Reset()

func (*Job) String

func (m *Job) String() string

type JobRef

type JobRef struct {
	Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"`
	Job     string `protobuf:"bytes,2,opt,name=job" json:"job,omitempty"`
}

JobRef uniquely identifies a job.

func (*JobRef) Descriptor

func (*JobRef) Descriptor() ([]byte, []int)

func (*JobRef) GetJob

func (m *JobRef) GetJob() string

func (*JobRef) GetProject

func (m *JobRef) GetProject() string

func (*JobRef) ProtoMessage

func (*JobRef) ProtoMessage()

func (*JobRef) Reset

func (m *JobRef) Reset()

func (*JobRef) String

func (m *JobRef) String() string

type JobState

type JobState struct {
	UiStatus string `protobuf:"bytes,1,opt,name=ui_status,json=uiStatus" json:"ui_status,omitempty"`
}

JobState describes current Job state as one of these strings:

"DISABLED"
"OVERRUN"
"PAUSED"
"RETRYING"
"RUNNING"
"SCHEDULED"
"STARTING"
"SUSPENDED"
"WAITING"

func (*JobState) Descriptor

func (*JobState) Descriptor() ([]byte, []int)

func (*JobState) GetUiStatus

func (m *JobState) GetUiStatus() string

func (*JobState) ProtoMessage

func (*JobState) ProtoMessage()

func (*JobState) Reset

func (m *JobState) Reset()

func (*JobState) String

func (m *JobState) String() string

type JobsReply

type JobsReply struct {
	Jobs       []*Job `protobuf:"bytes,1,rep,name=jobs" json:"jobs,omitempty"`
	NextCursor string `protobuf:"bytes,2,opt,name=next_cursor,json=nextCursor" json:"next_cursor,omitempty"`
}

func (*JobsReply) Descriptor

func (*JobsReply) Descriptor() ([]byte, []int)

func (*JobsReply) GetJobs

func (m *JobsReply) GetJobs() []*Job

func (*JobsReply) GetNextCursor

func (m *JobsReply) GetNextCursor() string

func (*JobsReply) ProtoMessage

func (*JobsReply) ProtoMessage()

func (*JobsReply) Reset

func (m *JobsReply) Reset()

func (*JobsReply) String

func (m *JobsReply) String() string

type JobsRequest

type JobsRequest struct {
	// If not specified or "", all projects' jobs are returned.
	Project string `protobuf:"bytes,1,opt,name=project" json:"project,omitempty"`
	Cursor  string `protobuf:"bytes,2,opt,name=cursor" json:"cursor,omitempty"`
	// page_size is currently not implemented and is ignored.
	PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"`
}

func (*JobsRequest) Descriptor

func (*JobsRequest) Descriptor() ([]byte, []int)

func (*JobsRequest) GetCursor

func (m *JobsRequest) GetCursor() string

func (*JobsRequest) GetPageSize

func (m *JobsRequest) GetPageSize() int32

func (*JobsRequest) GetProject

func (m *JobsRequest) GetProject() string

func (*JobsRequest) ProtoMessage

func (*JobsRequest) ProtoMessage()

func (*JobsRequest) Reset

func (m *JobsRequest) Reset()

func (*JobsRequest) String

func (m *JobsRequest) String() string

type SchedulerClient

type SchedulerClient interface {
	// GetJobs fetches all jobs satisfying JobsRequest and visibility ACLs.
	// If JobsRequest.project is specified but the project doesn't exist, empty
	// list of Jobs is returned.
	GetJobs(ctx context.Context, in *JobsRequest, opts ...grpc.CallOption) (*JobsReply, error)
	// GetInvocations fetches invocations of a given job, most recent first.
	GetInvocations(ctx context.Context, in *InvocationsRequest, opts ...grpc.CallOption) (*InvocationsReply, error)
	// PauseJob will prevent automatic triggering of a job. Manual triggering such
	// as through this API is still allowed. Any pending or running invocations
	// are still executed. PauseJob does nothing if job is already paused.
	//
	// Requires OWNER Job permission.
	PauseJob(ctx context.Context, in *JobRef, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// ResumeJob resumes paused job. ResumeJob does nothing if job is not paused.
	//
	// Requires OWNER Job permission.
	ResumeJob(ctx context.Context, in *JobRef, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// AbortJob resets the job to scheduled state, aborting a currently pending or
	// running invocation if any.
	//
	// Note, that this is similar to AbortInvocation except that AbortInvocation
	// requires invocation ID and doesn't ensure that the invocation aborted is
	// actually latest triggered for the job.
	//
	// Requires OWNER Job permission.
	AbortJob(ctx context.Context, in *JobRef, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// AbortInvocation aborts a given job invocation.
	// If an invocation is final, AbortInvocation does nothing.
	//
	// If you want to abort a specific hung invocation, use this request instead
	// of AbortJob.
	//
	// Requires OWNER Job permission.
	AbortInvocation(ctx context.Context, in *InvocationRef, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
}

func NewSchedulerClient

func NewSchedulerClient(cc *grpc.ClientConn) SchedulerClient

func NewSchedulerPRPCClient

func NewSchedulerPRPCClient(client *prpc.Client) SchedulerClient

type SchedulerServer

type SchedulerServer interface {
	// GetJobs fetches all jobs satisfying JobsRequest and visibility ACLs.
	// If JobsRequest.project is specified but the project doesn't exist, empty
	// list of Jobs is returned.
	GetJobs(context.Context, *JobsRequest) (*JobsReply, error)
	// GetInvocations fetches invocations of a given job, most recent first.
	GetInvocations(context.Context, *InvocationsRequest) (*InvocationsReply, error)
	// PauseJob will prevent automatic triggering of a job. Manual triggering such
	// as through this API is still allowed. Any pending or running invocations
	// are still executed. PauseJob does nothing if job is already paused.
	//
	// Requires OWNER Job permission.
	PauseJob(context.Context, *JobRef) (*google_protobuf.Empty, error)
	// ResumeJob resumes paused job. ResumeJob does nothing if job is not paused.
	//
	// Requires OWNER Job permission.
	ResumeJob(context.Context, *JobRef) (*google_protobuf.Empty, error)
	// AbortJob resets the job to scheduled state, aborting a currently pending or
	// running invocation if any.
	//
	// Note, that this is similar to AbortInvocation except that AbortInvocation
	// requires invocation ID and doesn't ensure that the invocation aborted is
	// actually latest triggered for the job.
	//
	// Requires OWNER Job permission.
	AbortJob(context.Context, *JobRef) (*google_protobuf.Empty, error)
	// AbortInvocation aborts a given job invocation.
	// If an invocation is final, AbortInvocation does nothing.
	//
	// If you want to abort a specific hung invocation, use this request instead
	// of AbortJob.
	//
	// Requires OWNER Job permission.
	AbortInvocation(context.Context, *InvocationRef) (*google_protobuf.Empty, error)
}

Jump to

Keyboard shortcuts

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