Skip to main content

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