Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace a downstairs via a new VCR #863

Merged
merged 10 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 39 additions & 23 deletions crucible-client-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,45 @@ use uuid::Uuid;
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum VolumeConstructionRequest {
Volume {
id: Uuid,
block_size: u64,
sub_volumes: Vec<VolumeConstructionRequest>,
read_only_parent: Option<Box<VolumeConstructionRequest>>,
},
Url {
id: Uuid,
block_size: u64,
url: String,
},
Region {
block_size: u64,
blocks_per_extent: u64,
extent_count: u32,
opts: CrucibleOpts,
gen: u64,
},
File {
id: Uuid,
block_size: u64,
path: String,
},
Volume(VcrVolume),
Url(VcrUrl),
Region(VcrRegion),
File(VcrFile),
}

#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
#[serde(tag = "vcr_type", rename_all = "snake_case")]
pub struct VcrVolume {
pub id: Uuid,
pub block_size: u64,
pub sub_volumes: Vec<VolumeConstructionRequest>,
pub read_only_parent: Option<Box<VolumeConstructionRequest>>,
}

#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
#[serde(tag = "vcr_type", rename_all = "snake_case")]
pub struct VcrUrl {
pub id: Uuid,
pub block_size: u64,
pub url: String,
}

#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
#[serde(tag = "vcr_type", rename_all = "snake_case")]
pub struct VcrRegion {
pub block_size: u64,
pub blocks_per_extent: u64,
pub extent_count: u32,
pub opts: CrucibleOpts,
pub gen: u64,
}

#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
#[serde(tag = "vcr_type", rename_all = "snake_case")]
pub struct VcrFile {
pub id: Uuid,
pub block_size: u64,
pub path: String,
}

#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down
Loading
Loading