yandex-cloud 2025.4.14

Generated gRPC clients for the Yandex Cloud API
Documentation
/// KPI (Key Performance Indicator) represents some integral indicator measured during test.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Kpi {
    /// Kind of KPI.
    #[prost(message, optional, tag = "1")]
    pub selector: ::core::option::Option<KpiSelector>,
    /// A condition that should be specified.
    #[prost(message, optional, tag = "2")]
    pub threshold: ::core::option::Option<KpiThreshold>,
}
/// KPI threshold represents a condition that an actual value of test's KPI should satisfy.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KpiThreshold {
    /// Value for comparison with an actual KPI value.
    #[prost(double, tag = "1")]
    pub value: f64,
    /// Comparison operator for comparing actual with the threshold value.
    ///
    /// Rule: actual (</<=/>/>=) reference
    #[prost(enumeration = "Comparison", tag = "2")]
    pub comparison: i32,
}
/// KPI selector.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KpiSelector {
    #[prost(oneof = "kpi_selector::Kind", tags = "1, 2, 3, 4, 5, 6, 7")]
    pub kind: ::core::option::Option<kpi_selector::Kind>,
}
/// Nested message and enum types in `KpiSelector`.
pub mod kpi_selector {
    /// Response time.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ResponseTime {
        /// Cummulative quantile (percentile).
        #[prost(enumeration = "super::super::common::QuantileType", tag = "1")]
        pub quantile: i32,
    }
    /// Aggregated number of instances.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Instances {
        /// Aggregation function.
        #[prost(enumeration = "super::Aggregation", tag = "1")]
        pub agg: i32,
    }
    /// Imbalance RPS.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ImbalanceRps {}
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ProtocolCodesAbsolute {
        /// Protocol (HTTP, GRPC) code patterns to match.
        ///
        /// All successful HTTP responses: ['2xx', '3xx'].
        /// All failed HTTP responses: ['0', '4xx', '5xx'].
        #[prost(string, repeated, tag = "1")]
        pub codes_patterns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ProtocolCodesRelative {
        /// Protocol (HTTP, GRPC) code patterns to match.
        ///
        /// All successful HTTP responses: ['2xx', '3xx'].
        /// All failed HTTP responses: ['0', '4xx', '5xx'].
        #[prost(string, repeated, tag = "1")]
        pub codes_patterns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct NetworkCodesAbsolute {
        /// Network code patterns to match.
        ///
        /// All successful network responses: \['0'\].
        /// All failed network responses: ['xx', 'xxx'].
        #[prost(string, repeated, tag = "1")]
        pub codes_patterns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct NetworkCodesRelative {
        /// Network code patterns to match.
        ///
        /// All successful network responses: \['0'\].
        /// All failed network responses: ['xx', 'xxx'].
        #[prost(string, repeated, tag = "1")]
        pub codes_patterns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Kind {
        /// Response time cummulative quantile (percentile).
        #[prost(message, tag = "1")]
        ResponseTime(ResponseTime),
        /// A number of instances throughout the test.
        #[prost(message, tag = "2")]
        Instances(Instances),
        /// An RPS at the moment the test has been auto-stopped.
        #[prost(message, tag = "3")]
        ImbalanceRps(ImbalanceRps),
        /// A total number of requests completed with certain protocol (HTTP, GRPC, etc.) codes.
        #[prost(message, tag = "4")]
        ProtocolCodesAbsolute(ProtocolCodesAbsolute),
        /// A percentage of requests completed with certain protocol (HTTP, GRPC, etc.) codes.
        #[prost(message, tag = "5")]
        ProtocolCodesRelative(ProtocolCodesRelative),
        /// A total number of requests completed with certain network codes.
        #[prost(message, tag = "6")]
        NetworkCodesAbsolute(NetworkCodesAbsolute),
        /// A percentage of requests completed with certain network codes.
        #[prost(message, tag = "7")]
        NetworkCodesRelative(NetworkCodesRelative),
    }
}
/// Aggregation function.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Aggregation {
    /// Unspecified.
    Unspecified = 0,
    /// Minimum.
    Min = 1,
    /// Maximum.
    Max = 2,
    /// Average.
    Avg = 4,
    /// Median.
    Median = 5,
    /// Standard deviation.
    StdDev = 6,
}
impl Aggregation {
    /// 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 {
            Aggregation::Unspecified => "AGGREGATION_UNSPECIFIED",
            Aggregation::Min => "AGGREGATION_MIN",
            Aggregation::Max => "AGGREGATION_MAX",
            Aggregation::Avg => "AGGREGATION_AVG",
            Aggregation::Median => "AGGREGATION_MEDIAN",
            Aggregation::StdDev => "AGGREGATION_STD_DEV",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "AGGREGATION_UNSPECIFIED" => Some(Self::Unspecified),
            "AGGREGATION_MIN" => Some(Self::Min),
            "AGGREGATION_MAX" => Some(Self::Max),
            "AGGREGATION_AVG" => Some(Self::Avg),
            "AGGREGATION_MEDIAN" => Some(Self::Median),
            "AGGREGATION_STD_DEV" => Some(Self::StdDev),
            _ => None,
        }
    }
}
/// Comparison operator.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Comparison {
    /// Unspecified.
    Unspecified = 0,
    /// Less than the specified value.
    Lt = 1,
    /// Less than or equal to the specified value.
    Lte = 2,
    /// Greater than the specified value.
    Gt = 3,
    /// Greater than or equal to the specified value.
    Gte = 4,
}
impl Comparison {
    /// 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 {
            Comparison::Unspecified => "COMPARISON_UNSPECIFIED",
            Comparison::Lt => "COMPARISON_LT",
            Comparison::Lte => "COMPARISON_LTE",
            Comparison::Gt => "COMPARISON_GT",
            Comparison::Gte => "COMPARISON_GTE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "COMPARISON_UNSPECIFIED" => Some(Self::Unspecified),
            "COMPARISON_LT" => Some(Self::Lt),
            "COMPARISON_LTE" => Some(Self::Lte),
            "COMPARISON_GT" => Some(Self::Gt),
            "COMPARISON_GTE" => Some(Self::Gte),
            _ => None,
        }
    }
}
/// An actual value of test's KPI.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KpiValue {
    /// ID of a test.
    #[prost(string, tag = "1")]
    pub test_id: ::prost::alloc::string::String,
    /// Value of KPI.
    #[prost(double, tag = "2")]
    pub value: f64,
    /// A flag indicating whether the value satisfies KPI threshold condition.
    #[prost(bool, tag = "3")]
    pub is_ok: bool,
}
/// Report status.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Status {
    /// Status is not specified.
    Unspecified = 0,
    /// Report is being collected.
    Collecting = 1,
    /// Report is being calculated.
    Calculating = 2,
    /// Report is ready.
    Ready = 3,
}
impl Status {
    /// 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 {
            Status::Unspecified => "STATUS_UNSPECIFIED",
            Status::Collecting => "COLLECTING",
            Status::Calculating => "CALCULATING",
            Status::Ready => "READY",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "COLLECTING" => Some(Self::Collecting),
            "CALCULATING" => Some(Self::Calculating),
            "READY" => Some(Self::Ready),
            _ => None,
        }
    }
}