22// License, v. 2.0. If a copy of the MPL was not distributed with this
33// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44
5- use clickhouse_admin_types:: {
6- ClickhouseKeeperClusterMembership , DistributedDdlQueue ,
7- GenerateConfigResult , KeeperConf , KeeperConfigurableSettings , Lgif ,
8- MetricInfoPath , RaftConfig , ServerConfigurableSettings , SystemTimeSeries ,
9- TimeSeriesSettingsQuery ,
10- } ;
5+ use clickhouse_admin_types_versions:: latest;
116use dropshot:: {
127 HttpError , HttpResponseCreated , HttpResponseOk ,
138 HttpResponseUpdatedNoContent , Path , Query , RequestContext , TypedBody ,
@@ -73,8 +68,11 @@ pub trait ClickhouseAdminKeeperApi {
7368 } ]
7469 async fn generate_config_and_enable_svc (
7570 rqctx : RequestContext < Self :: Context > ,
76- body : TypedBody < KeeperConfigurableSettings > ,
77- ) -> Result < HttpResponseCreated < GenerateConfigResult > , HttpError > ;
71+ body : TypedBody < latest:: keeper:: KeeperConfigurableSettings > ,
72+ ) -> Result <
73+ HttpResponseCreated < latest:: config:: GenerateConfigResult > ,
74+ HttpError ,
75+ > ;
7876
7977 /// Retrieve the generation number of a configuration
8078 #[ endpoint {
@@ -94,7 +92,7 @@ pub trait ClickhouseAdminKeeperApi {
9492 } ]
9593 async fn lgif (
9694 rqctx : RequestContext < Self :: Context > ,
97- ) -> Result < HttpResponseOk < Lgif > , HttpError > ;
95+ ) -> Result < HttpResponseOk < latest :: keeper :: Lgif > , HttpError > ;
9896
9997 /// Retrieve information from ClickHouse virtual node /keeper/config which
10098 /// contains last committed cluster configuration.
@@ -104,7 +102,7 @@ pub trait ClickhouseAdminKeeperApi {
104102 } ]
105103 async fn raft_config (
106104 rqctx : RequestContext < Self :: Context > ,
107- ) -> Result < HttpResponseOk < RaftConfig > , HttpError > ;
105+ ) -> Result < HttpResponseOk < latest :: keeper :: RaftConfig > , HttpError > ;
108106
109107 /// Retrieve configuration information from a keeper node.
110108 #[ endpoint {
@@ -113,7 +111,7 @@ pub trait ClickhouseAdminKeeperApi {
113111 } ]
114112 async fn keeper_conf (
115113 rqctx : RequestContext < Self :: Context > ,
116- ) -> Result < HttpResponseOk < KeeperConf > , HttpError > ;
114+ ) -> Result < HttpResponseOk < latest :: keeper :: KeeperConf > , HttpError > ;
117115
118116 /// Retrieve cluster membership information from a keeper node.
119117 #[ endpoint {
@@ -122,7 +120,10 @@ pub trait ClickhouseAdminKeeperApi {
122120 } ]
123121 async fn keeper_cluster_membership (
124122 rqctx : RequestContext < Self :: Context > ,
125- ) -> Result < HttpResponseOk < ClickhouseKeeperClusterMembership > , HttpError > ;
123+ ) -> Result <
124+ HttpResponseOk < latest:: keeper:: ClickhouseKeeperClusterMembership > ,
125+ HttpError ,
126+ > ;
126127}
127128
128129/// API interface for our clickhouse-admin-server server
@@ -148,8 +149,11 @@ pub trait ClickhouseAdminServerApi {
148149 } ]
149150 async fn generate_config_and_enable_svc (
150151 rqctx : RequestContext < Self :: Context > ,
151- body : TypedBody < ServerConfigurableSettings > ,
152- ) -> Result < HttpResponseCreated < GenerateConfigResult > , HttpError > ;
152+ body : TypedBody < latest:: server:: ServerConfigurableSettings > ,
153+ ) -> Result <
154+ HttpResponseCreated < latest:: config:: GenerateConfigResult > ,
155+ HttpError ,
156+ > ;
153157
154158 /// Retrieve the generation number of a configuration
155159 #[ endpoint {
@@ -168,7 +172,10 @@ pub trait ClickhouseAdminServerApi {
168172 } ]
169173 async fn distributed_ddl_queue (
170174 rqctx : RequestContext < Self :: Context > ,
171- ) -> Result < HttpResponseOk < Vec < DistributedDdlQueue > > , HttpError > ;
175+ ) -> Result <
176+ HttpResponseOk < Vec < latest:: server:: DistributedDdlQueue > > ,
177+ HttpError ,
178+ > ;
172179
173180 /// Retrieve time series from the system database.
174181 ///
@@ -181,9 +188,9 @@ pub trait ClickhouseAdminServerApi {
181188 } ]
182189 async fn system_timeseries_avg (
183190 rqctx : RequestContext < Self :: Context > ,
184- path_params : Path < MetricInfoPath > ,
185- query_params : Query < TimeSeriesSettingsQuery > ,
186- ) -> Result < HttpResponseOk < Vec < SystemTimeSeries > > , HttpError > ;
191+ path_params : Path < latest :: server :: MetricInfoPath > ,
192+ query_params : Query < latest :: server :: TimeSeriesSettingsQuery > ,
193+ ) -> Result < HttpResponseOk < Vec < latest :: server :: SystemTimeSeries > > , HttpError > ;
187194
188195 /// Idempotently initialize a replicated ClickHouse cluster database.
189196 #[ endpoint {
@@ -225,7 +232,7 @@ pub trait ClickhouseAdminSingleApi {
225232 } ]
226233 async fn system_timeseries_avg (
227234 rqctx : RequestContext < Self :: Context > ,
228- path_params : Path < MetricInfoPath > ,
229- query_params : Query < TimeSeriesSettingsQuery > ,
230- ) -> Result < HttpResponseOk < Vec < SystemTimeSeries > > , HttpError > ;
235+ path_params : Path < latest :: server :: MetricInfoPath > ,
236+ query_params : Query < latest :: server :: TimeSeriesSettingsQuery > ,
237+ ) -> Result < HttpResponseOk < Vec < latest :: server :: SystemTimeSeries > > , HttpError > ;
231238}
0 commit comments