Documentation ¶
Overview ¶
Package scheduler contains the main API of Scheduler service.
Index ¶
- Constants
- Variables
- func FileDescriptorSet() *descriptorpb.FileDescriptorSet
- func RegisterSchedulerServer(s grpc.ServiceRegistrar, srv SchedulerServer)
- type BuildbucketTrigger
- func (*BuildbucketTrigger) Descriptor() ([]byte, []int)deprecated
- func (x *BuildbucketTrigger) GetProperties() *structpb.Struct
- func (x *BuildbucketTrigger) GetTags() []string
- func (*BuildbucketTrigger) ProtoMessage()
- func (x *BuildbucketTrigger) ProtoReflect() protoreflect.Message
- func (x *BuildbucketTrigger) Reset()
- func (x *BuildbucketTrigger) String() string
- type CronTrigger
- type EmitTriggersRequest
- func (*EmitTriggersRequest) Descriptor() ([]byte, []int)deprecated
- func (x *EmitTriggersRequest) GetBatches() []*EmitTriggersRequest_Batch
- func (x *EmitTriggersRequest) GetTimestamp() int64
- func (*EmitTriggersRequest) ProtoMessage()
- func (x *EmitTriggersRequest) ProtoReflect() protoreflect.Message
- func (x *EmitTriggersRequest) Reset()
- func (x *EmitTriggersRequest) String() string
- type EmitTriggersRequest_Batch
- func (*EmitTriggersRequest_Batch) Descriptor() ([]byte, []int)deprecated
- func (x *EmitTriggersRequest_Batch) GetJobs() []*JobRef
- func (x *EmitTriggersRequest_Batch) GetTrigger() *Trigger
- func (*EmitTriggersRequest_Batch) ProtoMessage()
- func (x *EmitTriggersRequest_Batch) ProtoReflect() protoreflect.Message
- func (x *EmitTriggersRequest_Batch) Reset()
- func (x *EmitTriggersRequest_Batch) String() string
- type GitilesTrigger
- func (*GitilesTrigger) Descriptor() ([]byte, []int)deprecated
- func (x *GitilesTrigger) GetProperties() *structpb.Struct
- func (x *GitilesTrigger) GetRef() string
- func (x *GitilesTrigger) GetRepo() string
- func (x *GitilesTrigger) GetRevision() string
- func (x *GitilesTrigger) GetTags() []string
- func (*GitilesTrigger) ProtoMessage()
- func (x *GitilesTrigger) ProtoReflect() protoreflect.Message
- func (x *GitilesTrigger) Reset()
- func (x *GitilesTrigger) String() string
- type Invocation
- func (*Invocation) Descriptor() ([]byte, []int)deprecated
- func (x *Invocation) GetConfigRevision() string
- func (x *Invocation) GetFinal() bool
- func (x *Invocation) GetFinishedTs() int64
- func (x *Invocation) GetInvocationRef() *InvocationRef
- func (x *Invocation) GetStartedTs() int64
- func (x *Invocation) GetStatus() string
- func (x *Invocation) GetTriggeredBy() string
- func (x *Invocation) GetViewUrl() string
- func (*Invocation) ProtoMessage()
- func (x *Invocation) ProtoReflect() protoreflect.Message
- func (x *Invocation) Reset()
- func (x *Invocation) String() string
- type InvocationRef
- func (*InvocationRef) Descriptor() ([]byte, []int)deprecated
- func (x *InvocationRef) GetInvocationId() int64
- func (x *InvocationRef) GetJobRef() *JobRef
- func (*InvocationRef) ProtoMessage()
- func (x *InvocationRef) ProtoReflect() protoreflect.Message
- func (x *InvocationRef) Reset()
- func (x *InvocationRef) String() string
- type InvocationsReply
- func (*InvocationsReply) Descriptor() ([]byte, []int)deprecated
- func (x *InvocationsReply) GetInvocations() []*Invocation
- func (x *InvocationsReply) GetNextCursor() string
- func (*InvocationsReply) ProtoMessage()
- func (x *InvocationsReply) ProtoReflect() protoreflect.Message
- func (x *InvocationsReply) Reset()
- func (x *InvocationsReply) String() string
- type InvocationsRequest
- func (*InvocationsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *InvocationsRequest) GetCursor() string
- func (x *InvocationsRequest) GetJobRef() *JobRef
- func (x *InvocationsRequest) GetPageSize() int32
- func (*InvocationsRequest) ProtoMessage()
- func (x *InvocationsRequest) ProtoReflect() protoreflect.Message
- func (x *InvocationsRequest) Reset()
- func (x *InvocationsRequest) String() string
- type Job
- func (*Job) Descriptor() ([]byte, []int)deprecated
- func (x *Job) GetJobRef() *JobRef
- func (x *Job) GetPaused() bool
- func (x *Job) GetSchedule() string
- func (x *Job) GetState() *JobState
- func (*Job) ProtoMessage()
- func (x *Job) ProtoReflect() protoreflect.Message
- func (x *Job) Reset()
- func (x *Job) String() string
- type JobRef
- type JobState
- type JobsReply
- type JobsRequest
- func (*JobsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *JobsRequest) GetCursor() string
- func (x *JobsRequest) GetPageSize() int32
- func (x *JobsRequest) GetProject() string
- func (*JobsRequest) ProtoMessage()
- func (x *JobsRequest) ProtoReflect() protoreflect.Message
- func (x *JobsRequest) Reset()
- func (x *JobsRequest) String() string
- type NoopTrigger
- type SchedulerClient
- type SchedulerServer
- type Trigger
- func (*Trigger) Descriptor() ([]byte, []int)deprecated
- func (x *Trigger) GetBuildbucket() *BuildbucketTrigger
- func (x *Trigger) GetCron() *CronTrigger
- func (x *Trigger) GetGitiles() *GitilesTrigger
- func (x *Trigger) GetId() string
- func (x *Trigger) GetNoop() *NoopTrigger
- func (m *Trigger) GetPayload() isTrigger_Payload
- func (x *Trigger) GetTitle() string
- func (x *Trigger) GetUrl() string
- func (x *Trigger) GetWebui() *WebUITrigger
- func (*Trigger) ProtoMessage()
- func (x *Trigger) ProtoReflect() protoreflect.Message
- func (x *Trigger) Reset()
- func (x *Trigger) String() string
- type Trigger_Buildbucket
- type Trigger_Cron
- type Trigger_Gitiles
- type Trigger_Noop
- type Trigger_Webui
- type UnimplementedSchedulerServer
- func (UnimplementedSchedulerServer) AbortInvocation(context.Context, *InvocationRef) (*emptypb.Empty, error)
- func (UnimplementedSchedulerServer) AbortJob(context.Context, *JobRef) (*emptypb.Empty, error)
- func (UnimplementedSchedulerServer) EmitTriggers(context.Context, *EmitTriggersRequest) (*emptypb.Empty, error)
- func (UnimplementedSchedulerServer) GetInvocation(context.Context, *InvocationRef) (*Invocation, error)
- func (UnimplementedSchedulerServer) GetInvocations(context.Context, *InvocationsRequest) (*InvocationsReply, error)
- func (UnimplementedSchedulerServer) GetJobs(context.Context, *JobsRequest) (*JobsReply, error)
- func (UnimplementedSchedulerServer) PauseJob(context.Context, *JobRef) (*emptypb.Empty, error)
- func (UnimplementedSchedulerServer) ResumeJob(context.Context, *JobRef) (*emptypb.Empty, error)
- type UnsafeSchedulerServer
- type WebUITrigger
Constants ¶
const ( Scheduler_GetJobs_FullMethodName = "/scheduler.Scheduler/GetJobs" Scheduler_GetInvocations_FullMethodName = "/scheduler.Scheduler/GetInvocations" Scheduler_GetInvocation_FullMethodName = "/scheduler.Scheduler/GetInvocation" Scheduler_PauseJob_FullMethodName = "/scheduler.Scheduler/PauseJob" Scheduler_ResumeJob_FullMethodName = "/scheduler.Scheduler/ResumeJob" Scheduler_AbortJob_FullMethodName = "/scheduler.Scheduler/AbortJob" Scheduler_AbortInvocation_FullMethodName = "/scheduler.Scheduler/AbortInvocation" Scheduler_EmitTriggers_FullMethodName = "/scheduler.Scheduler/EmitTriggers" )
Variables ¶
var File_go_chromium_org_luci_scheduler_api_scheduler_v1_scheduler_proto protoreflect.FileDescriptor
var File_go_chromium_org_luci_scheduler_api_scheduler_v1_triggers_proto protoreflect.FileDescriptor
var Scheduler_ServiceDesc = grpc.ServiceDesc{ ServiceName: "scheduler.Scheduler", HandlerType: (*SchedulerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetJobs", Handler: _Scheduler_GetJobs_Handler, }, { MethodName: "GetInvocations", Handler: _Scheduler_GetInvocations_Handler, }, { MethodName: "GetInvocation", Handler: _Scheduler_GetInvocation_Handler, }, { MethodName: "PauseJob", Handler: _Scheduler_PauseJob_Handler, }, { MethodName: "ResumeJob", Handler: _Scheduler_ResumeJob_Handler, }, { MethodName: "AbortJob", Handler: _Scheduler_AbortJob_Handler, }, { MethodName: "AbortInvocation", Handler: _Scheduler_AbortInvocation_Handler, }, { MethodName: "EmitTriggers", Handler: _Scheduler_EmitTriggers_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "go.chromium.org/luci/scheduler/api/scheduler/v1/scheduler.proto", }
Scheduler_ServiceDesc is the grpc.ServiceDesc for Scheduler service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func FileDescriptorSet ¶
func FileDescriptorSet() *descriptorpb.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 grpc.ServiceRegistrar, srv SchedulerServer)
Types ¶
type BuildbucketTrigger ¶
type BuildbucketTrigger struct { Properties *structpb.Struct `protobuf:"bytes,1,opt,name=properties,proto3" json:"properties,omitempty"` Tags []string `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty"` // contains filtered or unexported fields }
BuildbucketTrigger is emitted by sources that request a general build and consumed by Buildbucket tasks.
The trigger contains information to pass to the new Buildbucket build.
Note: what builds to trigger is specified separately, either in the job configuration (when one job triggers another) or via the API request parameters (when triggering through public API).
func (*BuildbucketTrigger) Descriptor
deprecated
func (*BuildbucketTrigger) Descriptor() ([]byte, []int)
Deprecated: Use BuildbucketTrigger.ProtoReflect.Descriptor instead.
func (*BuildbucketTrigger) GetProperties ¶
func (x *BuildbucketTrigger) GetProperties() *structpb.Struct
func (*BuildbucketTrigger) GetTags ¶
func (x *BuildbucketTrigger) GetTags() []string
func (*BuildbucketTrigger) ProtoMessage ¶
func (*BuildbucketTrigger) ProtoMessage()
func (*BuildbucketTrigger) ProtoReflect ¶
func (x *BuildbucketTrigger) ProtoReflect() protoreflect.Message
func (*BuildbucketTrigger) Reset ¶
func (x *BuildbucketTrigger) Reset()
func (*BuildbucketTrigger) String ¶
func (x *BuildbucketTrigger) String() string
type CronTrigger ¶
type CronTrigger struct { Generation int64 `protobuf:"varint,1,opt,name=generation,proto3" json:"generation,omitempty"` // monotonically increasing number // contains filtered or unexported fields }
CronTrigger is used internally by Scheduler to implement periodic jobs.
It is emitted by the cron state machines whenever it decides the scheduler should launch the invocation.
Note: such triggers can't be scheduled through external Scheduler API. They may appear in the API responses though.
func (*CronTrigger) Descriptor
deprecated
func (*CronTrigger) Descriptor() ([]byte, []int)
Deprecated: Use CronTrigger.ProtoReflect.Descriptor instead.
func (*CronTrigger) GetGeneration ¶
func (x *CronTrigger) GetGeneration() int64
func (*CronTrigger) ProtoMessage ¶
func (*CronTrigger) ProtoMessage()
func (*CronTrigger) ProtoReflect ¶
func (x *CronTrigger) ProtoReflect() protoreflect.Message
func (*CronTrigger) Reset ¶
func (x *CronTrigger) Reset()
func (*CronTrigger) String ¶
func (x *CronTrigger) String() string
type EmitTriggersRequest ¶
type EmitTriggersRequest struct { // A trigger and jobs it should be delivered to. // // Order is important. Triggers that are listed earlier are considered older. Batches []*EmitTriggersRequest_Batch `protobuf:"bytes,1,rep,name=batches,proto3" json:"batches,omitempty"` // An optional timestamp to use as trigger creation time, as unix timestamp in // microseconds. Assigned by the server by default. If given, must be within // +-15 min of the current time. // // Under some conditions triggers are ordered by timestamp of when they are // created. By allowing the client to specify this timestamp, we make // EmitTrigger RPC idempotent: if EmitTrigger call fails midway, the caller // can retry it providing exact same timestamp to get the correct final order // of the triggers. Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
func (*EmitTriggersRequest) Descriptor
deprecated
func (*EmitTriggersRequest) Descriptor() ([]byte, []int)
Deprecated: Use EmitTriggersRequest.ProtoReflect.Descriptor instead.
func (*EmitTriggersRequest) GetBatches ¶
func (x *EmitTriggersRequest) GetBatches() []*EmitTriggersRequest_Batch
func (*EmitTriggersRequest) GetTimestamp ¶
func (x *EmitTriggersRequest) GetTimestamp() int64
func (*EmitTriggersRequest) ProtoMessage ¶
func (*EmitTriggersRequest) ProtoMessage()
func (*EmitTriggersRequest) ProtoReflect ¶
func (x *EmitTriggersRequest) ProtoReflect() protoreflect.Message
func (*EmitTriggersRequest) Reset ¶
func (x *EmitTriggersRequest) Reset()
func (*EmitTriggersRequest) String ¶
func (x *EmitTriggersRequest) String() string
type EmitTriggersRequest_Batch ¶
type EmitTriggersRequest_Batch struct { Trigger *Trigger `protobuf:"bytes,1,opt,name=trigger,proto3" json:"trigger,omitempty"` Jobs []*JobRef `protobuf:"bytes,2,rep,name=jobs,proto3" json:"jobs,omitempty"` // contains filtered or unexported fields }
func (*EmitTriggersRequest_Batch) Descriptor
deprecated
func (*EmitTriggersRequest_Batch) Descriptor() ([]byte, []int)
Deprecated: Use EmitTriggersRequest_Batch.ProtoReflect.Descriptor instead.
func (*EmitTriggersRequest_Batch) GetJobs ¶
func (x *EmitTriggersRequest_Batch) GetJobs() []*JobRef
func (*EmitTriggersRequest_Batch) GetTrigger ¶
func (x *EmitTriggersRequest_Batch) GetTrigger() *Trigger
func (*EmitTriggersRequest_Batch) ProtoMessage ¶
func (*EmitTriggersRequest_Batch) ProtoMessage()
func (*EmitTriggersRequest_Batch) ProtoReflect ¶
func (x *EmitTriggersRequest_Batch) ProtoReflect() protoreflect.Message
func (*EmitTriggersRequest_Batch) Reset ¶
func (x *EmitTriggersRequest_Batch) Reset()
func (*EmitTriggersRequest_Batch) String ¶
func (x *EmitTriggersRequest_Batch) String() string
type GitilesTrigger ¶
type GitilesTrigger struct { Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` // an URL of a repo that changed Ref string `protobuf:"bytes,2,opt,name=ref,proto3" json:"ref,omitempty"` // a ref that changed, in full, e.g. "refs/heads/master" Revision string `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` // a revision (SHA1 in hex) pointed to by the ref // Properties and tags to add in addition to ones generated from the commit. Properties *structpb.Struct `protobuf:"bytes,4,opt,name=properties,proto3" json:"properties,omitempty"` Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` // contains filtered or unexported fields }
GitilesTrigger is emitted by sources that watch Gitiles and consumed by Buildbucket tasks.
Such triggers are emitted whenever the repository state changes or via EmitTriggers API.
func (*GitilesTrigger) Descriptor
deprecated
func (*GitilesTrigger) Descriptor() ([]byte, []int)
Deprecated: Use GitilesTrigger.ProtoReflect.Descriptor instead.
func (*GitilesTrigger) GetProperties ¶
func (x *GitilesTrigger) GetProperties() *structpb.Struct
func (*GitilesTrigger) GetRef ¶
func (x *GitilesTrigger) GetRef() string
func (*GitilesTrigger) GetRepo ¶
func (x *GitilesTrigger) GetRepo() string
func (*GitilesTrigger) GetRevision ¶
func (x *GitilesTrigger) GetRevision() string
func (*GitilesTrigger) GetTags ¶
func (x *GitilesTrigger) GetTags() []string
func (*GitilesTrigger) ProtoMessage ¶
func (*GitilesTrigger) ProtoMessage()
func (*GitilesTrigger) ProtoReflect ¶
func (x *GitilesTrigger) ProtoReflect() protoreflect.Message
func (*GitilesTrigger) Reset ¶
func (x *GitilesTrigger) Reset()
func (*GitilesTrigger) String ¶
func (x *GitilesTrigger) String() string
type Invocation ¶
type Invocation struct { InvocationRef *InvocationRef `protobuf:"bytes,1,opt,name=invocation_ref,json=invocationRef,proto3" json:"invocation_ref,omitempty"` // start_ts is unix timestamp in microseconds. StartedTs int64 `protobuf:"varint,2,opt,name=started_ts,json=startedTs,proto3" 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,proto3" 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,proto3" json:"triggered_by,omitempty"` // Latest status of a job. Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` // If true, this invocation properties are final and won't be changed. Final bool `protobuf:"varint,6,opt,name=final,proto3" 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,proto3" 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,proto3" json:"view_url,omitempty"` // contains filtered or unexported fields }
Invocation describes properties of one job execution.
func (*Invocation) Descriptor
deprecated
func (*Invocation) Descriptor() ([]byte, []int)
Deprecated: Use Invocation.ProtoReflect.Descriptor instead.
func (*Invocation) GetConfigRevision ¶
func (x *Invocation) GetConfigRevision() string
func (*Invocation) GetFinal ¶
func (x *Invocation) GetFinal() bool
func (*Invocation) GetFinishedTs ¶
func (x *Invocation) GetFinishedTs() int64
func (*Invocation) GetInvocationRef ¶
func (x *Invocation) GetInvocationRef() *InvocationRef
func (*Invocation) GetStartedTs ¶
func (x *Invocation) GetStartedTs() int64
func (*Invocation) GetStatus ¶
func (x *Invocation) GetStatus() string
func (*Invocation) GetTriggeredBy ¶
func (x *Invocation) GetTriggeredBy() string
func (*Invocation) GetViewUrl ¶
func (x *Invocation) GetViewUrl() string
func (*Invocation) ProtoMessage ¶
func (*Invocation) ProtoMessage()
func (*Invocation) ProtoReflect ¶
func (x *Invocation) ProtoReflect() protoreflect.Message
func (*Invocation) Reset ¶
func (x *Invocation) Reset()
func (*Invocation) String ¶
func (x *Invocation) String() string
type InvocationRef ¶
type InvocationRef struct { JobRef *JobRef `protobuf:"bytes,1,opt,name=job_ref,json=jobRef,proto3" 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,proto3" json:"invocation_id,omitempty"` // contains filtered or unexported fields }
InvocationRef uniquely identifies an invocation of a job.
func (*InvocationRef) Descriptor
deprecated
func (*InvocationRef) Descriptor() ([]byte, []int)
Deprecated: Use InvocationRef.ProtoReflect.Descriptor instead.
func (*InvocationRef) GetInvocationId ¶
func (x *InvocationRef) GetInvocationId() int64
func (*InvocationRef) GetJobRef ¶
func (x *InvocationRef) GetJobRef() *JobRef
func (*InvocationRef) ProtoMessage ¶
func (*InvocationRef) ProtoMessage()
func (*InvocationRef) ProtoReflect ¶
func (x *InvocationRef) ProtoReflect() protoreflect.Message
func (*InvocationRef) Reset ¶
func (x *InvocationRef) Reset()
func (*InvocationRef) String ¶
func (x *InvocationRef) String() string
type InvocationsReply ¶
type InvocationsReply struct { Invocations []*Invocation `protobuf:"bytes,1,rep,name=invocations,proto3" json:"invocations,omitempty"` NextCursor string `protobuf:"bytes,2,opt,name=next_cursor,json=nextCursor,proto3" json:"next_cursor,omitempty"` // contains filtered or unexported fields }
func (*InvocationsReply) Descriptor
deprecated
func (*InvocationsReply) Descriptor() ([]byte, []int)
Deprecated: Use InvocationsReply.ProtoReflect.Descriptor instead.
func (*InvocationsReply) GetInvocations ¶
func (x *InvocationsReply) GetInvocations() []*Invocation
func (*InvocationsReply) GetNextCursor ¶
func (x *InvocationsReply) GetNextCursor() string
func (*InvocationsReply) ProtoMessage ¶
func (*InvocationsReply) ProtoMessage()
func (*InvocationsReply) ProtoReflect ¶
func (x *InvocationsReply) ProtoReflect() protoreflect.Message
func (*InvocationsReply) Reset ¶
func (x *InvocationsReply) Reset()
func (*InvocationsReply) String ¶
func (x *InvocationsReply) String() string
type InvocationsRequest ¶
type InvocationsRequest struct { JobRef *JobRef `protobuf:"bytes,1,opt,name=job_ref,json=jobRef,proto3" json:"job_ref,omitempty"` Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` // page_size defaults to 50 which is maximum. PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // contains filtered or unexported fields }
func (*InvocationsRequest) Descriptor
deprecated
func (*InvocationsRequest) Descriptor() ([]byte, []int)
Deprecated: Use InvocationsRequest.ProtoReflect.Descriptor instead.
func (*InvocationsRequest) GetCursor ¶
func (x *InvocationsRequest) GetCursor() string
func (*InvocationsRequest) GetJobRef ¶
func (x *InvocationsRequest) GetJobRef() *JobRef
func (*InvocationsRequest) GetPageSize ¶
func (x *InvocationsRequest) GetPageSize() int32
func (*InvocationsRequest) ProtoMessage ¶
func (*InvocationsRequest) ProtoMessage()
func (*InvocationsRequest) ProtoReflect ¶
func (x *InvocationsRequest) ProtoReflect() protoreflect.Message
func (*InvocationsRequest) Reset ¶
func (x *InvocationsRequest) Reset()
func (*InvocationsRequest) String ¶
func (x *InvocationsRequest) String() string
type Job ¶
type Job struct { JobRef *JobRef `protobuf:"bytes,1,opt,name=job_ref,json=jobRef,proto3" json:"job_ref,omitempty"` Schedule string `protobuf:"bytes,2,opt,name=schedule,proto3" json:"schedule,omitempty"` State *JobState `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` Paused bool `protobuf:"varint,4,opt,name=paused,proto3" json:"paused,omitempty"` // contains filtered or unexported fields }
Job descibes currently configured job.
func (*Job) Descriptor
deprecated
func (*Job) GetSchedule ¶
func (*Job) ProtoMessage ¶
func (*Job) ProtoMessage()
func (*Job) ProtoReflect ¶
func (x *Job) ProtoReflect() protoreflect.Message
type JobRef ¶
type JobRef struct { Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` Job string `protobuf:"bytes,2,opt,name=job,proto3" json:"job,omitempty"` // contains filtered or unexported fields }
JobRef uniquely identifies a job.
func (*JobRef) Descriptor
deprecated
func (*JobRef) GetProject ¶
func (*JobRef) ProtoMessage ¶
func (*JobRef) ProtoMessage()
func (*JobRef) ProtoReflect ¶
func (x *JobRef) ProtoReflect() protoreflect.Message
type JobState ¶
type JobState struct { UiStatus string `protobuf:"bytes,1,opt,name=ui_status,json=uiStatus,proto3" json:"ui_status,omitempty"` // contains filtered or unexported fields }
JobState describes current Job state as one of these strings:
"DISABLED" "PAUSED" "RUNNING" "SCHEDULED" "WAITING"
func (*JobState) Descriptor
deprecated
func (*JobState) GetUiStatus ¶
func (*JobState) ProtoMessage ¶
func (*JobState) ProtoMessage()
func (*JobState) ProtoReflect ¶
func (x *JobState) ProtoReflect() protoreflect.Message
type JobsReply ¶
type JobsReply struct { Jobs []*Job `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"` NextCursor string `protobuf:"bytes,2,opt,name=next_cursor,json=nextCursor,proto3" json:"next_cursor,omitempty"` // contains filtered or unexported fields }
func (*JobsReply) Descriptor
deprecated
func (*JobsReply) GetNextCursor ¶
func (*JobsReply) ProtoMessage ¶
func (*JobsReply) ProtoMessage()
func (*JobsReply) ProtoReflect ¶
func (x *JobsReply) ProtoReflect() protoreflect.Message
type JobsRequest ¶
type JobsRequest struct { // If not specified or "", all projects' jobs are returned. Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"` // page_size is currently not implemented and is ignored. PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // contains filtered or unexported fields }
func (*JobsRequest) Descriptor
deprecated
func (*JobsRequest) Descriptor() ([]byte, []int)
Deprecated: Use JobsRequest.ProtoReflect.Descriptor instead.
func (*JobsRequest) GetCursor ¶
func (x *JobsRequest) GetCursor() string
func (*JobsRequest) GetPageSize ¶
func (x *JobsRequest) GetPageSize() int32
func (*JobsRequest) GetProject ¶
func (x *JobsRequest) GetProject() string
func (*JobsRequest) ProtoMessage ¶
func (*JobsRequest) ProtoMessage()
func (*JobsRequest) ProtoReflect ¶
func (x *JobsRequest) ProtoReflect() protoreflect.Message
func (*JobsRequest) Reset ¶
func (x *JobsRequest) Reset()
func (*JobsRequest) String ¶
func (x *JobsRequest) String() string
type NoopTrigger ¶
type NoopTrigger struct { Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
NoopTrigger is used by Scheduler integration tests to represent test triggers.
func (*NoopTrigger) Descriptor
deprecated
func (*NoopTrigger) Descriptor() ([]byte, []int)
Deprecated: Use NoopTrigger.ProtoReflect.Descriptor instead.
func (*NoopTrigger) GetData ¶
func (x *NoopTrigger) GetData() string
func (*NoopTrigger) ProtoMessage ¶
func (*NoopTrigger) ProtoMessage()
func (*NoopTrigger) ProtoReflect ¶
func (x *NoopTrigger) ProtoReflect() protoreflect.Message
func (*NoopTrigger) Reset ¶
func (x *NoopTrigger) Reset()
func (*NoopTrigger) String ¶
func (x *NoopTrigger) 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. // // A job is visible if the caller has "scheduler.jobs.get" permission. GetJobs(ctx context.Context, in *JobsRequest, opts ...grpc.CallOption) (*JobsReply, error) // GetInvocations fetches invocations of a given job, most recent first. // // Requires "scheduler.jobs.get" permission. GetInvocations(ctx context.Context, in *InvocationsRequest, opts ...grpc.CallOption) (*InvocationsReply, error) // GetInvocation fetches a single invocation. // // Requires "scheduler.jobs.get" permission. GetInvocation(ctx context.Context, in *InvocationRef, opts ...grpc.CallOption) (*Invocation, error) // PauseJob will prevent automatic triggering of a job. // // Manual triggering (e.g. via EmitTriggers RPC) is still allowed. Any pending // or running invocations are still executed. // // PauseJob does nothing if job is already paused. // // Requires "scheduler.jobs.pause" permission. PauseJob(ctx context.Context, in *JobRef, opts ...grpc.CallOption) (*emptypb.Empty, error) // ResumeJob resumes paused job. // // ResumeJob does nothing if job is not paused. // // Requires "scheduler.jobs.resume" permission. ResumeJob(ctx context.Context, in *JobRef, opts ...grpc.CallOption) (*emptypb.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 "scheduler.jobs.abort" permission. AbortJob(ctx context.Context, in *JobRef, opts ...grpc.CallOption) (*emptypb.Empty, error) // AbortInvocation aborts a given job invocation. // // If an invocation is finalized, AbortInvocation does nothing. // // If you want to abort a specific hung invocation, use this request instead // of AbortJob. // // Requires "scheduler.jobs.abort" permission. AbortInvocation(ctx context.Context, in *InvocationRef, opts ...grpc.CallOption) (*emptypb.Empty, error) // EmitTriggers puts one or more triggers into pending trigger queues of the // specified jobs. // // This eventually causes jobs to start executing. The scheduler may merge // multiple triggers into one job execution, based on how the job is // configured. // // If at least one job doesn't exist or the caller has no permission to // trigger it, the entire request is aborted. Otherwise, the request is NOT // transactional: if it fails midway (e.g. by returning internal server error), // some triggers may have been submitted and some may not. It is safe to retry // the call, supplying the same trigger IDs. Triggers with the same IDs will // be deduplicated. See Trigger message for more details. // // Requires "scheduler.jobs.trigger" permission. EmitTriggers(ctx context.Context, in *EmitTriggersRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
SchedulerClient is the client API for Scheduler service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
Scheduler exposes public API of the Scheduler service.
func NewSchedulerClient ¶
func NewSchedulerClient(cc grpc.ClientConnInterface) 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. // // A job is visible if the caller has "scheduler.jobs.get" permission. GetJobs(context.Context, *JobsRequest) (*JobsReply, error) // GetInvocations fetches invocations of a given job, most recent first. // // Requires "scheduler.jobs.get" permission. GetInvocations(context.Context, *InvocationsRequest) (*InvocationsReply, error) // GetInvocation fetches a single invocation. // // Requires "scheduler.jobs.get" permission. GetInvocation(context.Context, *InvocationRef) (*Invocation, error) // PauseJob will prevent automatic triggering of a job. // // Manual triggering (e.g. via EmitTriggers RPC) is still allowed. Any pending // or running invocations are still executed. // // PauseJob does nothing if job is already paused. // // Requires "scheduler.jobs.pause" permission. PauseJob(context.Context, *JobRef) (*emptypb.Empty, error) // ResumeJob resumes paused job. // // ResumeJob does nothing if job is not paused. // // Requires "scheduler.jobs.resume" permission. ResumeJob(context.Context, *JobRef) (*emptypb.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 "scheduler.jobs.abort" permission. AbortJob(context.Context, *JobRef) (*emptypb.Empty, error) // AbortInvocation aborts a given job invocation. // // If an invocation is finalized, AbortInvocation does nothing. // // If you want to abort a specific hung invocation, use this request instead // of AbortJob. // // Requires "scheduler.jobs.abort" permission. AbortInvocation(context.Context, *InvocationRef) (*emptypb.Empty, error) // EmitTriggers puts one or more triggers into pending trigger queues of the // specified jobs. // // This eventually causes jobs to start executing. The scheduler may merge // multiple triggers into one job execution, based on how the job is // configured. // // If at least one job doesn't exist or the caller has no permission to // trigger it, the entire request is aborted. Otherwise, the request is NOT // transactional: if it fails midway (e.g. by returning internal server error), // some triggers may have been submitted and some may not. It is safe to retry // the call, supplying the same trigger IDs. Triggers with the same IDs will // be deduplicated. See Trigger message for more details. // // Requires "scheduler.jobs.trigger" permission. EmitTriggers(context.Context, *EmitTriggersRequest) (*emptypb.Empty, error) // contains filtered or unexported methods }
SchedulerServer is the server API for Scheduler service. All implementations must embed UnimplementedSchedulerServer for forward compatibility.
Scheduler exposes public API of the Scheduler service.
type Trigger ¶
type Trigger struct { // Unique identifier of the trigger. // // It is used to deduplicate and hence provide idempotency for adding // a trigger. Each job has an internal buffer with IDs of recent triggers it // received. Triggers that have already been seen are silently skipped. The // buffer is periodically cleaned, so old IDs can be potentially reused, // though you should not rely on that. // // Must be provided by whoever emits the trigger. Can be anything at all, as // long as it is unique. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Optional user friendly name for this trigger that shows up in Scheduler UI. Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` // Optional HTTP link to display in Scheduler UI. Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` // Actual trigger data. Its type defines how the trigger will be processed // by the Scheduler, see corresponding protos. // // Types that are assignable to Payload: // // *Trigger_Cron // *Trigger_Webui // *Trigger_Noop // *Trigger_Gitiles // *Trigger_Buildbucket Payload isTrigger_Payload `protobuf_oneof:"payload"` // contains filtered or unexported fields }
Trigger can be emitted by triggering tasks (such as Gitiles tasks) or through API and consumed by triggered tasks (such as Buildbucket tasks).
func (*Trigger) Descriptor
deprecated
func (*Trigger) GetBuildbucket ¶
func (x *Trigger) GetBuildbucket() *BuildbucketTrigger
func (*Trigger) GetCron ¶
func (x *Trigger) GetCron() *CronTrigger
func (*Trigger) GetGitiles ¶
func (x *Trigger) GetGitiles() *GitilesTrigger
func (*Trigger) GetNoop ¶
func (x *Trigger) GetNoop() *NoopTrigger
func (*Trigger) GetPayload ¶
func (m *Trigger) GetPayload() isTrigger_Payload
func (*Trigger) GetWebui ¶
func (x *Trigger) GetWebui() *WebUITrigger
func (*Trigger) ProtoMessage ¶
func (*Trigger) ProtoMessage()
func (*Trigger) ProtoReflect ¶
func (x *Trigger) ProtoReflect() protoreflect.Message
type Trigger_Buildbucket ¶
type Trigger_Buildbucket struct {
Buildbucket *BuildbucketTrigger `protobuf:"bytes,52,opt,name=buildbucket,proto3,oneof"`
}
type Trigger_Cron ¶
type Trigger_Cron struct {
Cron *CronTrigger `protobuf:"bytes,40,opt,name=cron,proto3,oneof"`
}
type Trigger_Gitiles ¶
type Trigger_Gitiles struct {
Gitiles *GitilesTrigger `protobuf:"bytes,51,opt,name=gitiles,proto3,oneof"`
}
type Trigger_Noop ¶
type Trigger_Noop struct {
Noop *NoopTrigger `protobuf:"bytes,50,opt,name=noop,proto3,oneof"`
}
type Trigger_Webui ¶
type Trigger_Webui struct {
Webui *WebUITrigger `protobuf:"bytes,41,opt,name=webui,proto3,oneof"`
}
type UnimplementedSchedulerServer ¶
type UnimplementedSchedulerServer struct{}
UnimplementedSchedulerServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedSchedulerServer) AbortInvocation ¶
func (UnimplementedSchedulerServer) AbortInvocation(context.Context, *InvocationRef) (*emptypb.Empty, error)
func (UnimplementedSchedulerServer) EmitTriggers ¶
func (UnimplementedSchedulerServer) EmitTriggers(context.Context, *EmitTriggersRequest) (*emptypb.Empty, error)
func (UnimplementedSchedulerServer) GetInvocation ¶
func (UnimplementedSchedulerServer) GetInvocation(context.Context, *InvocationRef) (*Invocation, error)
func (UnimplementedSchedulerServer) GetInvocations ¶
func (UnimplementedSchedulerServer) GetInvocations(context.Context, *InvocationsRequest) (*InvocationsReply, error)
func (UnimplementedSchedulerServer) GetJobs ¶
func (UnimplementedSchedulerServer) GetJobs(context.Context, *JobsRequest) (*JobsReply, error)
type UnsafeSchedulerServer ¶
type UnsafeSchedulerServer interface {
// contains filtered or unexported methods
}
UnsafeSchedulerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SchedulerServer will result in compilation errors.
type WebUITrigger ¶
type WebUITrigger struct {
// contains filtered or unexported fields
}
WebUITrigger is emitted whenever users click "Trigger" button in UI.
Note: such triggers can't be scheduled through external Scheduler API (to avoid confusion). They may appear in the API responses though.
func (*WebUITrigger) Descriptor
deprecated
func (*WebUITrigger) Descriptor() ([]byte, []int)
Deprecated: Use WebUITrigger.ProtoReflect.Descriptor instead.
func (*WebUITrigger) ProtoMessage ¶
func (*WebUITrigger) ProtoMessage()
func (*WebUITrigger) ProtoReflect ¶
func (x *WebUITrigger) ProtoReflect() protoreflect.Message
func (*WebUITrigger) Reset ¶
func (x *WebUITrigger) Reset()
func (*WebUITrigger) String ¶
func (x *WebUITrigger) String() string