#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SliFilter {
#[prost(message, optional, tag = "1")]
pub field: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "CompareType", tag = "2")]
pub compare_type: i32,
#[prost(message, repeated, tag = "3")]
pub field_values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LatencySli {
#[prost(message, optional, tag = "1")]
pub threshold_microseconds: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "ThresholdSymbol", tag = "2")]
pub threshold_symbol: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ErrorSli {}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceSlo {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub service_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "SloStatus", tag = "4")]
pub status: i32,
#[prost(message, optional, tag = "5")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub target_percentage: ::core::option::Option<u32>,
#[prost(message, optional, tag = "7")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub remaining_error_budget_percentage: ::core::option::Option<u32>,
#[prost(message, repeated, tag = "11")]
pub filters: ::prost::alloc::vec::Vec<SliFilter>,
#[prost(enumeration = "SloPeriod", tag = "12")]
pub period: i32,
#[prost(oneof = "service_slo::SliType", tags = "9, 10")]
pub sli_type: ::core::option::Option<service_slo::SliType>,
}
pub mod service_slo {
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SliType {
#[prost(message, tag = "9")]
LatencySli(super::LatencySli),
#[prost(message, tag = "10")]
ErrorSli(super::ErrorSli),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CompareType {
Unspecified = 0,
Is = 1,
StartWith = 2,
EndsWith = 3,
Includes = 4,
}
impl CompareType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "COMPARE_TYPE_UNSPECIFIED",
Self::Is => "COMPARE_TYPE_IS",
Self::StartWith => "COMPARE_TYPE_START_WITH",
Self::EndsWith => "COMPARE_TYPE_ENDS_WITH",
Self::Includes => "COMPARE_TYPE_INCLUDES",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COMPARE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"COMPARE_TYPE_IS" => Some(Self::Is),
"COMPARE_TYPE_START_WITH" => Some(Self::StartWith),
"COMPARE_TYPE_ENDS_WITH" => Some(Self::EndsWith),
"COMPARE_TYPE_INCLUDES" => Some(Self::Includes),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SloStatus {
Unspecified = 0,
Ok = 1,
Breached = 2,
}
impl SloStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SLO_STATUS_UNSPECIFIED",
Self::Ok => "SLO_STATUS_OK",
Self::Breached => "SLO_STATUS_BREACHED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SLO_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"SLO_STATUS_OK" => Some(Self::Ok),
"SLO_STATUS_BREACHED" => Some(Self::Breached),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SliMetricType {
Unspecified = 0,
Error = 1,
Latency = 2,
Custom = 3,
}
impl SliMetricType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SLI_METRIC_TYPE_UNSPECIFIED",
Self::Error => "SLI_METRIC_TYPE_ERROR",
Self::Latency => "SLI_METRIC_TYPE_LATENCY",
Self::Custom => "SLI_METRIC_TYPE_CUSTOM",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SLI_METRIC_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SLI_METRIC_TYPE_ERROR" => Some(Self::Error),
"SLI_METRIC_TYPE_LATENCY" => Some(Self::Latency),
"SLI_METRIC_TYPE_CUSTOM" => Some(Self::Custom),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ThresholdSymbol {
Unspecified = 0,
Greater = 1,
GreaterOrEqual = 2,
Less = 3,
LessOrEqual = 4,
Equal = 5,
NotEqual = 6,
}
impl ThresholdSymbol {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "THRESHOLD_SYMBOL_UNSPECIFIED",
Self::Greater => "THRESHOLD_SYMBOL_GREATER",
Self::GreaterOrEqual => "THRESHOLD_SYMBOL_GREATER_OR_EQUAL",
Self::Less => "THRESHOLD_SYMBOL_LESS",
Self::LessOrEqual => "THRESHOLD_SYMBOL_LESS_OR_EQUAL",
Self::Equal => "THRESHOLD_SYMBOL_EQUAL",
Self::NotEqual => "THRESHOLD_SYMBOL_NOT_EQUAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"THRESHOLD_SYMBOL_UNSPECIFIED" => Some(Self::Unspecified),
"THRESHOLD_SYMBOL_GREATER" => Some(Self::Greater),
"THRESHOLD_SYMBOL_GREATER_OR_EQUAL" => Some(Self::GreaterOrEqual),
"THRESHOLD_SYMBOL_LESS" => Some(Self::Less),
"THRESHOLD_SYMBOL_LESS_OR_EQUAL" => Some(Self::LessOrEqual),
"THRESHOLD_SYMBOL_EQUAL" => Some(Self::Equal),
"THRESHOLD_SYMBOL_NOT_EQUAL" => Some(Self::NotEqual),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SloPeriod {
Unspecified = 0,
SloPeriod7Days = 1,
SloPeriod14Days = 2,
SloPeriod30Days = 3,
}
impl SloPeriod {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SLO_PERIOD_UNSPECIFIED",
Self::SloPeriod7Days => "SLO_PERIOD_7_DAYS",
Self::SloPeriod14Days => "SLO_PERIOD_14_DAYS",
Self::SloPeriod30Days => "SLO_PERIOD_30_DAYS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SLO_PERIOD_UNSPECIFIED" => Some(Self::Unspecified),
"SLO_PERIOD_7_DAYS" => Some(Self::SloPeriod7Days),
"SLO_PERIOD_14_DAYS" => Some(Self::SloPeriod14Days),
"SLO_PERIOD_30_DAYS" => Some(Self::SloPeriod30Days),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetServiceSloRequest {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetServiceSloResponse {
#[prost(message, optional, tag = "1")]
pub slo: ::core::option::Option<ServiceSlo>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateServiceSloRequest {
#[prost(message, optional, tag = "1")]
pub slo: ::core::option::Option<ServiceSlo>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateServiceSloResponse {
#[prost(message, optional, tag = "1")]
pub slo: ::core::option::Option<ServiceSlo>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplaceServiceSloRequest {
#[prost(message, optional, tag = "1")]
pub slo: ::core::option::Option<ServiceSlo>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplaceServiceSloResponse {
#[prost(message, optional, tag = "1")]
pub slo: ::core::option::Option<ServiceSlo>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteServiceSloRequest {
#[prost(message, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteServiceSloResponse {}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListServiceSlosRequest {
#[prost(message, optional, tag = "1")]
pub order_by: ::core::option::Option<super::super::common::v2::OrderBy>,
#[prost(message, repeated, tag = "2")]
pub service_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListServiceSlosResponse {
#[prost(message, repeated, tag = "1")]
pub slos: ::prost::alloc::vec::Vec<ServiceSlo>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetServiceSlosRequest {
#[prost(message, repeated, tag = "1")]
pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetServiceSlosResponse {
#[prost(map = "string, message", tag = "1")]
pub slos: ::std::collections::HashMap<::prost::alloc::string::String, ServiceSlo>,
#[prost(message, repeated, tag = "2")]
pub not_found_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
pub mod service_slo_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 ServiceSloServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ServiceSloServiceClient<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> ServiceSloServiceClient<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,
) -> ServiceSloServiceClient<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,
{
ServiceSloServiceClient::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 get_service_slo(
&mut self,
request: impl tonic::IntoRequest<super::GetServiceSloRequest>,
) -> std::result::Result<
tonic::Response<super::GetServiceSloResponse>,
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(
"/com.coralogixapis.apm.services.v1.ServiceSloService/GetServiceSlo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.apm.services.v1.ServiceSloService",
"GetServiceSlo",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create_service_slo(
&mut self,
request: impl tonic::IntoRequest<super::CreateServiceSloRequest>,
) -> std::result::Result<
tonic::Response<super::CreateServiceSloResponse>,
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(
"/com.coralogixapis.apm.services.v1.ServiceSloService/CreateServiceSlo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.apm.services.v1.ServiceSloService",
"CreateServiceSlo",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn replace_service_slo(
&mut self,
request: impl tonic::IntoRequest<super::ReplaceServiceSloRequest>,
) -> std::result::Result<
tonic::Response<super::ReplaceServiceSloResponse>,
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(
"/com.coralogixapis.apm.services.v1.ServiceSloService/ReplaceServiceSlo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.apm.services.v1.ServiceSloService",
"ReplaceServiceSlo",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_service_slo(
&mut self,
request: impl tonic::IntoRequest<super::DeleteServiceSloRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteServiceSloResponse>,
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(
"/com.coralogixapis.apm.services.v1.ServiceSloService/DeleteServiceSlo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.apm.services.v1.ServiceSloService",
"DeleteServiceSlo",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_service_slos(
&mut self,
request: impl tonic::IntoRequest<super::ListServiceSlosRequest>,
) -> std::result::Result<
tonic::Response<super::ListServiceSlosResponse>,
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(
"/com.coralogixapis.apm.services.v1.ServiceSloService/ListServiceSlos",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.apm.services.v1.ServiceSloService",
"ListServiceSlos",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_service_slos(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetServiceSlosRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetServiceSlosResponse>,
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(
"/com.coralogixapis.apm.services.v1.ServiceSloService/BatchGetServiceSlos",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.apm.services.v1.ServiceSloService",
"BatchGetServiceSlos",
),
);
self.inner.unary(req, path, codec).await
}
}
}