20#ifndef ORES_SCHEDULER_MESSAGING_SCHEDULER_PROTOCOL_HPP
21#define ORES_SCHEDULER_MESSAGING_SCHEDULER_PROTOCOL_HPP
28#include "ores.scheduler.api/domain/job_definition.hpp"
29#include "ores.scheduler.api/domain/job_instance.hpp"
31namespace ores::scheduler::messaging {
33struct get_job_definitions_request {
34 using response_type =
struct get_job_definitions_response;
35 static constexpr std::string_view nats_subject =
36 "scheduler.v1.job-definitions.list";
41struct get_job_definitions_response {
42 std::vector<ores::scheduler::domain::job_definition> definitions;
43 int total_available_count = 0;
46struct schedule_job_request {
47 using response_type =
struct schedule_job_response;
48 static constexpr std::string_view nats_subject =
49 "scheduler.v1.job-definitions.schedule";
51 std::string change_reason_code;
52 std::string change_commentary;
55struct schedule_job_response {
60struct unschedule_job_request {
61 using response_type =
struct unschedule_job_response;
62 static constexpr std::string_view nats_subject =
63 "scheduler.v1.job-definitions.unschedule";
64 std::string job_definition_id;
65 std::string change_reason_code;
66 std::string change_commentary;
69struct unschedule_job_response {
74struct schedule_jobs_batch_request {
75 using response_type =
struct schedule_jobs_batch_response;
76 static constexpr std::string_view nats_subject =
77 "scheduler.v1.job-definitions.schedule-batch";
78 std::vector<ores::scheduler::domain::job_definition> definitions;
79 std::string change_reason_code;
80 std::string change_commentary;
83struct schedule_jobs_batch_response {
86 int scheduled_count = 0;
87 std::vector<std::string> failed_ids;
90struct get_job_history_request {
91 using response_type =
struct get_job_history_response;
92 static constexpr std::string_view nats_subject =
93 "scheduler.v1.job-definitions.history";
94 std::string job_definition_id;
98struct get_job_history_response {
101 std::vector<ores::scheduler::domain::job_instance> instances;
108struct get_job_instances_request {
109 using response_type =
struct get_job_instances_response;
110 static constexpr std::string_view nats_subject =
111 "scheduler.v1.job-instances.list";
124 std::string job_definition_id;
125 std::string job_name;
126 std::string action_type;
130 std::optional<std::string> completed_at;
131 std::optional<std::int64_t> duration_ms;
132 std::string error_message;
135struct get_job_instances_response {
138 std::vector<job_instance_summary> instances;
139 int total_available_count = 0;
146struct get_scheduler_status_request {
147 using response_type =
struct get_scheduler_status_response;
148 static constexpr std::string_view nats_subject =
149 "scheduler.v1.status";
156 std::string job_definition_id;
157 std::string job_name;
158 std::string description;
159 std::string schedule_expression;
160 bool is_active =
false;
167struct get_scheduler_status_response {
170 std::vector<job_schedule_status> jobs;
171 int total_running = 0;
172 int total_active = 0;
Persistent plan for an in-process scheduled job.
Definition job_definition.hpp:38
A job_instance enriched with the parent job's display name.
Definition scheduler_protocol.hpp:122
std::string status
"starting" | "succeeded" | "failed"
Definition scheduler_protocol.hpp:127
std::string started_at
ISO-8601 UTC.
Definition scheduler_protocol.hpp:129
std::string triggered_at
ISO-8601 UTC.
Definition scheduler_protocol.hpp:128
Per-job status snapshot used by the Scheduler Monitor window.
Definition scheduler_protocol.hpp:155
int running_count
currently running instances
Definition scheduler_protocol.hpp:164
std::optional< std::string > last_run_status
"succeeded" | "failed" | "starting"
Definition scheduler_protocol.hpp:162
std::optional< std::string > last_run_at
ISO-8601 UTC, if ever run.
Definition scheduler_protocol.hpp:161
std::optional< std::string > next_fire_at
ISO-8601 UTC, null if inactive.
Definition scheduler_protocol.hpp:163