syntax = "proto3"; import "common.proto"; import "run.proto"; import "trigger.proto"; package scheduler_proto; service Scheduler { /// Install or update a trigger onto the scheduler rpc UpsertTrigger (UpsertTriggerRequest) returns (UpsertTriggerResponse); /// Manually run a trigger rpc RunTrigger (RunTriggerRequest) returns (RunTriggerResponse); /// Get a trigger by id rpc GetTrigger (GetTriggerRequest) returns (GetTriggerResponse); /// Retrieve a list of triggers rpc ListTriggers (ListTriggersRequest) returns (ListTriggersResponse); /// Pause a running trigger rpc PauseTrigger (PauseTriggerRequest) returns (PauseTriggerResponse); /// Resume a paused/active trigger rpc ResumeTrigger (ResumeTriggerRequest) returns (ResumeTriggerResponse); /// Cancel trigger rpc CancelTrigger (CancelTriggerRequest) returns (CancelTriggerResponse); /// Delete trigger rpc DeleteTrigger (DeleteTriggerRequest) returns (DeleteTriggerResponse); /// Find trigger id by name rpc GetTriggerId (GetTriggerIdRequest) returns (GetTriggerIdResponse); } enum RunMode { RunMode_UNKNOWN = 0; ASYNC = 1; SYNC = 2; } message UpsertTriggerRequest { common.RequestPrecondition precondition = 1; trigger_proto.Trigger trigger = 2; // This is the trigger_name passed through the URL path. This indicates that // the user is using the PUT flow. optional string trigger_name = 3; } // == INSTALL OR UPDATE EXISTING TRIGGER == message UpsertTriggerResponse { trigger_proto.Trigger trigger = 1; common.UpsertEffect effect = 2; } // PAUSE TRIGGER message PauseTriggerRequest { string name = 1; } message PauseTriggerResponse { trigger_proto.Trigger trigger = 1; } // RESUME TRIGGER message ResumeTriggerRequest { string name = 1; } message ResumeTriggerResponse { trigger_proto.Trigger trigger = 1; } // CANCEL TRIGGER message CancelTriggerRequest { string name = 1; } message CancelTriggerResponse { trigger_proto.Trigger trigger = 1; } // DELETE TRIGGER message DeleteTriggerRequest { string name = 1; } message DeleteTriggerResponse { } // == EXECUTE TRIGGER MANUALLY == message RunTriggerRequest { string name = 1; RunMode mode = 2; } message RunTriggerResponse { run_proto.Run run = 1; } // == GET TRIGGER == message GetTriggerRequest { string name = 1; } message GetTriggerResponse { trigger_proto.Trigger trigger = 1; } // == LIST TRIGGER == // The returned triggers must match the "set" fields in this object message ListTriggersFilter { repeated trigger_proto.TriggerStatus statuses = 2; } message ListTriggersRequest { common.PaginationIn pagination = 1; ListTriggersFilter filter = 5; } message ListTriggersResponse { common.PaginationOut pagination = 1; repeated trigger_proto.Trigger triggers = 2; } message GetTriggerIdRequest { string name = 1; } message GetTriggerIdResponse { common.TriggerId id = 1; }