Skip to main content

nominal_api_conjure/conjure/clients/ingest/api/
ingest_service.rs

1use conjure_http::endpoint;
2/// The Ingest Service handles the data ingestion into Nominal/Clickhouse.
3#[conjure_http::conjure_client(name = "IngestService")]
4pub trait IngestService<
5    #[response_body]
6    I: Iterator<
7            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
8        >,
9> {
10    /// Triggers an ingest job, allowing either creating a new dataset or uploading to an
11    /// existing one. This endpoint is meant to supersede all other ingestion endpoints as their functionality
12    /// gets migrated to this one.
13    #[endpoint(
14        method = POST,
15        path = "/ingest/v1/ingest",
16        name = "ingest",
17        accept = conjure_http::client::StdResponseDeserializer
18    )]
19    fn ingest(
20        &self,
21        #[auth]
22        auth_: &conjure_object::BearerToken,
23        #[body(serializer = conjure_http::client::StdRequestSerializer)]
24        trigger_ingest: &super::super::super::super::objects::ingest::api::IngestRequest,
25    ) -> Result<
26        super::super::super::super::objects::ingest::api::IngestResponse,
27        conjure_http::private::Error,
28    >;
29    /// Triggers an ingest job using an existing ingest job RID.
30    /// Returns the same response format as the /ingest endpoint.
31    ///
32    /// Only a job that has finished can be re-run: re-running one still in flight races or duplicates
33    /// the run already in progress. Cancel it first.
34    #[endpoint(
35        method = POST,
36        path = "/ingest/v1/re-ingest",
37        name = "rerunIngest",
38        accept = conjure_http::client::StdResponseDeserializer
39    )]
40    fn rerun_ingest(
41        &self,
42        #[auth]
43        auth_: &conjure_object::BearerToken,
44        #[body(serializer = conjure_http::client::StdRequestSerializer)]
45        request: &super::super::super::super::objects::ingest::api::RerunIngestRequest,
46    ) -> Result<
47        super::super::super::super::objects::ingest::api::IngestResponse,
48        conjure_http::private::Error,
49    >;
50    /// Creates a run and ingests data sources to be added to the run.
51    #[endpoint(
52        method = POST,
53        path = "/ingest/v1/ingest-run",
54        name = "ingestRun",
55        accept = conjure_http::client::StdResponseDeserializer
56    )]
57    fn ingest_run(
58        &self,
59        #[auth]
60        auth_: &conjure_object::BearerToken,
61        #[body(serializer = conjure_http::client::StdRequestSerializer)]
62        request: &super::super::super::super::objects::ingest::api::IngestRunRequest,
63    ) -> Result<
64        super::super::super::super::objects::ingest::api::IngestRunResponse,
65        conjure_http::private::Error,
66    >;
67    /// Ingests video data from a S3 Nominal upload bucket.
68    #[endpoint(
69        method = POST,
70        path = "/ingest/v1/ingest-video",
71        name = "ingestVideo",
72        accept = conjure_http::client::StdResponseDeserializer
73    )]
74    fn ingest_video(
75        &self,
76        #[auth]
77        auth_: &conjure_object::BearerToken,
78        #[body(serializer = conjure_http::client::StdRequestSerializer)]
79        ingest_video: &super::super::super::super::objects::ingest::api::IngestVideoRequest,
80    ) -> Result<
81        super::super::super::super::objects::ingest::api::IngestVideoResponse,
82        conjure_http::private::Error,
83    >;
84    /// Re-ingests data from provided source datasets into either an existing target dataset, or a new one.
85    /// Only supported for CSV and Parquet dataset files.
86    /// Will only reingest dataset files and will drop streaming data from datasets.
87    #[endpoint(
88        method = POST,
89        path = "/ingest/v1/reingest-dataset-files",
90        name = "reingestFromDatasets",
91        accept = conjure_http::client::StdResponseDeserializer
92    )]
93    fn reingest_from_datasets(
94        &self,
95        #[auth]
96        auth_: &conjure_object::BearerToken,
97        #[body(serializer = conjure_http::client::StdRequestSerializer)]
98        request: &super::super::super::super::objects::ingest::api::ReingestDatasetsRequest,
99    ) -> Result<
100        super::super::super::super::objects::ingest::api::ReingestDatasetsResponse,
101        conjure_http::private::Error,
102    >;
103    /// This is a best effort deletion of the file's data based on the ingestedAt timestamp. This is an unreversible
104    /// action. Only v2 dataset file deletion is supported.
105    /// !!!WARNING!!!
106    /// It's possible that the file has overwritten points, in which case, those older points will not be recovered.
107    /// Only use this endpoint if this is acceptable, the data across files are disjoint, or you're willing to
108    /// re-ingest files to manually recover older points.
109    #[endpoint(
110        method = DELETE,
111        path = "/ingest/v1/delete-file/{datasetRid}/file/{fileId}",
112        name = "deleteFile",
113        accept = conjure_http::client::conjure::EmptyResponseDeserializer
114    )]
115    fn delete_file(
116        &self,
117        #[auth]
118        auth_: &conjure_object::BearerToken,
119        #[path(
120            name = "datasetRid",
121            encoder = conjure_http::client::conjure::PlainEncoder
122        )]
123        dataset_rid: &super::super::super::super::objects::api::rids::DatasetRid,
124        #[path(name = "fileId", encoder = conjure_http::client::conjure::PlainEncoder)]
125        file_id: conjure_object::Uuid,
126    ) -> Result<(), conjure_http::private::Error>;
127}
128/// The Ingest Service handles the data ingestion into Nominal/Clickhouse.
129#[conjure_http::conjure_client(name = "IngestService")]
130pub trait AsyncIngestService<
131    #[response_body]
132    I: conjure_http::private::Stream<
133            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
134        >,
135> {
136    /// Triggers an ingest job, allowing either creating a new dataset or uploading to an
137    /// existing one. This endpoint is meant to supersede all other ingestion endpoints as their functionality
138    /// gets migrated to this one.
139    #[endpoint(
140        method = POST,
141        path = "/ingest/v1/ingest",
142        name = "ingest",
143        accept = conjure_http::client::StdResponseDeserializer
144    )]
145    async fn ingest(
146        &self,
147        #[auth]
148        auth_: &conjure_object::BearerToken,
149        #[body(serializer = conjure_http::client::StdRequestSerializer)]
150        trigger_ingest: &super::super::super::super::objects::ingest::api::IngestRequest,
151    ) -> Result<
152        super::super::super::super::objects::ingest::api::IngestResponse,
153        conjure_http::private::Error,
154    >;
155    /// Triggers an ingest job using an existing ingest job RID.
156    /// Returns the same response format as the /ingest endpoint.
157    ///
158    /// Only a job that has finished can be re-run: re-running one still in flight races or duplicates
159    /// the run already in progress. Cancel it first.
160    #[endpoint(
161        method = POST,
162        path = "/ingest/v1/re-ingest",
163        name = "rerunIngest",
164        accept = conjure_http::client::StdResponseDeserializer
165    )]
166    async fn rerun_ingest(
167        &self,
168        #[auth]
169        auth_: &conjure_object::BearerToken,
170        #[body(serializer = conjure_http::client::StdRequestSerializer)]
171        request: &super::super::super::super::objects::ingest::api::RerunIngestRequest,
172    ) -> Result<
173        super::super::super::super::objects::ingest::api::IngestResponse,
174        conjure_http::private::Error,
175    >;
176    /// Creates a run and ingests data sources to be added to the run.
177    #[endpoint(
178        method = POST,
179        path = "/ingest/v1/ingest-run",
180        name = "ingestRun",
181        accept = conjure_http::client::StdResponseDeserializer
182    )]
183    async fn ingest_run(
184        &self,
185        #[auth]
186        auth_: &conjure_object::BearerToken,
187        #[body(serializer = conjure_http::client::StdRequestSerializer)]
188        request: &super::super::super::super::objects::ingest::api::IngestRunRequest,
189    ) -> Result<
190        super::super::super::super::objects::ingest::api::IngestRunResponse,
191        conjure_http::private::Error,
192    >;
193    /// Ingests video data from a S3 Nominal upload bucket.
194    #[endpoint(
195        method = POST,
196        path = "/ingest/v1/ingest-video",
197        name = "ingestVideo",
198        accept = conjure_http::client::StdResponseDeserializer
199    )]
200    async fn ingest_video(
201        &self,
202        #[auth]
203        auth_: &conjure_object::BearerToken,
204        #[body(serializer = conjure_http::client::StdRequestSerializer)]
205        ingest_video: &super::super::super::super::objects::ingest::api::IngestVideoRequest,
206    ) -> Result<
207        super::super::super::super::objects::ingest::api::IngestVideoResponse,
208        conjure_http::private::Error,
209    >;
210    /// Re-ingests data from provided source datasets into either an existing target dataset, or a new one.
211    /// Only supported for CSV and Parquet dataset files.
212    /// Will only reingest dataset files and will drop streaming data from datasets.
213    #[endpoint(
214        method = POST,
215        path = "/ingest/v1/reingest-dataset-files",
216        name = "reingestFromDatasets",
217        accept = conjure_http::client::StdResponseDeserializer
218    )]
219    async fn reingest_from_datasets(
220        &self,
221        #[auth]
222        auth_: &conjure_object::BearerToken,
223        #[body(serializer = conjure_http::client::StdRequestSerializer)]
224        request: &super::super::super::super::objects::ingest::api::ReingestDatasetsRequest,
225    ) -> Result<
226        super::super::super::super::objects::ingest::api::ReingestDatasetsResponse,
227        conjure_http::private::Error,
228    >;
229    /// This is a best effort deletion of the file's data based on the ingestedAt timestamp. This is an unreversible
230    /// action. Only v2 dataset file deletion is supported.
231    /// !!!WARNING!!!
232    /// It's possible that the file has overwritten points, in which case, those older points will not be recovered.
233    /// Only use this endpoint if this is acceptable, the data across files are disjoint, or you're willing to
234    /// re-ingest files to manually recover older points.
235    #[endpoint(
236        method = DELETE,
237        path = "/ingest/v1/delete-file/{datasetRid}/file/{fileId}",
238        name = "deleteFile",
239        accept = conjure_http::client::conjure::EmptyResponseDeserializer
240    )]
241    async fn delete_file(
242        &self,
243        #[auth]
244        auth_: &conjure_object::BearerToken,
245        #[path(
246            name = "datasetRid",
247            encoder = conjure_http::client::conjure::PlainEncoder
248        )]
249        dataset_rid: &super::super::super::super::objects::api::rids::DatasetRid,
250        #[path(name = "fileId", encoder = conjure_http::client::conjure::PlainEncoder)]
251        file_id: conjure_object::Uuid,
252    ) -> Result<(), conjure_http::private::Error>;
253}
254/// The Ingest Service handles the data ingestion into Nominal/Clickhouse.
255#[conjure_http::conjure_client(name = "IngestService", local)]
256pub trait LocalAsyncIngestService<
257    #[response_body]
258    I: conjure_http::private::Stream<
259            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
260        >,
261> {
262    /// Triggers an ingest job, allowing either creating a new dataset or uploading to an
263    /// existing one. This endpoint is meant to supersede all other ingestion endpoints as their functionality
264    /// gets migrated to this one.
265    #[endpoint(
266        method = POST,
267        path = "/ingest/v1/ingest",
268        name = "ingest",
269        accept = conjure_http::client::StdResponseDeserializer
270    )]
271    async fn ingest(
272        &self,
273        #[auth]
274        auth_: &conjure_object::BearerToken,
275        #[body(serializer = conjure_http::client::StdRequestSerializer)]
276        trigger_ingest: &super::super::super::super::objects::ingest::api::IngestRequest,
277    ) -> Result<
278        super::super::super::super::objects::ingest::api::IngestResponse,
279        conjure_http::private::Error,
280    >;
281    /// Triggers an ingest job using an existing ingest job RID.
282    /// Returns the same response format as the /ingest endpoint.
283    ///
284    /// Only a job that has finished can be re-run: re-running one still in flight races or duplicates
285    /// the run already in progress. Cancel it first.
286    #[endpoint(
287        method = POST,
288        path = "/ingest/v1/re-ingest",
289        name = "rerunIngest",
290        accept = conjure_http::client::StdResponseDeserializer
291    )]
292    async fn rerun_ingest(
293        &self,
294        #[auth]
295        auth_: &conjure_object::BearerToken,
296        #[body(serializer = conjure_http::client::StdRequestSerializer)]
297        request: &super::super::super::super::objects::ingest::api::RerunIngestRequest,
298    ) -> Result<
299        super::super::super::super::objects::ingest::api::IngestResponse,
300        conjure_http::private::Error,
301    >;
302    /// Creates a run and ingests data sources to be added to the run.
303    #[endpoint(
304        method = POST,
305        path = "/ingest/v1/ingest-run",
306        name = "ingestRun",
307        accept = conjure_http::client::StdResponseDeserializer
308    )]
309    async fn ingest_run(
310        &self,
311        #[auth]
312        auth_: &conjure_object::BearerToken,
313        #[body(serializer = conjure_http::client::StdRequestSerializer)]
314        request: &super::super::super::super::objects::ingest::api::IngestRunRequest,
315    ) -> Result<
316        super::super::super::super::objects::ingest::api::IngestRunResponse,
317        conjure_http::private::Error,
318    >;
319    /// Ingests video data from a S3 Nominal upload bucket.
320    #[endpoint(
321        method = POST,
322        path = "/ingest/v1/ingest-video",
323        name = "ingestVideo",
324        accept = conjure_http::client::StdResponseDeserializer
325    )]
326    async fn ingest_video(
327        &self,
328        #[auth]
329        auth_: &conjure_object::BearerToken,
330        #[body(serializer = conjure_http::client::StdRequestSerializer)]
331        ingest_video: &super::super::super::super::objects::ingest::api::IngestVideoRequest,
332    ) -> Result<
333        super::super::super::super::objects::ingest::api::IngestVideoResponse,
334        conjure_http::private::Error,
335    >;
336    /// Re-ingests data from provided source datasets into either an existing target dataset, or a new one.
337    /// Only supported for CSV and Parquet dataset files.
338    /// Will only reingest dataset files and will drop streaming data from datasets.
339    #[endpoint(
340        method = POST,
341        path = "/ingest/v1/reingest-dataset-files",
342        name = "reingestFromDatasets",
343        accept = conjure_http::client::StdResponseDeserializer
344    )]
345    async fn reingest_from_datasets(
346        &self,
347        #[auth]
348        auth_: &conjure_object::BearerToken,
349        #[body(serializer = conjure_http::client::StdRequestSerializer)]
350        request: &super::super::super::super::objects::ingest::api::ReingestDatasetsRequest,
351    ) -> Result<
352        super::super::super::super::objects::ingest::api::ReingestDatasetsResponse,
353        conjure_http::private::Error,
354    >;
355    /// This is a best effort deletion of the file's data based on the ingestedAt timestamp. This is an unreversible
356    /// action. Only v2 dataset file deletion is supported.
357    /// !!!WARNING!!!
358    /// It's possible that the file has overwritten points, in which case, those older points will not be recovered.
359    /// Only use this endpoint if this is acceptable, the data across files are disjoint, or you're willing to
360    /// re-ingest files to manually recover older points.
361    #[endpoint(
362        method = DELETE,
363        path = "/ingest/v1/delete-file/{datasetRid}/file/{fileId}",
364        name = "deleteFile",
365        accept = conjure_http::client::conjure::EmptyResponseDeserializer
366    )]
367    async fn delete_file(
368        &self,
369        #[auth]
370        auth_: &conjure_object::BearerToken,
371        #[path(
372            name = "datasetRid",
373            encoder = conjure_http::client::conjure::PlainEncoder
374        )]
375        dataset_rid: &super::super::super::super::objects::api::rids::DatasetRid,
376        #[path(name = "fileId", encoder = conjure_http::client::conjure::PlainEncoder)]
377        file_id: conjure_object::Uuid,
378    ) -> Result<(), conjure_http::private::Error>;
379}