Line data Source code
1 : use compute_api::responses::ComputeStatusResponse;
2 :
3 : use crate::compute::ComputeState;
4 :
5 : pub(in crate::http) mod check_writability;
6 : pub(in crate::http) mod configure;
7 : pub(in crate::http) mod database_schema;
8 : pub(in crate::http) mod dbs_and_roles;
9 : pub(in crate::http) mod extension_server;
10 : pub(in crate::http) mod extensions;
11 : pub(in crate::http) mod failpoints;
12 : pub(in crate::http) mod grants;
13 : pub(in crate::http) mod insights;
14 : pub(in crate::http) mod metrics;
15 : pub(in crate::http) mod metrics_json;
16 : pub(in crate::http) mod status;
17 : pub(in crate::http) mod terminate;
18 :
19 : impl From<&ComputeState> for ComputeStatusResponse {
20 0 : fn from(state: &ComputeState) -> Self {
21 0 : ComputeStatusResponse {
22 0 : start_time: state.start_time,
23 0 : tenant: state
24 0 : .pspec
25 0 : .as_ref()
26 0 : .map(|pspec| pspec.tenant_id.to_string()),
27 0 : timeline: state
28 0 : .pspec
29 0 : .as_ref()
30 0 : .map(|pspec| pspec.timeline_id.to_string()),
31 0 : status: state.status,
32 0 : last_active: state.last_active,
33 0 : error: state.error.clone(),
34 0 : }
35 0 : }
36 : }
|