pub struct RuntimeServiceClient<T> { /* private fields */ }Expand description
Runtime service defines the public APIs for remote container runtimes
Implementations§
Source§impl<T> RuntimeServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> RuntimeServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> RuntimeServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn version(
&mut self,
request: impl IntoRequest<VersionRequest>,
) -> Result<Response<VersionResponse>, Status>
pub async fn version( &mut self, request: impl IntoRequest<VersionRequest>, ) -> Result<Response<VersionResponse>, Status>
Version returns the runtime name, runtime version, and runtime API version.
Sourcepub async fn run_pod_sandbox(
&mut self,
request: impl IntoRequest<RunPodSandboxRequest>,
) -> Result<Response<RunPodSandboxResponse>, Status>
pub async fn run_pod_sandbox( &mut self, request: impl IntoRequest<RunPodSandboxRequest>, ) -> Result<Response<RunPodSandboxResponse>, Status>
RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure the sandbox is in the ready state on success.
Sourcepub async fn stop_pod_sandbox(
&mut self,
request: impl IntoRequest<StopPodSandboxRequest>,
) -> Result<Response<StopPodSandboxResponse>, Status>
pub async fn stop_pod_sandbox( &mut self, request: impl IntoRequest<StopPodSandboxRequest>, ) -> Result<Response<StopPodSandboxResponse>, Status>
StopPodSandbox stops any running process that is part of the sandbox and reclaims network resources (e.g., IP addresses) allocated to the sandbox. If there are any running containers in the sandbox, they must be forcibly terminated. This call is idempotent, and must not return an error if all relevant resources have already been reclaimed. kubelet will call StopPodSandbox at least once before calling RemovePodSandbox. It will also attempt to reclaim resources eagerly, as soon as a sandbox is not needed. Hence, multiple StopPodSandbox calls are expected.
Sourcepub async fn remove_pod_sandbox(
&mut self,
request: impl IntoRequest<RemovePodSandboxRequest>,
) -> Result<Response<RemovePodSandboxResponse>, Status>
pub async fn remove_pod_sandbox( &mut self, request: impl IntoRequest<RemovePodSandboxRequest>, ) -> Result<Response<RemovePodSandboxResponse>, Status>
RemovePodSandbox removes the sandbox. If there are any running containers in the sandbox, they must be forcibly terminated and removed. This call is idempotent, and must not return an error if the sandbox has already been removed.
Sourcepub async fn pod_sandbox_status(
&mut self,
request: impl IntoRequest<PodSandboxStatusRequest>,
) -> Result<Response<PodSandboxStatusResponse>, Status>
pub async fn pod_sandbox_status( &mut self, request: impl IntoRequest<PodSandboxStatusRequest>, ) -> Result<Response<PodSandboxStatusResponse>, Status>
PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not present, returns an error.
Sourcepub async fn list_pod_sandbox(
&mut self,
request: impl IntoRequest<ListPodSandboxRequest>,
) -> Result<Response<ListPodSandboxResponse>, Status>
pub async fn list_pod_sandbox( &mut self, request: impl IntoRequest<ListPodSandboxRequest>, ) -> Result<Response<ListPodSandboxResponse>, Status>
ListPodSandbox returns a list of PodSandboxes.
Sourcepub async fn create_container(
&mut self,
request: impl IntoRequest<CreateContainerRequest>,
) -> Result<Response<CreateContainerResponse>, Status>
pub async fn create_container( &mut self, request: impl IntoRequest<CreateContainerRequest>, ) -> Result<Response<CreateContainerResponse>, Status>
CreateContainer creates a new container in specified PodSandbox
Sourcepub async fn start_container(
&mut self,
request: impl IntoRequest<StartContainerRequest>,
) -> Result<Response<StartContainerResponse>, Status>
pub async fn start_container( &mut self, request: impl IntoRequest<StartContainerRequest>, ) -> Result<Response<StartContainerResponse>, Status>
StartContainer starts the container.
Sourcepub async fn stop_container(
&mut self,
request: impl IntoRequest<StopContainerRequest>,
) -> Result<Response<StopContainerResponse>, Status>
pub async fn stop_container( &mut self, request: impl IntoRequest<StopContainerRequest>, ) -> Result<Response<StopContainerResponse>, Status>
StopContainer stops a running container with a grace period (i.e., timeout). This call is idempotent, and must not return an error if the container has already been stopped. The runtime must forcibly kill the container after the grace period is reached.
Sourcepub async fn remove_container(
&mut self,
request: impl IntoRequest<RemoveContainerRequest>,
) -> Result<Response<RemoveContainerResponse>, Status>
pub async fn remove_container( &mut self, request: impl IntoRequest<RemoveContainerRequest>, ) -> Result<Response<RemoveContainerResponse>, Status>
RemoveContainer removes the container. If the container is running, the container must be forcibly removed. This call is idempotent, and must not return an error if the container has already been removed.
Sourcepub async fn list_containers(
&mut self,
request: impl IntoRequest<ListContainersRequest>,
) -> Result<Response<ListContainersResponse>, Status>
pub async fn list_containers( &mut self, request: impl IntoRequest<ListContainersRequest>, ) -> Result<Response<ListContainersResponse>, Status>
ListContainers lists all containers by filters.
Sourcepub async fn container_status(
&mut self,
request: impl IntoRequest<ContainerStatusRequest>,
) -> Result<Response<ContainerStatusResponse>, Status>
pub async fn container_status( &mut self, request: impl IntoRequest<ContainerStatusRequest>, ) -> Result<Response<ContainerStatusResponse>, Status>
ContainerStatus returns status of the container. If the container is not present, returns an error.
Sourcepub async fn update_container_resources(
&mut self,
request: impl IntoRequest<UpdateContainerResourcesRequest>,
) -> Result<Response<UpdateContainerResourcesResponse>, Status>
pub async fn update_container_resources( &mut self, request: impl IntoRequest<UpdateContainerResourcesRequest>, ) -> Result<Response<UpdateContainerResourcesResponse>, Status>
UpdateContainerResources updates ContainerConfig of the container synchronously. If runtime fails to transactionally update the requested resources, an error is returned.
Sourcepub async fn reopen_container_log(
&mut self,
request: impl IntoRequest<ReopenContainerLogRequest>,
) -> Result<Response<ReopenContainerLogResponse>, Status>
pub async fn reopen_container_log( &mut self, request: impl IntoRequest<ReopenContainerLogRequest>, ) -> Result<Response<ReopenContainerLogResponse>, Status>
ReopenContainerLog asks runtime to reopen the stdout/stderr log file for the container. This is often called after the log file has been rotated. If the container is not running, container runtime can choose to either create a new log file and return nil, or return an error. Once it returns error, new container log file MUST NOT be created.
Sourcepub async fn exec_sync(
&mut self,
request: impl IntoRequest<ExecSyncRequest>,
) -> Result<Response<ExecSyncResponse>, Status>
pub async fn exec_sync( &mut self, request: impl IntoRequest<ExecSyncRequest>, ) -> Result<Response<ExecSyncResponse>, Status>
ExecSync runs a command in a container synchronously.
Sourcepub async fn exec(
&mut self,
request: impl IntoRequest<ExecRequest>,
) -> Result<Response<ExecResponse>, Status>
pub async fn exec( &mut self, request: impl IntoRequest<ExecRequest>, ) -> Result<Response<ExecResponse>, Status>
Exec prepares a streaming endpoint to execute a command in the container.
Sourcepub async fn attach(
&mut self,
request: impl IntoRequest<AttachRequest>,
) -> Result<Response<AttachResponse>, Status>
pub async fn attach( &mut self, request: impl IntoRequest<AttachRequest>, ) -> Result<Response<AttachResponse>, Status>
Attach prepares a streaming endpoint to attach to a running container.
Sourcepub async fn port_forward(
&mut self,
request: impl IntoRequest<PortForwardRequest>,
) -> Result<Response<PortForwardResponse>, Status>
pub async fn port_forward( &mut self, request: impl IntoRequest<PortForwardRequest>, ) -> Result<Response<PortForwardResponse>, Status>
PortForward prepares a streaming endpoint to forward ports from a PodSandbox.
Sourcepub async fn container_stats(
&mut self,
request: impl IntoRequest<ContainerStatsRequest>,
) -> Result<Response<ContainerStatsResponse>, Status>
pub async fn container_stats( &mut self, request: impl IntoRequest<ContainerStatsRequest>, ) -> Result<Response<ContainerStatsResponse>, Status>
ContainerStats returns stats of the container. If the container does not exist, the call returns an error.
Sourcepub async fn list_container_stats(
&mut self,
request: impl IntoRequest<ListContainerStatsRequest>,
) -> Result<Response<ListContainerStatsResponse>, Status>
pub async fn list_container_stats( &mut self, request: impl IntoRequest<ListContainerStatsRequest>, ) -> Result<Response<ListContainerStatsResponse>, Status>
ListContainerStats returns stats of all running containers.
Sourcepub async fn pod_sandbox_stats(
&mut self,
request: impl IntoRequest<PodSandboxStatsRequest>,
) -> Result<Response<PodSandboxStatsResponse>, Status>
pub async fn pod_sandbox_stats( &mut self, request: impl IntoRequest<PodSandboxStatsRequest>, ) -> Result<Response<PodSandboxStatsResponse>, Status>
PodSandboxStats returns stats of the pod sandbox. If the pod sandbox does not exist, the call returns an error.
Sourcepub async fn list_pod_sandbox_stats(
&mut self,
request: impl IntoRequest<ListPodSandboxStatsRequest>,
) -> Result<Response<ListPodSandboxStatsResponse>, Status>
pub async fn list_pod_sandbox_stats( &mut self, request: impl IntoRequest<ListPodSandboxStatsRequest>, ) -> Result<Response<ListPodSandboxStatsResponse>, Status>
ListPodSandboxStats returns stats of the pod sandboxes matching a filter.
Sourcepub async fn update_runtime_config(
&mut self,
request: impl IntoRequest<UpdateRuntimeConfigRequest>,
) -> Result<Response<UpdateRuntimeConfigResponse>, Status>
pub async fn update_runtime_config( &mut self, request: impl IntoRequest<UpdateRuntimeConfigRequest>, ) -> Result<Response<UpdateRuntimeConfigResponse>, Status>
UpdateRuntimeConfig updates the runtime configuration based on the given request.
Sourcepub async fn status(
&mut self,
request: impl IntoRequest<StatusRequest>,
) -> Result<Response<StatusResponse>, Status>
pub async fn status( &mut self, request: impl IntoRequest<StatusRequest>, ) -> Result<Response<StatusResponse>, Status>
Status returns the status of the runtime.
Sourcepub async fn checkpoint_container(
&mut self,
request: impl IntoRequest<CheckpointContainerRequest>,
) -> Result<Response<CheckpointContainerResponse>, Status>
pub async fn checkpoint_container( &mut self, request: impl IntoRequest<CheckpointContainerRequest>, ) -> Result<Response<CheckpointContainerResponse>, Status>
CheckpointContainer checkpoints a container
Sourcepub async fn get_container_events(
&mut self,
request: impl IntoRequest<GetEventsRequest>,
) -> Result<Response<Streaming<ContainerEventResponse>>, Status>
pub async fn get_container_events( &mut self, request: impl IntoRequest<GetEventsRequest>, ) -> Result<Response<Streaming<ContainerEventResponse>>, Status>
GetContainerEvents gets container events from the CRI runtime
Trait Implementations§
Source§impl<T: Clone> Clone for RuntimeServiceClient<T>
impl<T: Clone> Clone for RuntimeServiceClient<T>
Source§fn clone(&self) -> RuntimeServiceClient<T>
fn clone(&self) -> RuntimeServiceClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for RuntimeServiceClient<T>
impl<T> RefUnwindSafe for RuntimeServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for RuntimeServiceClient<T>where
T: Send,
impl<T> Sync for RuntimeServiceClient<T>where
T: Sync,
impl<T> Unpin for RuntimeServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for RuntimeServiceClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request