Skip to main content

nominal_api_conjure/conjure/endpoints/scout/compute/api/
compute_service.rs

1use conjure_http::endpoint;
2/// The Compute Service provides the ability to compute the output of compute graphs.
3#[conjure_http::conjure_endpoints(
4    name = "ComputeService",
5    use_legacy_error_serialization
6)]
7pub trait ComputeService {
8    /// Computes the output of the compute graph specified by a ComputeNodeRequest.
9    #[endpoint(
10        method = POST,
11        path = "/compute/v2/compute",
12        name = "compute",
13        produces = conjure_http::server::StdResponseSerializer
14    )]
15    fn compute(
16        &self,
17        #[auth]
18        auth_: conjure_object::BearerToken,
19        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
20        request: super::super::super::super::super::objects::scout::compute::api::ComputeNodeRequest,
21    ) -> Result<
22        super::super::super::super::super::objects::scout::compute::api::ComputeNodeResponse,
23        conjure_http::private::Error,
24    >;
25    /// Computes the output of the compute graph specified by a ParameterizedComputeNodeRequest. A parameterized
26    /// compute request supports multiple values for a single variable, supplied by the ParameterizedContext.
27    /// Results are returned in the same order of the request.
28    #[endpoint(
29        method = POST,
30        path = "/compute/v2/compute/parameterized",
31        name = "parameterizedCompute",
32        produces = conjure_http::server::StdResponseSerializer
33    )]
34    fn parameterized_compute(
35        &self,
36        #[auth]
37        auth_: conjure_object::BearerToken,
38        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
39        request: super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeRequest,
40    ) -> Result<
41        super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeResponse,
42        conjure_http::private::Error,
43    >;
44    /// Returns the resulting unit for the output of a compute graph. If the resulting unit is equivalent to exactly
45    /// one existing unit in the system, it will be returned (for example, a series in Coulombs divided by a series
46    /// in Volts will return an output of Farads). If the output does not have units (for example, a range output,)
47    /// the unit result will return noUnitAvailable, and if the computation was not successful, corresponding errors
48    /// are returned.
49    #[endpoint(
50        method = POST,
51        path = "/compute/v2/compute/units",
52        name = "computeUnits",
53        produces = conjure_http::server::StdResponseSerializer
54    )]
55    fn compute_units(
56        &self,
57        #[auth]
58        auth_: conjure_object::BearerToken,
59        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
60        request: super::super::super::super::super::objects::scout::compute::api::ComputeUnitsRequest,
61    ) -> Result<
62        super::super::super::super::super::objects::scout::compute::api::ComputeUnitResult,
63        conjure_http::private::Error,
64    >;
65    /// Computes the output of compute graphs specified by BatchComputeNodeRequest. Results are returned in the same
66    /// order as the request.
67    #[endpoint(
68        method = POST,
69        path = "/compute/v2/compute/batch",
70        name = "batchComputeWithUnits",
71        produces = conjure_http::server::StdResponseSerializer
72    )]
73    fn batch_compute_with_units(
74        &self,
75        #[auth]
76        auth_: conjure_object::BearerToken,
77        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
78        request: super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsRequest,
79    ) -> Result<
80        super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsResponse,
81        conjure_http::private::Error,
82    >;
83    /// Same as computeUnits, however this endpoint functions on a batch of requests for wire efficiency purposes. An
84    /// extra note is that this method will serialize underlying conjure errors into the BatchComputeUnitResult type,
85    /// meaning callers are required to check for errors explicitly (rather than relying on exceptions being thrown).
86    #[endpoint(
87        method = POST,
88        path = "/compute/v2/compute/batch-units",
89        name = "batchComputeUnits",
90        produces = conjure_http::server::StdResponseSerializer
91    )]
92    fn batch_compute_units(
93        &self,
94        #[auth]
95        auth_: conjure_object::BearerToken,
96        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
97        request: super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitsRequest,
98    ) -> Result<
99        super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitResult,
100        conjure_http::private::Error,
101    >;
102    /// Computes the output of the compute graph specified by a ComputeNodeRequest, as well as providing the resulting
103    /// unit for the output of a compute graph. If the resulting unit is equivalent to exactly one existing unit in the
104    /// system, it will be returned (for example, a series in Coulombs divided by a series in Volts will return an
105    /// output of Farads). If the output does not have units (for example, a range output,) the unit result will return
106    /// noUnitAvailable, and if the computation was not successful, corresponding errors are returned.
107    #[endpoint(
108        method = POST,
109        path = "/compute/v2/computeWithUnits",
110        name = "computeWithUnits",
111        produces = conjure_http::server::StdResponseSerializer
112    )]
113    fn compute_with_units(
114        &self,
115        #[auth]
116        auth_: conjure_object::BearerToken,
117        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
118        request: super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsRequest,
119    ) -> Result<
120        super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsResponse,
121        conjure_http::private::Error,
122    >;
123    /// Best-effort cancellation of active compute requests. Each ID should be the request ID that
124    /// the client originally passed when starting the request. A single request may correspond to
125    /// one or more underlying operations, all of which will be cancelled.
126    #[endpoint(
127        method = POST,
128        path = "/compute/v2/compute/batch/kill",
129        name = "batchKillRequests"
130    )]
131    fn batch_kill_requests(
132        &self,
133        #[auth]
134        auth_: conjure_object::BearerToken,
135        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
136        request: super::super::super::super::super::objects::scout::compute::api::BatchKillRequestsRequest,
137    ) -> Result<(), conjure_http::private::Error>;
138    /// Returns a point-in-time snapshot of progress for the given active compute requests. Each
139    /// ID should be the request ID that the client originally passed when starting the request.
140    /// Intended to be polled (roughly once per second) for requests that have been running
141    /// longer than the slow-query threshold.
142    ///
143    /// A request with no active queries is not necessarily finished: its underlying queries may
144    /// not have started yet, the request may be in a post-processing phase, or the request's
145    /// work may be executed somewhere that does not report progress — in which case it stays
146    /// inactive for its entire duration. Clients should derive progress from the raw row
147    /// counters and must not assume monotonicity, since totalRowsApprox can grow while a
148    /// request runs.
149    #[endpoint(
150        method = POST,
151        path = "/compute/v2/compute/batch/progress",
152        name = "batchGetRequestProgress",
153        produces = conjure_http::server::StdResponseSerializer
154    )]
155    fn batch_get_request_progress(
156        &self,
157        #[auth]
158        auth_: conjure_object::BearerToken,
159        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
160        request: super::super::super::super::super::objects::scout::compute::api::BatchGetRequestProgressRequest,
161    ) -> Result<
162        super::super::super::super::super::objects::scout::compute::api::BatchGetRequestProgressResponse,
163        conjure_http::private::Error,
164    >;
165    /// Returns the calling user's compute quota usage for their current organization, one entry
166    /// per quota window. Returns no intervals when quotas are not enabled for the organization.
167    #[endpoint(
168        method = GET,
169        path = "/compute/v2/compute/quota/usage",
170        name = "getQuotaUsage",
171        produces = conjure_http::server::StdResponseSerializer
172    )]
173    fn get_quota_usage(
174        &self,
175        #[auth]
176        auth_: conjure_object::BearerToken,
177    ) -> Result<
178        super::super::super::super::super::objects::scout::compute::api::GetQuotaUsageResponse,
179        conjure_http::private::Error,
180    >;
181}
182/// The Compute Service provides the ability to compute the output of compute graphs.
183#[conjure_http::conjure_endpoints(
184    name = "ComputeService",
185    use_legacy_error_serialization
186)]
187pub trait AsyncComputeService {
188    /// Computes the output of the compute graph specified by a ComputeNodeRequest.
189    #[endpoint(
190        method = POST,
191        path = "/compute/v2/compute",
192        name = "compute",
193        produces = conjure_http::server::StdResponseSerializer
194    )]
195    async fn compute(
196        &self,
197        #[auth]
198        auth_: conjure_object::BearerToken,
199        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
200        request: super::super::super::super::super::objects::scout::compute::api::ComputeNodeRequest,
201    ) -> Result<
202        super::super::super::super::super::objects::scout::compute::api::ComputeNodeResponse,
203        conjure_http::private::Error,
204    >;
205    /// Computes the output of the compute graph specified by a ParameterizedComputeNodeRequest. A parameterized
206    /// compute request supports multiple values for a single variable, supplied by the ParameterizedContext.
207    /// Results are returned in the same order of the request.
208    #[endpoint(
209        method = POST,
210        path = "/compute/v2/compute/parameterized",
211        name = "parameterizedCompute",
212        produces = conjure_http::server::StdResponseSerializer
213    )]
214    async fn parameterized_compute(
215        &self,
216        #[auth]
217        auth_: conjure_object::BearerToken,
218        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
219        request: super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeRequest,
220    ) -> Result<
221        super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeResponse,
222        conjure_http::private::Error,
223    >;
224    /// Returns the resulting unit for the output of a compute graph. If the resulting unit is equivalent to exactly
225    /// one existing unit in the system, it will be returned (for example, a series in Coulombs divided by a series
226    /// in Volts will return an output of Farads). If the output does not have units (for example, a range output,)
227    /// the unit result will return noUnitAvailable, and if the computation was not successful, corresponding errors
228    /// are returned.
229    #[endpoint(
230        method = POST,
231        path = "/compute/v2/compute/units",
232        name = "computeUnits",
233        produces = conjure_http::server::StdResponseSerializer
234    )]
235    async fn compute_units(
236        &self,
237        #[auth]
238        auth_: conjure_object::BearerToken,
239        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
240        request: super::super::super::super::super::objects::scout::compute::api::ComputeUnitsRequest,
241    ) -> Result<
242        super::super::super::super::super::objects::scout::compute::api::ComputeUnitResult,
243        conjure_http::private::Error,
244    >;
245    /// Computes the output of compute graphs specified by BatchComputeNodeRequest. Results are returned in the same
246    /// order as the request.
247    #[endpoint(
248        method = POST,
249        path = "/compute/v2/compute/batch",
250        name = "batchComputeWithUnits",
251        produces = conjure_http::server::StdResponseSerializer
252    )]
253    async fn batch_compute_with_units(
254        &self,
255        #[auth]
256        auth_: conjure_object::BearerToken,
257        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
258        request: super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsRequest,
259    ) -> Result<
260        super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsResponse,
261        conjure_http::private::Error,
262    >;
263    /// Same as computeUnits, however this endpoint functions on a batch of requests for wire efficiency purposes. An
264    /// extra note is that this method will serialize underlying conjure errors into the BatchComputeUnitResult type,
265    /// meaning callers are required to check for errors explicitly (rather than relying on exceptions being thrown).
266    #[endpoint(
267        method = POST,
268        path = "/compute/v2/compute/batch-units",
269        name = "batchComputeUnits",
270        produces = conjure_http::server::StdResponseSerializer
271    )]
272    async fn batch_compute_units(
273        &self,
274        #[auth]
275        auth_: conjure_object::BearerToken,
276        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
277        request: super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitsRequest,
278    ) -> Result<
279        super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitResult,
280        conjure_http::private::Error,
281    >;
282    /// Computes the output of the compute graph specified by a ComputeNodeRequest, as well as providing the resulting
283    /// unit for the output of a compute graph. If the resulting unit is equivalent to exactly one existing unit in the
284    /// system, it will be returned (for example, a series in Coulombs divided by a series in Volts will return an
285    /// output of Farads). If the output does not have units (for example, a range output,) the unit result will return
286    /// noUnitAvailable, and if the computation was not successful, corresponding errors are returned.
287    #[endpoint(
288        method = POST,
289        path = "/compute/v2/computeWithUnits",
290        name = "computeWithUnits",
291        produces = conjure_http::server::StdResponseSerializer
292    )]
293    async fn compute_with_units(
294        &self,
295        #[auth]
296        auth_: conjure_object::BearerToken,
297        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
298        request: super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsRequest,
299    ) -> Result<
300        super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsResponse,
301        conjure_http::private::Error,
302    >;
303    /// Best-effort cancellation of active compute requests. Each ID should be the request ID that
304    /// the client originally passed when starting the request. A single request may correspond to
305    /// one or more underlying operations, all of which will be cancelled.
306    #[endpoint(
307        method = POST,
308        path = "/compute/v2/compute/batch/kill",
309        name = "batchKillRequests"
310    )]
311    async fn batch_kill_requests(
312        &self,
313        #[auth]
314        auth_: conjure_object::BearerToken,
315        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
316        request: super::super::super::super::super::objects::scout::compute::api::BatchKillRequestsRequest,
317    ) -> Result<(), conjure_http::private::Error>;
318    /// Returns a point-in-time snapshot of progress for the given active compute requests. Each
319    /// ID should be the request ID that the client originally passed when starting the request.
320    /// Intended to be polled (roughly once per second) for requests that have been running
321    /// longer than the slow-query threshold.
322    ///
323    /// A request with no active queries is not necessarily finished: its underlying queries may
324    /// not have started yet, the request may be in a post-processing phase, or the request's
325    /// work may be executed somewhere that does not report progress — in which case it stays
326    /// inactive for its entire duration. Clients should derive progress from the raw row
327    /// counters and must not assume monotonicity, since totalRowsApprox can grow while a
328    /// request runs.
329    #[endpoint(
330        method = POST,
331        path = "/compute/v2/compute/batch/progress",
332        name = "batchGetRequestProgress",
333        produces = conjure_http::server::StdResponseSerializer
334    )]
335    async fn batch_get_request_progress(
336        &self,
337        #[auth]
338        auth_: conjure_object::BearerToken,
339        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
340        request: super::super::super::super::super::objects::scout::compute::api::BatchGetRequestProgressRequest,
341    ) -> Result<
342        super::super::super::super::super::objects::scout::compute::api::BatchGetRequestProgressResponse,
343        conjure_http::private::Error,
344    >;
345    /// Returns the calling user's compute quota usage for their current organization, one entry
346    /// per quota window. Returns no intervals when quotas are not enabled for the organization.
347    #[endpoint(
348        method = GET,
349        path = "/compute/v2/compute/quota/usage",
350        name = "getQuotaUsage",
351        produces = conjure_http::server::StdResponseSerializer
352    )]
353    async fn get_quota_usage(
354        &self,
355        #[auth]
356        auth_: conjure_object::BearerToken,
357    ) -> Result<
358        super::super::super::super::super::objects::scout::compute::api::GetQuotaUsageResponse,
359        conjure_http::private::Error,
360    >;
361}
362/// The Compute Service provides the ability to compute the output of compute graphs.
363#[conjure_http::conjure_endpoints(
364    name = "ComputeService",
365    use_legacy_error_serialization,
366    local
367)]
368pub trait LocalAsyncComputeService {
369    /// Computes the output of the compute graph specified by a ComputeNodeRequest.
370    #[endpoint(
371        method = POST,
372        path = "/compute/v2/compute",
373        name = "compute",
374        produces = conjure_http::server::StdResponseSerializer
375    )]
376    async fn compute(
377        &self,
378        #[auth]
379        auth_: conjure_object::BearerToken,
380        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
381        request: super::super::super::super::super::objects::scout::compute::api::ComputeNodeRequest,
382    ) -> Result<
383        super::super::super::super::super::objects::scout::compute::api::ComputeNodeResponse,
384        conjure_http::private::Error,
385    >;
386    /// Computes the output of the compute graph specified by a ParameterizedComputeNodeRequest. A parameterized
387    /// compute request supports multiple values for a single variable, supplied by the ParameterizedContext.
388    /// Results are returned in the same order of the request.
389    #[endpoint(
390        method = POST,
391        path = "/compute/v2/compute/parameterized",
392        name = "parameterizedCompute",
393        produces = conjure_http::server::StdResponseSerializer
394    )]
395    async fn parameterized_compute(
396        &self,
397        #[auth]
398        auth_: conjure_object::BearerToken,
399        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
400        request: super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeRequest,
401    ) -> Result<
402        super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeResponse,
403        conjure_http::private::Error,
404    >;
405    /// Returns the resulting unit for the output of a compute graph. If the resulting unit is equivalent to exactly
406    /// one existing unit in the system, it will be returned (for example, a series in Coulombs divided by a series
407    /// in Volts will return an output of Farads). If the output does not have units (for example, a range output,)
408    /// the unit result will return noUnitAvailable, and if the computation was not successful, corresponding errors
409    /// are returned.
410    #[endpoint(
411        method = POST,
412        path = "/compute/v2/compute/units",
413        name = "computeUnits",
414        produces = conjure_http::server::StdResponseSerializer
415    )]
416    async fn compute_units(
417        &self,
418        #[auth]
419        auth_: conjure_object::BearerToken,
420        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
421        request: super::super::super::super::super::objects::scout::compute::api::ComputeUnitsRequest,
422    ) -> Result<
423        super::super::super::super::super::objects::scout::compute::api::ComputeUnitResult,
424        conjure_http::private::Error,
425    >;
426    /// Computes the output of compute graphs specified by BatchComputeNodeRequest. Results are returned in the same
427    /// order as the request.
428    #[endpoint(
429        method = POST,
430        path = "/compute/v2/compute/batch",
431        name = "batchComputeWithUnits",
432        produces = conjure_http::server::StdResponseSerializer
433    )]
434    async fn batch_compute_with_units(
435        &self,
436        #[auth]
437        auth_: conjure_object::BearerToken,
438        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
439        request: super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsRequest,
440    ) -> Result<
441        super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsResponse,
442        conjure_http::private::Error,
443    >;
444    /// Same as computeUnits, however this endpoint functions on a batch of requests for wire efficiency purposes. An
445    /// extra note is that this method will serialize underlying conjure errors into the BatchComputeUnitResult type,
446    /// meaning callers are required to check for errors explicitly (rather than relying on exceptions being thrown).
447    #[endpoint(
448        method = POST,
449        path = "/compute/v2/compute/batch-units",
450        name = "batchComputeUnits",
451        produces = conjure_http::server::StdResponseSerializer
452    )]
453    async fn batch_compute_units(
454        &self,
455        #[auth]
456        auth_: conjure_object::BearerToken,
457        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
458        request: super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitsRequest,
459    ) -> Result<
460        super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitResult,
461        conjure_http::private::Error,
462    >;
463    /// Computes the output of the compute graph specified by a ComputeNodeRequest, as well as providing the resulting
464    /// unit for the output of a compute graph. If the resulting unit is equivalent to exactly one existing unit in the
465    /// system, it will be returned (for example, a series in Coulombs divided by a series in Volts will return an
466    /// output of Farads). If the output does not have units (for example, a range output,) the unit result will return
467    /// noUnitAvailable, and if the computation was not successful, corresponding errors are returned.
468    #[endpoint(
469        method = POST,
470        path = "/compute/v2/computeWithUnits",
471        name = "computeWithUnits",
472        produces = conjure_http::server::StdResponseSerializer
473    )]
474    async fn compute_with_units(
475        &self,
476        #[auth]
477        auth_: conjure_object::BearerToken,
478        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
479        request: super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsRequest,
480    ) -> Result<
481        super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsResponse,
482        conjure_http::private::Error,
483    >;
484    /// Best-effort cancellation of active compute requests. Each ID should be the request ID that
485    /// the client originally passed when starting the request. A single request may correspond to
486    /// one or more underlying operations, all of which will be cancelled.
487    #[endpoint(
488        method = POST,
489        path = "/compute/v2/compute/batch/kill",
490        name = "batchKillRequests"
491    )]
492    async fn batch_kill_requests(
493        &self,
494        #[auth]
495        auth_: conjure_object::BearerToken,
496        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
497        request: super::super::super::super::super::objects::scout::compute::api::BatchKillRequestsRequest,
498    ) -> Result<(), conjure_http::private::Error>;
499    /// Returns a point-in-time snapshot of progress for the given active compute requests. Each
500    /// ID should be the request ID that the client originally passed when starting the request.
501    /// Intended to be polled (roughly once per second) for requests that have been running
502    /// longer than the slow-query threshold.
503    ///
504    /// A request with no active queries is not necessarily finished: its underlying queries may
505    /// not have started yet, the request may be in a post-processing phase, or the request's
506    /// work may be executed somewhere that does not report progress — in which case it stays
507    /// inactive for its entire duration. Clients should derive progress from the raw row
508    /// counters and must not assume monotonicity, since totalRowsApprox can grow while a
509    /// request runs.
510    #[endpoint(
511        method = POST,
512        path = "/compute/v2/compute/batch/progress",
513        name = "batchGetRequestProgress",
514        produces = conjure_http::server::StdResponseSerializer
515    )]
516    async fn batch_get_request_progress(
517        &self,
518        #[auth]
519        auth_: conjure_object::BearerToken,
520        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
521        request: super::super::super::super::super::objects::scout::compute::api::BatchGetRequestProgressRequest,
522    ) -> Result<
523        super::super::super::super::super::objects::scout::compute::api::BatchGetRequestProgressResponse,
524        conjure_http::private::Error,
525    >;
526    /// Returns the calling user's compute quota usage for their current organization, one entry
527    /// per quota window. Returns no intervals when quotas are not enabled for the organization.
528    #[endpoint(
529        method = GET,
530        path = "/compute/v2/compute/quota/usage",
531        name = "getQuotaUsage",
532        produces = conjure_http::server::StdResponseSerializer
533    )]
534    async fn get_quota_usage(
535        &self,
536        #[auth]
537        auth_: conjure_object::BearerToken,
538    ) -> Result<
539        super::super::super::super::super::objects::scout::compute::api::GetQuotaUsageResponse,
540        conjure_http::private::Error,
541    >;
542}