Skip to main content

nominal_api/conjure/clients/scout/datasource/connection/
connection_bootstrapper_service.rs

1use conjure_http::endpoint;
2/// Nominal periodically scrapes connected databases (Connections) in order to maintain a database of all
3/// series that can be read from that database. This service is responsible for executing the scrape, and can
4/// be used manually to trigger a rescrape for any reason (for example, when updating a schema).
5#[conjure_http::conjure_client(name = "ConnectionBootstrapperService")]
6pub trait ConnectionBootstrapperService<
7    #[response_body]
8    I: Iterator<
9            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
10        >,
11> {
12    /// Populates the connection with series, by querying within the requested time range. If start or end are both omitted,
13    /// will query the last 7 days by default. If one of start or end is omitted, will query a 7 day range from the provided
14    /// start or end. Will throw if the requested range is larger than 30 days.
15    #[endpoint(
16        method = POST,
17        path = "/data-source/connection/v1/{rid}/populateSeries",
18        name = "populateSeries",
19        accept = conjure_http::client::conjure::EmptyResponseDeserializer
20    )]
21    fn populate_series(
22        &self,
23        #[auth]
24        auth_: &conjure_object::BearerToken,
25        #[path(name = "rid", encoder = conjure_http::client::conjure::PlainEncoder)]
26        rid: &super::super::super::super::super::objects::scout::datasource::connection::api::ConnectionRid,
27        #[body(serializer = conjure_http::client::StdRequestSerializer)]
28        request: &super::super::super::super::super::objects::scout::datasource::connection::api::PopulateSeriesRequest,
29    ) -> Result<(), conjure_http::private::Error>;
30}
31/// Nominal periodically scrapes connected databases (Connections) in order to maintain a database of all
32/// series that can be read from that database. This service is responsible for executing the scrape, and can
33/// be used manually to trigger a rescrape for any reason (for example, when updating a schema).
34#[conjure_http::conjure_client(name = "ConnectionBootstrapperService")]
35pub trait AsyncConnectionBootstrapperService<
36    #[response_body]
37    I: conjure_http::private::Stream<
38            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
39        >,
40> {
41    /// Populates the connection with series, by querying within the requested time range. If start or end are both omitted,
42    /// will query the last 7 days by default. If one of start or end is omitted, will query a 7 day range from the provided
43    /// start or end. Will throw if the requested range is larger than 30 days.
44    #[endpoint(
45        method = POST,
46        path = "/data-source/connection/v1/{rid}/populateSeries",
47        name = "populateSeries",
48        accept = conjure_http::client::conjure::EmptyResponseDeserializer
49    )]
50    async fn populate_series(
51        &self,
52        #[auth]
53        auth_: &conjure_object::BearerToken,
54        #[path(name = "rid", encoder = conjure_http::client::conjure::PlainEncoder)]
55        rid: &super::super::super::super::super::objects::scout::datasource::connection::api::ConnectionRid,
56        #[body(serializer = conjure_http::client::StdRequestSerializer)]
57        request: &super::super::super::super::super::objects::scout::datasource::connection::api::PopulateSeriesRequest,
58    ) -> Result<(), conjure_http::private::Error>;
59}
60/// Nominal periodically scrapes connected databases (Connections) in order to maintain a database of all
61/// series that can be read from that database. This service is responsible for executing the scrape, and can
62/// be used manually to trigger a rescrape for any reason (for example, when updating a schema).
63#[conjure_http::conjure_client(name = "ConnectionBootstrapperService", local)]
64pub trait LocalAsyncConnectionBootstrapperService<
65    #[response_body]
66    I: conjure_http::private::Stream<
67            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
68        >,
69> {
70    /// Populates the connection with series, by querying within the requested time range. If start or end are both omitted,
71    /// will query the last 7 days by default. If one of start or end is omitted, will query a 7 day range from the provided
72    /// start or end. Will throw if the requested range is larger than 30 days.
73    #[endpoint(
74        method = POST,
75        path = "/data-source/connection/v1/{rid}/populateSeries",
76        name = "populateSeries",
77        accept = conjure_http::client::conjure::EmptyResponseDeserializer
78    )]
79    async fn populate_series(
80        &self,
81        #[auth]
82        auth_: &conjure_object::BearerToken,
83        #[path(name = "rid", encoder = conjure_http::client::conjure::PlainEncoder)]
84        rid: &super::super::super::super::super::objects::scout::datasource::connection::api::ConnectionRid,
85        #[body(serializer = conjure_http::client::StdRequestSerializer)]
86        request: &super::super::super::super::super::objects::scout::datasource::connection::api::PopulateSeriesRequest,
87    ) -> Result<(), conjure_http::private::Error>;
88}