#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HealthCheckResponse {
#[prost(enumeration = "health_check_response::ServingStatus", tag = "1")]
pub status: i32,
}
pub mod health_check_response {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ServingStatus {
Unknown = 0,
Serving = 1,
NotServing = 2,
}
impl ServingStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unknown => "UNKNOWN",
Self::Serving => "SERVING",
Self::NotServing => "NOT_SERVING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNKNOWN" => Some(Self::Unknown),
"SERVING" => Some(Self::Serving),
"NOT_SERVING" => Some(Self::NotServing),
_ => None,
}
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobSubmitRequestItem {
#[prost(double, tag = "1")]
pub priority: f64,
#[prost(string, tag = "3")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub client_id: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(map = "string, string", tag = "5")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(map = "string, string", tag = "6")]
pub required_node_labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[deprecated]
#[prost(message, optional, tag = "2")]
pub pod_spec: ::core::option::Option<crate::k8s::io::api::core::v1::PodSpec>,
#[prost(message, repeated, tag = "7")]
pub pod_specs: ::prost::alloc::vec::Vec<crate::k8s::io::api::core::v1::PodSpec>,
#[prost(message, repeated, tag = "9")]
pub ingress: ::prost::alloc::vec::Vec<IngressConfig>,
#[prost(message, repeated, tag = "10")]
pub services: ::prost::alloc::vec::Vec<ServiceConfig>,
#[prost(string, tag = "11")]
pub scheduler: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub external_job_uri: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IngressConfig {
#[deprecated]
#[prost(enumeration = "IngressType", tag = "1")]
pub r#type: i32,
#[prost(uint32, repeated, tag = "2")]
pub ports: ::prost::alloc::vec::Vec<u32>,
#[prost(map = "string, string", tag = "3")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bool, tag = "4")]
pub tls_enabled: bool,
#[prost(string, tag = "5")]
pub cert_name: ::prost::alloc::string::String,
#[prost(bool, tag = "6")]
pub use_cluster_ip: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ServiceConfig {
#[prost(enumeration = "ServiceType", tag = "1")]
pub r#type: i32,
#[prost(uint32, repeated, tag = "2")]
pub ports: ::prost::alloc::vec::Vec<u32>,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobSubmitRequest {
#[prost(string, tag = "1")]
pub queue: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub job_request_items: ::prost::alloc::vec::Vec<JobSubmitRequestItem>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobPreemptRequest {
#[prost(string, tag = "1")]
pub queue: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "3")]
pub job_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "4")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobCancelRequest {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "4")]
pub job_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "5")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobSetCancelRequest {
#[prost(string, tag = "1")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub filter: ::core::option::Option<JobSetFilter>,
#[prost(string, tag = "4")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobSetFilter {
#[prost(enumeration = "JobState", repeated, tag = "1")]
pub states: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Job {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub client_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub namespace: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "9")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(map = "string, string", tag = "10")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(map = "string, string", tag = "11")]
pub required_node_labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "8")]
pub owner: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "15")]
pub queue_ownership_user_groups: ::prost::alloc::vec::Vec<
::prost::alloc::string::String,
>,
#[prost(bytes = "vec", tag = "19")]
pub compressed_queue_ownership_user_groups: ::prost::alloc::vec::Vec<u8>,
#[prost(double, tag = "4")]
pub priority: f64,
#[deprecated]
#[prost(message, optional, tag = "5")]
pub pod_spec: ::core::option::Option<crate::k8s::io::api::core::v1::PodSpec>,
#[prost(message, repeated, tag = "12")]
pub pod_specs: ::prost::alloc::vec::Vec<crate::k8s::io::api::core::v1::PodSpec>,
#[prost(message, optional, tag = "21")]
pub scheduling_resource_requirements: ::core::option::Option<
crate::k8s::io::api::core::v1::ResourceRequirements,
>,
#[prost(message, optional, tag = "6")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "14")]
pub ingress: ::prost::alloc::vec::Vec<IngressConfig>,
#[prost(message, repeated, tag = "16")]
pub services: ::prost::alloc::vec::Vec<ServiceConfig>,
#[prost(message, repeated, tag = "17")]
pub k8s_ingress: ::prost::alloc::vec::Vec<
crate::k8s::io::api::networking::v1::Ingress,
>,
#[prost(message, repeated, tag = "18")]
pub k8s_service: ::prost::alloc::vec::Vec<crate::k8s::io::api::core::v1::Service>,
#[prost(string, tag = "20")]
pub scheduler: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobReprioritizeRequest {
#[prost(string, repeated, tag = "1")]
pub job_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(double, tag = "4")]
pub new_priority: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobReprioritizeResponse {
#[prost(map = "string, string", tag = "1")]
pub reprioritization_results: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobSubmitResponseItem {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobSubmitResponse {
#[prost(message, repeated, tag = "1")]
pub job_response_items: ::prost::alloc::vec::Vec<JobSubmitResponseItem>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Queue {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(double, tag = "2")]
pub priority_factor: f64,
#[prost(string, repeated, tag = "3")]
pub user_owners: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "4")]
pub group_owners: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, double", tag = "5")]
pub resource_limits: ::std::collections::HashMap<
::prost::alloc::string::String,
f64,
>,
#[prost(map = "string, message", tag = "7")]
pub resource_limits_by_priority_class_name: ::std::collections::HashMap<
::prost::alloc::string::String,
PriorityClassResourceLimits,
>,
#[prost(message, repeated, tag = "6")]
pub permissions: ::prost::alloc::vec::Vec<queue::Permissions>,
#[prost(bool, tag = "8")]
pub cordoned: bool,
#[deprecated]
#[prost(string, repeated, tag = "9")]
pub labels_deprecated: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "10")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
pub mod queue {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Permissions {
#[prost(message, repeated, tag = "1")]
pub subjects: ::prost::alloc::vec::Vec<permissions::Subject>,
#[prost(string, repeated, tag = "2")]
pub verbs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
pub mod permissions {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Subject {
#[prost(string, tag = "1")]
pub kind: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PriorityClassResourceLimits {
#[prost(map = "string, double", tag = "1")]
pub maximum_resource_fraction: ::std::collections::HashMap<
::prost::alloc::string::String,
f64,
>,
#[prost(map = "string, message", tag = "2")]
pub maximum_resource_fraction_by_pool: ::std::collections::HashMap<
::prost::alloc::string::String,
PriorityClassPoolResourceLimits,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PriorityClassPoolResourceLimits {
#[prost(map = "string, double", tag = "1")]
pub maximum_resource_fraction: ::std::collections::HashMap<
::prost::alloc::string::String,
f64,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueueList {
#[prost(message, repeated, tag = "1")]
pub queues: ::prost::alloc::vec::Vec<Queue>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CancellationResult {
#[prost(string, repeated, tag = "1")]
pub cancelled_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PreemptionResult {
#[prost(map = "string, string", tag = "1")]
pub preemption_results: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueueGetRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueueCordonRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueueUncordonRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StreamingQueueGetRequest {
#[prost(uint32, tag = "1")]
pub num: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueueDeleteRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobSetInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub queued_jobs: i32,
#[prost(int32, tag = "3")]
pub leased_jobs: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueueUpdateResponse {
#[prost(message, optional, tag = "1")]
pub queue: ::core::option::Option<Queue>,
#[prost(string, tag = "2")]
pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchQueueUpdateResponse {
#[prost(message, repeated, tag = "1")]
pub failed_queues: ::prost::alloc::vec::Vec<QueueUpdateResponse>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueueCreateResponse {
#[prost(message, optional, tag = "1")]
pub queue: ::core::option::Option<Queue>,
#[prost(string, tag = "2")]
pub error: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchQueueCreateResponse {
#[prost(message, repeated, tag = "1")]
pub failed_queues: ::prost::alloc::vec::Vec<QueueCreateResponse>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EndMarker {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingQueueMessage {
#[prost(oneof = "streaming_queue_message::Event", tags = "1, 2")]
pub event: ::core::option::Option<streaming_queue_message::Event>,
}
pub mod streaming_queue_message {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Event {
#[prost(message, tag = "1")]
Queue(super::Queue),
#[prost(message, tag = "2")]
End(super::EndMarker),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueuePreemptRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub priority_classes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "3")]
pub pools: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QueueCancelRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub priority_classes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(enumeration = "JobState", repeated, tag = "3")]
pub job_states: ::prost::alloc::vec::Vec<i32>,
#[prost(string, repeated, tag = "4")]
pub pools: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IngressType {
Ingress = 0,
}
impl IngressType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Ingress => "Ingress",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Ingress" => Some(Self::Ingress),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ServiceType {
NodePort = 0,
Headless = 1,
}
impl ServiceType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::NodePort => "NodePort",
Self::Headless => "Headless",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NodePort" => Some(Self::NodePort),
"Headless" => Some(Self::Headless),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum JobState {
Queued = 0,
Pending = 1,
Running = 2,
Succeeded = 3,
Failed = 4,
Unknown = 5,
Submitted = 6,
Leased = 7,
Preempted = 8,
Cancelled = 9,
Rejected = 10,
}
impl JobState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Queued => "QUEUED",
Self::Pending => "PENDING",
Self::Running => "RUNNING",
Self::Succeeded => "SUCCEEDED",
Self::Failed => "FAILED",
Self::Unknown => "UNKNOWN",
Self::Submitted => "SUBMITTED",
Self::Leased => "LEASED",
Self::Preempted => "PREEMPTED",
Self::Cancelled => "CANCELLED",
Self::Rejected => "REJECTED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"QUEUED" => Some(Self::Queued),
"PENDING" => Some(Self::Pending),
"RUNNING" => Some(Self::Running),
"SUCCEEDED" => Some(Self::Succeeded),
"FAILED" => Some(Self::Failed),
"UNKNOWN" => Some(Self::Unknown),
"SUBMITTED" => Some(Self::Submitted),
"LEASED" => Some(Self::Leased),
"PREEMPTED" => Some(Self::Preempted),
"CANCELLED" => Some(Self::Cancelled),
"REJECTED" => Some(Self::Rejected),
_ => None,
}
}
}
pub mod queue_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 QueueServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QueueServiceClient<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> QueueServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
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,
) -> QueueServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
QueueServiceClient::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 create_queue(
&mut self,
request: impl tonic::IntoRequest<super::Queue>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/CreateQueue",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "CreateQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn create_queues(
&mut self,
request: impl tonic::IntoRequest<super::QueueList>,
) -> std::result::Result<
tonic::Response<super::BatchQueueCreateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/CreateQueues",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "CreateQueues"));
self.inner.unary(req, path, codec).await
}
pub async fn update_queue(
&mut self,
request: impl tonic::IntoRequest<super::Queue>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/UpdateQueue",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "UpdateQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn update_queues(
&mut self,
request: impl tonic::IntoRequest<super::QueueList>,
) -> std::result::Result<
tonic::Response<super::BatchQueueUpdateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/UpdateQueues",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "UpdateQueues"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_queue(
&mut self,
request: impl tonic::IntoRequest<super::QueueDeleteRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/DeleteQueue",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "DeleteQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn get_queue(
&mut self,
request: impl tonic::IntoRequest<super::QueueGetRequest>,
) -> std::result::Result<tonic::Response<super::Queue>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/GetQueue",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.QueueService", "GetQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn get_queues(
&mut self,
request: impl tonic::IntoRequest<super::StreamingQueueGetRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::StreamingQueueMessage>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/GetQueues",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "GetQueues"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn cordon_queue(
&mut self,
request: impl tonic::IntoRequest<super::QueueCordonRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/CordonQueue",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "CordonQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn uncordon_queue(
&mut self,
request: impl tonic::IntoRequest<super::QueueUncordonRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/UncordonQueue",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "UncordonQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn preempt_on_queue(
&mut self,
request: impl tonic::IntoRequest<super::QueuePreemptRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/PreemptOnQueue",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "PreemptOnQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn cancel_on_queue(
&mut self,
request: impl tonic::IntoRequest<super::QueueCancelRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.QueueService/CancelOnQueue",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.QueueService", "CancelOnQueue"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod submit_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 SubmitClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SubmitClient<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> SubmitClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
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,
) -> SubmitClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
SubmitClient::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 submit_jobs(
&mut self,
request: impl tonic::IntoRequest<super::JobSubmitRequest>,
) -> std::result::Result<
tonic::Response<super::JobSubmitResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/SubmitJobs");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "SubmitJobs"));
self.inner.unary(req, path, codec).await
}
pub async fn cancel_jobs(
&mut self,
request: impl tonic::IntoRequest<super::JobCancelRequest>,
) -> std::result::Result<
tonic::Response<super::CancellationResult>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/CancelJobs");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "CancelJobs"));
self.inner.unary(req, path, codec).await
}
pub async fn cancel_job_set(
&mut self,
request: impl tonic::IntoRequest<super::JobSetCancelRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/CancelJobSet");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "CancelJobSet"));
self.inner.unary(req, path, codec).await
}
pub async fn reprioritize_jobs(
&mut self,
request: impl tonic::IntoRequest<super::JobReprioritizeRequest>,
) -> std::result::Result<
tonic::Response<super::JobReprioritizeResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.Submit/ReprioritizeJobs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.Submit", "ReprioritizeJobs"));
self.inner.unary(req, path, codec).await
}
pub async fn preempt_jobs(
&mut self,
request: impl tonic::IntoRequest<super::JobPreemptRequest>,
) -> std::result::Result<
tonic::Response<super::PreemptionResult>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/PreemptJobs");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "PreemptJobs"));
self.inner.unary(req, path, codec).await
}
pub async fn create_queue(
&mut self,
request: impl tonic::IntoRequest<super::Queue>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/CreateQueue");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "CreateQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn create_queues(
&mut self,
request: impl tonic::IntoRequest<super::QueueList>,
) -> std::result::Result<
tonic::Response<super::BatchQueueCreateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/CreateQueues");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "CreateQueues"));
self.inner.unary(req, path, codec).await
}
pub async fn update_queue(
&mut self,
request: impl tonic::IntoRequest<super::Queue>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/UpdateQueue");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "UpdateQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn update_queues(
&mut self,
request: impl tonic::IntoRequest<super::QueueList>,
) -> std::result::Result<
tonic::Response<super::BatchQueueUpdateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/UpdateQueues");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "UpdateQueues"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_queue(
&mut self,
request: impl tonic::IntoRequest<super::QueueDeleteRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/DeleteQueue");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "DeleteQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn get_queue(
&mut self,
request: impl tonic::IntoRequest<super::QueueGetRequest>,
) -> std::result::Result<tonic::Response<super::Queue>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/GetQueue");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "GetQueue"));
self.inner.unary(req, path, codec).await
}
pub async fn get_queues(
&mut self,
request: impl tonic::IntoRequest<super::StreamingQueueGetRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::StreamingQueueMessage>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/GetQueues");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "GetQueues"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn health(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<super::HealthCheckResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Submit/Health");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Submit", "Health"));
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobSubmittedEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub job: ::core::option::Option<Job>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobQueuedEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobLeasedEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub pool: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobLeaseReturnedEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub reason: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub kubernetes_id: ::prost::alloc::string::String,
#[prost(int32, tag = "8")]
pub pod_number: i32,
#[prost(bool, tag = "9")]
pub run_attempted: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobLeaseExpiredEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobPendingEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub kubernetes_id: ::prost::alloc::string::String,
#[prost(int32, tag = "7")]
pub pod_number: i32,
#[prost(string, tag = "8")]
pub pod_name: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub pod_namespace: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub pool: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobRunningEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub kubernetes_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub node_name: ::prost::alloc::string::String,
#[prost(int32, tag = "8")]
pub pod_number: i32,
#[prost(string, tag = "9")]
pub pod_name: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub pod_namespace: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub pool: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobIngressInfoEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub kubernetes_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub node_name: ::prost::alloc::string::String,
#[prost(int32, tag = "8")]
pub pod_number: i32,
#[prost(string, tag = "10")]
pub pod_name: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub pod_namespace: ::prost::alloc::string::String,
#[prost(map = "int32, string", tag = "9")]
pub ingress_addresses: ::std::collections::HashMap<
i32,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobFailedEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub reason: ::prost::alloc::string::String,
#[prost(map = "string, int32", tag = "7")]
pub exit_codes: ::std::collections::HashMap<::prost::alloc::string::String, i32>,
#[prost(string, tag = "8")]
pub kubernetes_id: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub node_name: ::prost::alloc::string::String,
#[prost(int32, tag = "10")]
pub pod_number: i32,
#[prost(string, tag = "13")]
pub pod_name: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub pod_namespace: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "11")]
pub container_statuses: ::prost::alloc::vec::Vec<ContainerStatus>,
#[prost(enumeration = "Cause", tag = "12")]
pub cause: i32,
#[prost(string, tag = "16")]
pub failure_category: ::prost::alloc::string::String,
#[prost(string, tag = "17")]
pub failure_subcategory: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobPreemptingEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub requestor: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobPreemptedEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub run_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub preemptive_job_id: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub preemptive_run_id: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobSucceededEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub kubernetes_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub node_name: ::prost::alloc::string::String,
#[prost(int32, tag = "8")]
pub pod_number: i32,
#[prost(string, tag = "9")]
pub pod_name: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub pod_namespace: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobUtilisationEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub kubernetes_id: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "7")]
pub max_resources_for_period: ::std::collections::HashMap<
::prost::alloc::string::String,
crate::k8s::io::apimachinery::pkg::api::resource::Quantity,
>,
#[prost(string, tag = "8")]
pub node_name: ::prost::alloc::string::String,
#[prost(int32, tag = "9")]
pub pod_number: i32,
#[prost(string, tag = "10")]
pub pod_name: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub pod_namespace: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "12")]
pub total_cumulative_usage: ::std::collections::HashMap<
::prost::alloc::string::String,
crate::k8s::io::apimachinery::pkg::api::resource::Quantity,
>,
#[prost(map = "string, message", tag = "13")]
pub avg_resources_for_period: ::std::collections::HashMap<
::prost::alloc::string::String,
crate::k8s::io::apimachinery::pkg::api::resource::Quantity,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobReprioritizingEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(double, tag = "5")]
pub new_priority: f64,
#[prost(string, tag = "6")]
pub requestor: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobReprioritizedEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(double, tag = "5")]
pub new_priority: f64,
#[prost(string, tag = "6")]
pub requestor: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobCancellingEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub requestor: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobCancelledEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub requestor: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobTerminatedEvent {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub queue: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub cluster_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub kubernetes_id: ::prost::alloc::string::String,
#[prost(int32, tag = "7")]
pub pod_number: i32,
#[prost(string, tag = "9")]
pub pod_name: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub pod_namespace: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub reason: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventMessage {
#[prost(
oneof = "event_message::Events",
tags = "1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 15, 17, 18, 21, 22"
)]
pub events: ::core::option::Option<event_message::Events>,
}
pub mod event_message {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Events {
#[prost(message, tag = "1")]
Submitted(super::JobSubmittedEvent),
#[prost(message, tag = "2")]
Queued(super::JobQueuedEvent),
#[prost(message, tag = "3")]
Leased(super::JobLeasedEvent),
#[prost(message, tag = "4")]
LeaseReturned(super::JobLeaseReturnedEvent),
#[prost(message, tag = "5")]
LeaseExpired(super::JobLeaseExpiredEvent),
#[prost(message, tag = "6")]
Pending(super::JobPendingEvent),
#[prost(message, tag = "7")]
Running(super::JobRunningEvent),
#[prost(message, tag = "9")]
Failed(super::JobFailedEvent),
#[prost(message, tag = "10")]
Succeeded(super::JobSucceededEvent),
#[prost(message, tag = "11")]
Reprioritized(super::JobReprioritizedEvent),
#[prost(message, tag = "12")]
Cancelling(super::JobCancellingEvent),
#[prost(message, tag = "13")]
Cancelled(super::JobCancelledEvent),
#[prost(message, tag = "15")]
Utilisation(super::JobUtilisationEvent),
#[prost(message, tag = "17")]
IngressInfo(super::JobIngressInfoEvent),
#[prost(message, tag = "18")]
Reprioritizing(super::JobReprioritizingEvent),
#[prost(message, tag = "21")]
Preempted(super::JobPreemptedEvent),
#[prost(message, tag = "22")]
Preempting(super::JobPreemptingEvent),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ContainerStatus {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub exit_code: i32,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub reason: ::prost::alloc::string::String,
#[prost(enumeration = "Cause", tag = "5")]
pub cause: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventStreamMessage {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub message: ::core::option::Option<EventMessage>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobSetRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub watch: bool,
#[prost(string, tag = "3")]
pub from_message_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub queue: ::prost::alloc::string::String,
#[prost(bool, tag = "5")]
pub error_if_missing: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WatchRequest {
#[prost(string, tag = "1")]
pub queue: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_set_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub from_id: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Cause {
Error = 0,
Evicted = 1,
Oom = 2,
DeadlineExceeded = 3,
Rejected = 4,
}
impl Cause {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Error => "Error",
Self::Evicted => "Evicted",
Self::Oom => "OOM",
Self::DeadlineExceeded => "DeadlineExceeded",
Self::Rejected => "Rejected",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Error" => Some(Self::Error),
"Evicted" => Some(Self::Evicted),
"OOM" => Some(Self::Oom),
"DeadlineExceeded" => Some(Self::DeadlineExceeded),
"Rejected" => Some(Self::Rejected),
_ => None,
}
}
}
pub mod event_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 EventClient<T> {
inner: tonic::client::Grpc<T>,
}
impl EventClient<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> EventClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
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,
) -> EventClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
EventClient::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_job_set_events(
&mut self,
request: impl tonic::IntoRequest<super::JobSetRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::EventStreamMessage>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.Event/GetJobSetEvents",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Event", "GetJobSetEvents"));
self.inner.server_streaming(req, path, codec).await
}
#[deprecated]
pub async fn watch(
&mut self,
request: impl tonic::IntoRequest<super::WatchRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::EventStreamMessage>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Event/Watch");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Event", "Watch"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn health(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<super::HealthCheckResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Event/Health");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Event", "Health"));
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobRunDetails {
#[prost(string, tag = "1")]
pub run_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub job_id: ::prost::alloc::string::String,
#[prost(enumeration = "JobRunState", tag = "3")]
pub state: i32,
#[prost(string, tag = "4")]
pub cluster: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub node: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub leased_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub pending_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub started_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub finished_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(map = "int32, string", tag = "11")]
pub ingress_addresses: ::std::collections::HashMap<
i32,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobDetails {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub queue: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub jobset: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub namespace: ::prost::alloc::string::String,
#[prost(enumeration = "JobState", tag = "5")]
pub state: i32,
#[prost(message, optional, tag = "6")]
pub submitted_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub cancel_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "8")]
pub cancel_reason: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub last_transition_ts: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "10")]
pub latest_run_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "11")]
pub job_spec: ::core::option::Option<Job>,
#[prost(message, repeated, tag = "12")]
pub job_runs: ::prost::alloc::vec::Vec<JobRunDetails>,
#[prost(string, tag = "13")]
pub cancel_user: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobDetailsRequest {
#[prost(string, repeated, tag = "1")]
pub job_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(bool, tag = "2")]
pub expand_job_spec: bool,
#[prost(bool, tag = "3")]
pub expand_job_run: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobDetailsResponse {
#[prost(map = "string, message", tag = "1")]
pub job_details: ::std::collections::HashMap<
::prost::alloc::string::String,
JobDetails,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobRunDetailsResponse {
#[prost(map = "string, message", tag = "1")]
pub job_run_details: ::std::collections::HashMap<
::prost::alloc::string::String,
JobRunDetails,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobRunDetailsRequest {
#[prost(string, repeated, tag = "1")]
pub run_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobErrorsRequest {
#[prost(string, repeated, tag = "1")]
pub job_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobErrorsResponse {
#[prost(map = "string, string", tag = "1")]
pub job_errors: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobStatusRequest {
#[prost(string, repeated, tag = "1")]
pub job_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ActiveQueues {
#[prost(string, repeated, tag = "1")]
pub queues: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetActiveQueuesRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetActiveQueuesResponse {
#[prost(map = "string, message", tag = "1")]
pub active_queues_by_pool: ::std::collections::HashMap<
::prost::alloc::string::String,
ActiveQueues,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct JobStatusUsingExternalJobUriRequest {
#[prost(string, tag = "1")]
pub queue: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub jobset: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub external_job_uri: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct JobStatusResponse {
#[prost(map = "string, enumeration(JobState)", tag = "1")]
pub job_states: ::std::collections::HashMap<::prost::alloc::string::String, i32>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum JobRunState {
RunStateUnknown = 0,
RunStateLeased = 1,
RunStatePending = 2,
RunStateRunning = 3,
RunStateSucceeded = 4,
RunStateFailed = 5,
RunStatePreempted = 6,
RunStateCancelled = 7,
RunStateLeaseExpired = 8,
RunsStateLeaseReturned = 9,
}
impl JobRunState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::RunStateUnknown => "RUN_STATE_UNKNOWN",
Self::RunStateLeased => "RUN_STATE_LEASED",
Self::RunStatePending => "RUN_STATE_PENDING",
Self::RunStateRunning => "RUN_STATE_RUNNING",
Self::RunStateSucceeded => "RUN_STATE_SUCCEEDED",
Self::RunStateFailed => "RUN_STATE_FAILED",
Self::RunStatePreempted => "RUN_STATE_PREEMPTED",
Self::RunStateCancelled => "RUN_STATE_CANCELLED",
Self::RunStateLeaseExpired => "RUN_STATE_LEASE_EXPIRED",
Self::RunsStateLeaseReturned => "RUNS_STATE_LEASE_RETURNED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RUN_STATE_UNKNOWN" => Some(Self::RunStateUnknown),
"RUN_STATE_LEASED" => Some(Self::RunStateLeased),
"RUN_STATE_PENDING" => Some(Self::RunStatePending),
"RUN_STATE_RUNNING" => Some(Self::RunStateRunning),
"RUN_STATE_SUCCEEDED" => Some(Self::RunStateSucceeded),
"RUN_STATE_FAILED" => Some(Self::RunStateFailed),
"RUN_STATE_PREEMPTED" => Some(Self::RunStatePreempted),
"RUN_STATE_CANCELLED" => Some(Self::RunStateCancelled),
"RUN_STATE_LEASE_EXPIRED" => Some(Self::RunStateLeaseExpired),
"RUNS_STATE_LEASE_RETURNED" => Some(Self::RunsStateLeaseReturned),
_ => None,
}
}
}
pub mod jobs_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 JobsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl JobsClient<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> JobsClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
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,
) -> JobsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
JobsClient::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_job_status(
&mut self,
request: impl tonic::IntoRequest<super::JobStatusRequest>,
) -> std::result::Result<
tonic::Response<super::JobStatusResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Jobs/GetJobStatus");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Jobs", "GetJobStatus"));
self.inner.unary(req, path, codec).await
}
pub async fn get_job_status_using_external_job_uri(
&mut self,
request: impl tonic::IntoRequest<super::JobStatusUsingExternalJobUriRequest>,
) -> std::result::Result<
tonic::Response<super::JobStatusResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.Jobs/GetJobStatusUsingExternalJobUri",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("api.Jobs", "GetJobStatusUsingExternalJobUri"));
self.inner.unary(req, path, codec).await
}
pub async fn get_job_details(
&mut self,
request: impl tonic::IntoRequest<super::JobDetailsRequest>,
) -> std::result::Result<
tonic::Response<super::JobDetailsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Jobs/GetJobDetails");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Jobs", "GetJobDetails"));
self.inner.unary(req, path, codec).await
}
pub async fn get_job_errors(
&mut self,
request: impl tonic::IntoRequest<super::JobErrorsRequest>,
) -> std::result::Result<
tonic::Response<super::JobErrorsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Jobs/GetJobErrors");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Jobs", "GetJobErrors"));
self.inner.unary(req, path, codec).await
}
pub async fn get_job_run_details(
&mut self,
request: impl tonic::IntoRequest<super::JobRunDetailsRequest>,
) -> std::result::Result<
tonic::Response<super::JobRunDetailsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/api.Jobs/GetJobRunDetails",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Jobs", "GetJobRunDetails"));
self.inner.unary(req, path, codec).await
}
pub async fn get_active_queues(
&mut self,
request: impl tonic::IntoRequest<super::GetActiveQueuesRequest>,
) -> std::result::Result<
tonic::Response<super::GetActiveQueuesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/api.Jobs/GetActiveQueues");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("api.Jobs", "GetActiveQueues"));
self.inner.unary(req, path, codec).await
}
}
}