Move pageserver control plane API types into libs/

This commit is contained in:
John Spray
2023-08-25 13:02:53 +01:00
parent 034bebcfcd
commit 5b7d3e39d6
3 changed files with 43 additions and 38 deletions

View File

@@ -0,0 +1,41 @@
/// Types in this file are for pageserver's upward-facing API calls to the control plane
use serde::{Deserialize, Serialize};
use utils::id::{NodeId, TenantId};
#[derive(Serialize, Deserialize)]
struct ReAttachRequest {
node_id: NodeId,
}
#[derive(Serialize, Deserialize)]
struct ReAttachResponseTenant {
id: TenantId,
generation: u32,
}
#[derive(Serialize, Deserialize)]
struct ReAttachResponse {
tenants: Vec<ReAttachResponseTenant>,
}
#[derive(Serialize, Deserialize)]
struct ValidateRequestTenant {
id: TenantId,
gen: u32,
}
#[derive(Serialize, Deserialize)]
struct ValidateRequest {
tenants: Vec<ValidateRequestTenant>,
}
#[derive(Serialize, Deserialize)]
struct ValidateResponse {
tenants: Vec<ValidateResponseTenant>,
}
#[derive(Serialize, Deserialize)]
struct ValidateResponseTenant {
id: TenantId,
valid: bool,
}

View File

@@ -1,6 +1,7 @@
use const_format::formatcp;
/// Public API types
pub mod control_api;
pub mod models;
pub mod reltag;