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        )]
24        ingest_job_rid: conjure_object::ResourceIdentifier,
25    ) -> Result<
26        super::super::super::super::objects::ingest::api::IngestJob,
27        conjure_http::private::Error,
28    >;
29    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
30    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
31    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
32    #[endpoint(
33        method = GET,
34        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
35        name = "getIngestTransform",
36        produces = conjure_http::server::StdResponseSerializer
37    )]
38    fn get_ingest_transform(
39        &self,
40        #[auth]
41        auth_: conjure_object::BearerToken,
42        #[path(
43            name = "ingestTransformRid",
44            decoder = conjure_http::server::conjure::FromPlainDecoder,
45            log_as = "ingestTransformRid"
46        )]
47        ingest_transform_rid: conjure_object::ResourceIdentifier,
48    ) -> Result<
49        super::super::super::super::objects::ingest::api::IngestTransform,
50        conjure_http::private::Error,
51    >;
52    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
53    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
54    /// a job that is not visible to the caller is reported as IngestJobNotFound.
55    #[endpoint(
56        method = POST,
57        path = "/ingest/v1/ingest-transforms/search",
58        name = "searchIngestTransforms",
59        produces = conjure_http::server::StdResponseSerializer
60    )]
61    fn search_ingest_transforms(
62        &self,
63        #[auth]
64        auth_: conjure_object::BearerToken,
65        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
66        request: super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
67    ) -> Result<
68        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
69        conjure_http::private::Error,
70    >;
71    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
72    #[endpoint(
73        method = POST,
74        path = "/ingest/v1/ingest-jobs/search",
75        name = "searchIngestJobs",
76        produces = conjure_http::server::StdResponseSerializer
77    )]
78    fn search_ingest_jobs(
79        &self,
80        #[auth]
81        auth_: conjure_object::BearerToken,
82        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
83        request: super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
84    ) -> Result<
85        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
86        conjure_http::private::Error,
87    >;
88    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
89    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
90    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
91    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
92    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
93    #[endpoint(
94        method = POST,
95        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
96        name = "cancelIngestJob",
97        produces = conjure_http::server::StdResponseSerializer
98    )]
99    fn cancel_ingest_job(
100        &self,
101        #[auth]
102        auth_: conjure_object::BearerToken,
103        #[path(
104            name = "ingestJobRid",
105            decoder = conjure_http::server::conjure::FromPlainDecoder,
106            log_as = "ingestJobRid"
107        )]
108        ingest_job_rid: conjure_object::ResourceIdentifier,
109    ) -> Result<
110        super::super::super::super::objects::ingest::api::IngestJob,
111        conjure_http::private::Error,
112    >;
113    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
114    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
115    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
116    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
117    #[endpoint(
118        method = POST,
119        path = "/ingest/v1/ingest-jobs/cancel",
120        name = "batchCancelIngestJobs",
121        produces = conjure_http::server::StdResponseSerializer
122    )]
123    fn batch_cancel_ingest_jobs(
124        &self,
125        #[auth]
126        auth_: conjure_object::BearerToken,
127        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
128        request: super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
129    ) -> Result<
130        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
131        conjure_http::private::Error,
132    >;
133}
134/// Public API for querying ingest jobs.
135#[conjure_http::conjure_endpoints(
136    name = "IngestJobService",
137    use_legacy_error_serialization
138)]
139pub trait AsyncIngestJobService {
140    /// Returns a single ingest job by RID. Does not include the full ingest request details.
141    #[endpoint(
142        method = GET,
143        path = "/ingest/v1/ingest-job/{ingestJobRid}",
144        name = "getIngestJob",
145        produces = conjure_http::server::StdResponseSerializer
146    )]
147    async fn get_ingest_job(
148        &self,
149        #[auth]
150        auth_: conjure_object::BearerToken,
151        #[path(
152            name = "ingestJobRid",
153            decoder = conjure_http::server::conjure::FromPlainDecoder,
154            log_as = "ingestJobRid"
155        )]
156        ingest_job_rid: conjure_object::ResourceIdentifier,
157    ) -> Result<
158        super::super::super::super::objects::ingest::api::IngestJob,
159        conjure_http::private::Error,
160    >;
161    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
162    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
163    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
164    #[endpoint(
165        method = GET,
166        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
167        name = "getIngestTransform",
168        produces = conjure_http::server::StdResponseSerializer
169    )]
170    async fn get_ingest_transform(
171        &self,
172        #[auth]
173        auth_: conjure_object::BearerToken,
174        #[path(
175            name = "ingestTransformRid",
176            decoder = conjure_http::server::conjure::FromPlainDecoder,
177            log_as = "ingestTransformRid"
178        )]
179        ingest_transform_rid: conjure_object::ResourceIdentifier,
180    ) -> Result<
181        super::super::super::super::objects::ingest::api::IngestTransform,
182        conjure_http::private::Error,
183    >;
184    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
185    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
186    /// a job that is not visible to the caller is reported as IngestJobNotFound.
187    #[endpoint(
188        method = POST,
189        path = "/ingest/v1/ingest-transforms/search",
190        name = "searchIngestTransforms",
191        produces = conjure_http::server::StdResponseSerializer
192    )]
193    async fn search_ingest_transforms(
194        &self,
195        #[auth]
196        auth_: conjure_object::BearerToken,
197        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
198        request: super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
199    ) -> Result<
200        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
201        conjure_http::private::Error,
202    >;
203    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
204    #[endpoint(
205        method = POST,
206        path = "/ingest/v1/ingest-jobs/search",
207        name = "searchIngestJobs",
208        produces = conjure_http::server::StdResponseSerializer
209    )]
210    async fn search_ingest_jobs(
211        &self,
212        #[auth]
213        auth_: conjure_object::BearerToken,
214        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
215        request: super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
216    ) -> Result<
217        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
218        conjure_http::private::Error,
219    >;
220    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
221    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
222    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
223    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
224    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
225    #[endpoint(
226        method = POST,
227        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
228        name = "cancelIngestJob",
229        produces = conjure_http::server::StdResponseSerializer
230    )]
231    async fn cancel_ingest_job(
232        &self,
233        #[auth]
234        auth_: conjure_object::BearerToken,
235        #[path(
236            name = "ingestJobRid",
237            decoder = conjure_http::server::conjure::FromPlainDecoder,
238            log_as = "ingestJobRid"
239        )]
240        ingest_job_rid: conjure_object::ResourceIdentifier,
241    ) -> Result<
242        super::super::super::super::objects::ingest::api::IngestJob,
243        conjure_http::private::Error,
244    >;
245    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
246    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
247    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
248    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
249    #[endpoint(
250        method = POST,
251        path = "/ingest/v1/ingest-jobs/cancel",
252        name = "batchCancelIngestJobs",
253        produces = conjure_http::server::StdResponseSerializer
254    )]
255    async fn batch_cancel_ingest_jobs(
256        &self,
257        #[auth]
258        auth_: conjure_object::BearerToken,
259        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
260        request: super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
261    ) -> Result<
262        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
263        conjure_http::private::Error,
264    >;
265}
266/// Public API for querying ingest jobs.
267#[conjure_http::conjure_endpoints(
268    name = "IngestJobService",
269    use_legacy_error_serialization,
270    local
271)]
272pub trait LocalAsyncIngestJobService {
273    /// Returns a single ingest job by RID. Does not include the full ingest request details.
274    #[endpoint(
275        method = GET,
276        path = "/ingest/v1/ingest-job/{ingestJobRid}",
277        name = "getIngestJob",
278        produces = conjure_http::server::StdResponseSerializer
279    )]
280    async fn get_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        )]
289        ingest_job_rid: conjure_object::ResourceIdentifier,
290    ) -> Result<
291        super::super::super::super::objects::ingest::api::IngestJob,
292        conjure_http::private::Error,
293    >;
294    /// Returns a single ingest transform by RID. The caller must be authorized to read the dataset
295    /// produced by the transform's parent ingest job; a transform whose parent job is not visible to
296    /// the caller is reported as IngestTransformNotFound rather than leaking its existence.
297    #[endpoint(
298        method = GET,
299        path = "/ingest/v1/ingest-transform/{ingestTransformRid}",
300        name = "getIngestTransform",
301        produces = conjure_http::server::StdResponseSerializer
302    )]
303    async fn get_ingest_transform(
304        &self,
305        #[auth]
306        auth_: conjure_object::BearerToken,
307        #[path(
308            name = "ingestTransformRid",
309            decoder = conjure_http::server::conjure::FromPlainDecoder,
310            log_as = "ingestTransformRid"
311        )]
312        ingest_transform_rid: conjure_object::ResourceIdentifier,
313    ) -> Result<
314        super::super::super::super::objects::ingest::api::IngestTransform,
315        conjure_http::private::Error,
316    >;
317    /// Returns a paginated list of the transforms belonging to a single ingest job, oldest-first and
318    /// optionally filtered by status. The caller must be authorized to read the parent job's dataset;
319    /// a job that is not visible to the caller is reported as IngestJobNotFound.
320    #[endpoint(
321        method = POST,
322        path = "/ingest/v1/ingest-transforms/search",
323        name = "searchIngestTransforms",
324        produces = conjure_http::server::StdResponseSerializer
325    )]
326    async fn search_ingest_transforms(
327        &self,
328        #[auth]
329        auth_: conjure_object::BearerToken,
330        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
331        request: super::super::super::super::objects::ingest::api::SearchIngestTransformsRequest,
332    ) -> Result<
333        super::super::super::super::objects::ingest::api::SearchIngestTransformsResponse,
334        conjure_http::private::Error,
335    >;
336    /// Returns a paginated list of ingest jobs, optionally filtered by dataset.
337    #[endpoint(
338        method = POST,
339        path = "/ingest/v1/ingest-jobs/search",
340        name = "searchIngestJobs",
341        produces = conjure_http::server::StdResponseSerializer
342    )]
343    async fn search_ingest_jobs(
344        &self,
345        #[auth]
346        auth_: conjure_object::BearerToken,
347        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
348        request: super::super::super::super::objects::ingest::api::SearchIngestJobsRequest,
349    ) -> Result<
350        super::super::super::super::objects::ingest::api::SearchIngestJobsResponse,
351        conjure_http::private::Error,
352    >;
353    /// Cancels an ingest job. Jobs that have not yet started running (SUBMITTED, QUEUED) are
354    /// transitioned directly to CANCELLED. Jobs that are IN_PROGRESS have their underlying
355    /// Temporal workflow cancelled; the workflow is responsible for transitioning the job to
356    /// CANCELLED and tearing down in-flight work. Cancelling a job that is already in a terminal
357    /// state (COMPLETED, FAILED, CANCELLED) throws IngestJobNotCancellable.
358    #[endpoint(
359        method = POST,
360        path = "/ingest/v1/ingest-job/{ingestJobRid}/cancel",
361        name = "cancelIngestJob",
362        produces = conjure_http::server::StdResponseSerializer
363    )]
364    async fn cancel_ingest_job(
365        &self,
366        #[auth]
367        auth_: conjure_object::BearerToken,
368        #[path(
369            name = "ingestJobRid",
370            decoder = conjure_http::server::conjure::FromPlainDecoder,
371            log_as = "ingestJobRid"
372        )]
373        ingest_job_rid: conjure_object::ResourceIdentifier,
374    ) -> Result<
375        super::super::super::super::objects::ingest::api::IngestJob,
376        conjure_http::private::Error,
377    >;
378    /// Cancels multiple ingest jobs in a single call. Each job is processed independently and
379    /// best-effort: a job that cannot be cancelled (already terminal, missing, or not authorized for
380    /// the caller) yields a `failed` result rather than aborting the batch. Per-job cancellation
381    /// semantics match cancelIngestJob. At most 100 jobs may be requested per call.
382    #[endpoint(
383        method = POST,
384        path = "/ingest/v1/ingest-jobs/cancel",
385        name = "batchCancelIngestJobs",
386        produces = conjure_http::server::StdResponseSerializer
387    )]
388    async fn batch_cancel_ingest_jobs(
389        &self,
390        #[auth]
391        auth_: conjure_object::BearerToken,
392        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
393        request: super::super::super::super::objects::ingest::api::BatchCancelIngestJobsRequest,
394    ) -> Result<
395        super::super::super::super::objects::ingest::api::BatchCancelIngestJobsResponse,
396        conjure_http::private::Error,
397    >;
398}