Skip to main content

nominal_api_conjure/conjure/endpoints/ingest/api/
ingest_job_service.rs

1use conjure_http::endpoint;
2/// Public API for querying ingest jobs.
3#[conjure_http::conjure_endpoints(
4    name = "IngestJobService",
5    use_legacy_error_serialization
6)]
7pub trait IngestJobService {
8    /// Returns a single ingest job by RID. Does not include the full ingest request details.
9    #[endpoint(
10        method = GET,
11        path = "/ingest/v1/ingest-job/{ingestJobRid}",
12        name = "getIngestJob",
13        produces = conjure_http::server::StdResponseSerializer
14    )]
15    fn get_ingest_job(
16        &self,
17        #[auth]
18        auth_: conjure_object::BearerToken,
19        #[path(
20            name = "ingestJobRid",
21            decoder = conjure_http::server::conjure::FromPlainDecoder,
22            log_as = "ingestJobRid",
23            safe
24        )]
25        ingest_job_rid: super::super::super::super::objects::ingest::api::IngestJobRid,
26    ) -> Result<
27        super::super::super::super::objects::ingest::api::IngestJob,
28        conjure_http::private::Error,
29    >;
30    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
31    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
32    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
33    #[endpoint(
34        method = GET,
35        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
36        name = "getIngestTransform",
37        produces = conjure_http::server::StdResponseSerializer
38    )]
39    fn get_ingest_transform(
40        &self,
41        #[auth]
42        auth_: conjure_object::BearerToken,
43        #[path(
44            name = "ingestTransformRid",
45            decoder = conjure_http::server::conjure::FromPlainDecoder,
46            log_as = "ingestTransformRid",
47            safe
48        )]
49        ingest_transform_rid: super::super::super::super::objects::ingest::api::IngestTransformRid,
50    ) -> Result<
51        super::super::super::super::objects::ingest::api::IngestTransform,
52        conjure_http::private::Error,
53    >;
54    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
55    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
56    /// a job that is not visible to the caller is reported as IngestJobNotFound.
57    #[endpoint(
58        method = POST,
59        path = "/ingest/v1/ingest-transforms/search",
60        name = "searchIngestTransforms",
61        produces = conjure_http::server::StdResponseSerializer
62    )]
63    fn search_ingest_transforms(
64        &self,
65        #[auth]
66        auth_: conjure_object::BearerToken,
67        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
68        request: super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
69    ) -> Result<
70        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
71        conjure_http::private::Error,
72    >;
73    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
74    #[endpoint(
75        method = POST,
76        path = "/ingest/v1/ingest-jobs/search",
77        name = "searchIngestJobs",
78        produces = conjure_http::server::StdResponseSerializer
79    )]
80    fn search_ingest_jobs(
81        &self,
82        #[auth]
83        auth_: conjure_object::BearerToken,
84        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
85        request: super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
86    ) -> Result<
87        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
88        conjure_http::private::Error,
89    >;
90    /// Returns the number of ingest jobs matching the filter, applying the same visibility rules as
91    /// searchIngestJobs: jobs without a persisted dataset are excluded, and only jobs whose dataset
92    /// the caller is authorized to read are counted. Intended for cheap polling (e.g. an active-job
93    /// indicator) instead of paginating searchIngestJobs just to count results. Throws
94    /// INVALID_ARGUMENT when the filter matches jobs across more distinct datasets than can be
95    /// authorized in one request; narrow the filter in that case.
96    #[endpoint(
97        method = POST,
98        path = "/ingest/v1/ingest-jobs/count",
99        name = "countIngestJobs",
100        produces = conjure_http::server::StdResponseSerializer
101    )]
102    fn count_ingest_jobs(
103        &self,
104        #[auth]
105        auth_: conjure_object::BearerToken,
106        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
107        request: super::super::super::super::objects::ingest::api::CountIngestJobsRequest,
108    ) -> Result<
109        super::super::super::super::objects::ingest::api::CountIngestJobsResponse,
110        conjure_http::private::Error,
111    >;
112    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
113    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
114    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
115    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
116    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
117    #[endpoint(
118        method = POST,
119        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
120        name = "cancelIngestJob",
121        produces = conjure_http::server::StdResponseSerializer
122    )]
123    fn cancel_ingest_job(
124        &self,
125        #[auth]
126        auth_: conjure_object::BearerToken,
127        #[path(
128            name = "ingestJobRid",
129            decoder = conjure_http::server::conjure::FromPlainDecoder,
130            log_as = "ingestJobRid",
131            safe
132        )]
133        ingest_job_rid: super::super::super::super::objects::ingest::api::IngestJobRid,
134    ) -> Result<
135        super::super::super::super::objects::ingest::api::IngestJob,
136        conjure_http::private::Error,
137    >;
138    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
139    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
140    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
141    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
142    #[endpoint(
143        method = POST,
144        path = "/ingest/v1/ingest-jobs/cancel",
145        name = "batchCancelIngestJobs",
146        produces = conjure_http::server::StdResponseSerializer
147    )]
148    fn batch_cancel_ingest_jobs(
149        &self,
150        #[auth]
151        auth_: conjure_object::BearerToken,
152        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
153        request: super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
154    ) -> Result<
155        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
156        conjure_http::private::Error,
157    >;
158}
159/// Public API for querying ingest jobs.
160#[conjure_http::conjure_endpoints(
161    name = "IngestJobService",
162    use_legacy_error_serialization
163)]
164pub trait AsyncIngestJobService {
165    /// Returns a single ingest job by RID. Does not include the full ingest request details.
166    #[endpoint(
167        method = GET,
168        path = "/ingest/v1/ingest-job/{ingestJobRid}",
169        name = "getIngestJob",
170        produces = conjure_http::server::StdResponseSerializer
171    )]
172    async fn get_ingest_job(
173        &self,
174        #[auth]
175        auth_: conjure_object::BearerToken,
176        #[path(
177            name = "ingestJobRid",
178            decoder = conjure_http::server::conjure::FromPlainDecoder,
179            log_as = "ingestJobRid",
180            safe
181        )]
182        ingest_job_rid: super::super::super::super::objects::ingest::api::IngestJobRid,
183    ) -> Result<
184        super::super::super::super::objects::ingest::api::IngestJob,
185        conjure_http::private::Error,
186    >;
187    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
188    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
189    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
190    #[endpoint(
191        method = GET,
192        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
193        name = "getIngestTransform",
194        produces = conjure_http::server::StdResponseSerializer
195    )]
196    async fn get_ingest_transform(
197        &self,
198        #[auth]
199        auth_: conjure_object::BearerToken,
200        #[path(
201            name = "ingestTransformRid",
202            decoder = conjure_http::server::conjure::FromPlainDecoder,
203            log_as = "ingestTransformRid",
204            safe
205        )]
206        ingest_transform_rid: super::super::super::super::objects::ingest::api::IngestTransformRid,
207    ) -> Result<
208        super::super::super::super::objects::ingest::api::IngestTransform,
209        conjure_http::private::Error,
210    >;
211    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
212    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
213    /// a job that is not visible to the caller is reported as IngestJobNotFound.
214    #[endpoint(
215        method = POST,
216        path = "/ingest/v1/ingest-transforms/search",
217        name = "searchIngestTransforms",
218        produces = conjure_http::server::StdResponseSerializer
219    )]
220    async fn search_ingest_transforms(
221        &self,
222        #[auth]
223        auth_: conjure_object::BearerToken,
224        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
225        request: super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
226    ) -> Result<
227        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
228        conjure_http::private::Error,
229    >;
230    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
231    #[endpoint(
232        method = POST,
233        path = "/ingest/v1/ingest-jobs/search",
234        name = "searchIngestJobs",
235        produces = conjure_http::server::StdResponseSerializer
236    )]
237    async fn search_ingest_jobs(
238        &self,
239        #[auth]
240        auth_: conjure_object::BearerToken,
241        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
242        request: super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
243    ) -> Result<
244        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
245        conjure_http::private::Error,
246    >;
247    /// Returns the number of ingest jobs matching the filter, applying the same visibility rules as
248    /// searchIngestJobs: jobs without a persisted dataset are excluded, and only jobs whose dataset
249    /// the caller is authorized to read are counted. Intended for cheap polling (e.g. an active-job
250    /// indicator) instead of paginating searchIngestJobs just to count results. Throws
251    /// INVALID_ARGUMENT when the filter matches jobs across more distinct datasets than can be
252    /// authorized in one request; narrow the filter in that case.
253    #[endpoint(
254        method = POST,
255        path = "/ingest/v1/ingest-jobs/count",
256        name = "countIngestJobs",
257        produces = conjure_http::server::StdResponseSerializer
258    )]
259    async fn count_ingest_jobs(
260        &self,
261        #[auth]
262        auth_: conjure_object::BearerToken,
263        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
264        request: super::super::super::super::objects::ingest::api::CountIngestJobsRequest,
265    ) -> Result<
266        super::super::super::super::objects::ingest::api::CountIngestJobsResponse,
267        conjure_http::private::Error,
268    >;
269    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
270    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
271    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
272    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
273    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
274    #[endpoint(
275        method = POST,
276        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
277        name = "cancelIngestJob",
278        produces = conjure_http::server::StdResponseSerializer
279    )]
280    async fn cancel_ingest_job(
281        &self,
282        #[auth]
283        auth_: conjure_object::BearerToken,
284        #[path(
285            name = "ingestJobRid",
286            decoder = conjure_http::server::conjure::FromPlainDecoder,
287            log_as = "ingestJobRid",
288            safe
289        )]
290        ingest_job_rid: super::super::super::super::objects::ingest::api::IngestJobRid,
291    ) -> Result<
292        super::super::super::super::objects::ingest::api::IngestJob,
293        conjure_http::private::Error,
294    >;
295    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
296    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
297    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
298    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
299    #[endpoint(
300        method = POST,
301        path = "/ingest/v1/ingest-jobs/cancel",
302        name = "batchCancelIngestJobs",
303        produces = conjure_http::server::StdResponseSerializer
304    )]
305    async fn batch_cancel_ingest_jobs(
306        &self,
307        #[auth]
308        auth_: conjure_object::BearerToken,
309        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
310        request: super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
311    ) -> Result<
312        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
313        conjure_http::private::Error,
314    >;
315}
316/// Public API for querying ingest jobs.
317#[conjure_http::conjure_endpoints(
318    name = "IngestJobService",
319    use_legacy_error_serialization,
320    local
321)]
322pub trait LocalAsyncIngestJobService {
323    /// Returns a single ingest job by RID. Does not include the full ingest request details.
324    #[endpoint(
325        method = GET,
326        path = "/ingest/v1/ingest-job/{ingestJobRid}",
327        name = "getIngestJob",
328        produces = conjure_http::server::StdResponseSerializer
329    )]
330    async fn get_ingest_job(
331        &self,
332        #[auth]
333        auth_: conjure_object::BearerToken,
334        #[path(
335            name = "ingestJobRid",
336            decoder = conjure_http::server::conjure::FromPlainDecoder,
337            log_as = "ingestJobRid",
338            safe
339        )]
340        ingest_job_rid: super::super::super::super::objects::ingest::api::IngestJobRid,
341    ) -> Result<
342        super::super::super::super::objects::ingest::api::IngestJob,
343        conjure_http::private::Error,
344    >;
345    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
346    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
347    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
348    #[endpoint(
349        method = GET,
350        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
351        name = "getIngestTransform",
352        produces = conjure_http::server::StdResponseSerializer
353    )]
354    async fn get_ingest_transform(
355        &self,
356        #[auth]
357        auth_: conjure_object::BearerToken,
358        #[path(
359            name = "ingestTransformRid",
360            decoder = conjure_http::server::conjure::FromPlainDecoder,
361            log_as = "ingestTransformRid",
362            safe
363        )]
364        ingest_transform_rid: super::super::super::super::objects::ingest::api::IngestTransformRid,
365    ) -> Result<
366        super::super::super::super::objects::ingest::api::IngestTransform,
367        conjure_http::private::Error,
368    >;
369    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
370    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
371    /// a job that is not visible to the caller is reported as IngestJobNotFound.
372    #[endpoint(
373        method = POST,
374        path = "/ingest/v1/ingest-transforms/search",
375        name = "searchIngestTransforms",
376        produces = conjure_http::server::StdResponseSerializer
377    )]
378    async fn search_ingest_transforms(
379        &self,
380        #[auth]
381        auth_: conjure_object::BearerToken,
382        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
383        request: super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
384    ) -> Result<
385        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
386        conjure_http::private::Error,
387    >;
388    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
389    #[endpoint(
390        method = POST,
391        path = "/ingest/v1/ingest-jobs/search",
392        name = "searchIngestJobs",
393        produces = conjure_http::server::StdResponseSerializer
394    )]
395    async fn search_ingest_jobs(
396        &self,
397        #[auth]
398        auth_: conjure_object::BearerToken,
399        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
400        request: super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
401    ) -> Result<
402        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
403        conjure_http::private::Error,
404    >;
405    /// Returns the number of ingest jobs matching the filter, applying the same visibility rules as
406    /// searchIngestJobs: jobs without a persisted dataset are excluded, and only jobs whose dataset
407    /// the caller is authorized to read are counted. Intended for cheap polling (e.g. an active-job
408    /// indicator) instead of paginating searchIngestJobs just to count results. Throws
409    /// INVALID_ARGUMENT when the filter matches jobs across more distinct datasets than can be
410    /// authorized in one request; narrow the filter in that case.
411    #[endpoint(
412        method = POST,
413        path = "/ingest/v1/ingest-jobs/count",
414        name = "countIngestJobs",
415        produces = conjure_http::server::StdResponseSerializer
416    )]
417    async fn count_ingest_jobs(
418        &self,
419        #[auth]
420        auth_: conjure_object::BearerToken,
421        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
422        request: super::super::super::super::objects::ingest::api::CountIngestJobsRequest,
423    ) -> Result<
424        super::super::super::super::objects::ingest::api::CountIngestJobsResponse,
425        conjure_http::private::Error,
426    >;
427    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
428    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
429    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
430    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
431    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
432    #[endpoint(
433        method = POST,
434        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
435        name = "cancelIngestJob",
436        produces = conjure_http::server::StdResponseSerializer
437    )]
438    async fn cancel_ingest_job(
439        &self,
440        #[auth]
441        auth_: conjure_object::BearerToken,
442        #[path(
443            name = "ingestJobRid",
444            decoder = conjure_http::server::conjure::FromPlainDecoder,
445            log_as = "ingestJobRid",
446            safe
447        )]
448        ingest_job_rid: super::super::super::super::objects::ingest::api::IngestJobRid,
449    ) -> Result<
450        super::super::super::super::objects::ingest::api::IngestJob,
451        conjure_http::private::Error,
452    >;
453    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
454    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
455    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
456    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
457    #[endpoint(
458        method = POST,
459        path = "/ingest/v1/ingest-jobs/cancel",
460        name = "batchCancelIngestJobs",
461        produces = conjure_http::server::StdResponseSerializer
462    )]
463    async fn batch_cancel_ingest_jobs(
464        &self,
465        #[auth]
466        auth_: conjure_object::BearerToken,
467        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
468        request: super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
469    ) -> Result<
470        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
471        conjure_http::private::Error,
472    >;
473}