#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Disk {
#[prost(uint64, tag = "1")]
pub size: u64,
#[prost(string, tag = "2")]
pub model: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub device_name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub serial: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub modalias: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub uuid: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub wwid: ::prost::alloc::string::String,
#[prost(enumeration = "disk::DiskType", tag = "9")]
pub r#type: i32,
#[prost(string, tag = "10")]
pub bus_path: ::prost::alloc::string::String,
#[prost(bool, tag = "11")]
pub system_disk: bool,
#[prost(string, tag = "12")]
pub subsystem: ::prost::alloc::string::String,
#[prost(bool, tag = "13")]
pub readonly: bool,
}
pub mod disk {
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DiskType {
Unknown = 0,
Ssd = 1,
Hdd = 2,
Nvme = 3,
Sd = 4,
Cd = 5,
}
impl DiskType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::Ssd => "SSD",
Self::Hdd => "HDD",
Self::Nvme => "NVME",
Self::Sd => "SD",
Self::Cd => "CD",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"SSD" => Some(Self::Ssd),
"HDD" => Some(Self::Hdd),
"NVME" => Some(Self::Nvme),
"SD" => Some(Self::Sd),
"CD" => Some(Self::Cd),
_ => None,
}
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Disks {
#[prost(message, optional, tag = "1")]
pub metadata: ::core::option::Option<super::common::Metadata>,
#[prost(message, repeated, tag = "2")]
pub disks: ::prost::alloc::vec::Vec<Disk>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DisksResponse {
#[prost(message, repeated, tag = "1")]
pub messages: ::prost::alloc::vec::Vec<Disks>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockDeviceWipeRequest {
#[prost(message, repeated, tag = "1")]
pub devices: ::prost::alloc::vec::Vec<BlockDeviceWipeDescriptor>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockDeviceWipeDescriptor {
#[prost(string, tag = "1")]
pub device: ::prost::alloc::string::String,
#[prost(enumeration = "block_device_wipe_descriptor::Method", tag = "2")]
pub method: i32,
#[prost(bool, tag = "3")]
pub skip_volume_check: bool,
#[prost(bool, tag = "4")]
pub drop_partition: bool,
}
pub mod block_device_wipe_descriptor {
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Method {
Fast = 0,
Zeroes = 1,
}
impl Method {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Fast => "FAST",
Self::Zeroes => "ZEROES",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FAST" => Some(Self::Fast),
"ZEROES" => Some(Self::Zeroes),
_ => None,
}
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockDeviceWipeResponse {
#[prost(message, repeated, tag = "1")]
pub messages: ::prost::alloc::vec::Vec<BlockDeviceWipe>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockDeviceWipe {
#[prost(message, optional, tag = "1")]
pub metadata: ::core::option::Option<super::common::Metadata>,
}
pub mod storage_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct StorageServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl StorageServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> StorageServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> StorageServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
StorageServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn disks(
&mut self,
request: impl tonic::IntoRequest<super::super::google::protobuf::Empty>,
) -> std::result::Result<tonic::Response<super::DisksResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/storage.StorageService/Disks",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("storage.StorageService", "Disks"));
self.inner.unary(req, path, codec).await
}
pub async fn block_device_wipe(
&mut self,
request: impl tonic::IntoRequest<super::BlockDeviceWipeRequest>,
) -> std::result::Result<
tonic::Response<super::BlockDeviceWipeResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/storage.StorageService/BlockDeviceWipe",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("storage.StorageService", "BlockDeviceWipe"));
self.inner.unary(req, path, codec).await
}
}
}