talos-api-rs 0.2.0

A typed, async, idiomatic Rust client for the Talos Linux gRPC API
Documentation
// SPDX-License-Identifier: MIT OR Apache-2.0
// DO NOT EDIT
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Error {
    #[prost(enumeration = "Code", tag = "1")]
    pub code: i32,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "3")]
    pub details: ::prost::alloc::vec::Vec<::prost_types::Any>,
}
/// Common metadata message nested in all reply message types
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Metadata {
    /// hostname of the server response comes from (injected by proxy)
    #[prost(string, tag = "1")]
    pub hostname: ::prost::alloc::string::String,
    /// error is set if request failed to the upstream (rest of response is
    /// undefined)
    #[prost(string, tag = "2")]
    pub error: ::prost::alloc::string::String,
    /// error as gRPC Status
    #[prost(message, optional, tag = "3")]
    pub status: ::core::option::Option<super::google::rpc::Status>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Data {
    #[prost(message, optional, tag = "1")]
    pub metadata: ::core::option::Option<Metadata>,
    #[prost(bytes = "vec", tag = "2")]
    pub bytes: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataResponse {
    #[prost(message, repeated, tag = "1")]
    pub messages: ::prost::alloc::vec::Vec<Data>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Empty {
    #[prost(message, optional, tag = "1")]
    pub metadata: ::core::option::Option<Metadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EmptyResponse {
    #[prost(message, repeated, tag = "1")]
    pub messages: ::prost::alloc::vec::Vec<Empty>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Url {
    #[prost(string, tag = "1")]
    pub full_path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PemEncodedCertificateAndKey {
    #[prost(bytes = "vec", tag = "1")]
    pub crt: ::prost::alloc::vec::Vec<u8>,
    #[prost(bytes = "vec", tag = "2")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PemEncodedKey {
    #[prost(bytes = "vec", tag = "1")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PemEncodedCertificate {
    #[prost(bytes = "vec", tag = "1")]
    pub crt: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NetIp {
    #[prost(bytes = "vec", tag = "1")]
    pub ip: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NetIpPort {
    #[prost(bytes = "vec", tag = "1")]
    pub ip: ::prost::alloc::vec::Vec<u8>,
    #[prost(int32, tag = "2")]
    pub port: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NetIpPrefix {
    #[prost(bytes = "vec", tag = "1")]
    pub ip: ::prost::alloc::vec::Vec<u8>,
    #[prost(int32, tag = "2")]
    pub prefix_length: i32,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Code {
    Fatal = 0,
    Locked = 1,
    Canceled = 2,
}
impl Code {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Fatal => "FATAL",
            Self::Locked => "LOCKED",
            Self::Canceled => "CANCELED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "FATAL" => Some(Self::Fatal),
            "LOCKED" => Some(Self::Locked),
            "CANCELED" => Some(Self::Canceled),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ContainerDriver {
    Containerd = 0,
    Cri = 1,
}
impl ContainerDriver {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Containerd => "CONTAINERD",
            Self::Cri => "CRI",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CONTAINERD" => Some(Self::Containerd),
            "CRI" => Some(Self::Cri),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ContainerdNamespace {
    NsUnknown = 0,
    NsSystem = 1,
    NsCri = 2,
}
impl ContainerdNamespace {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::NsUnknown => "NS_UNKNOWN",
            Self::NsSystem => "NS_SYSTEM",
            Self::NsCri => "NS_CRI",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "NS_UNKNOWN" => Some(Self::NsUnknown),
            "NS_SYSTEM" => Some(Self::NsSystem),
            "NS_CRI" => Some(Self::NsCri),
            _ => None,
        }
    }
}