RuntimeServiceClient

Struct RuntimeServiceClient 

Source
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,

Source

pub fn new(inner: T) -> Self

Source

pub fn with_origin(inner: T, origin: Uri) -> Self

Source

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,

Source

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.

Source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

Source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

Source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn list_pod_sandbox( &mut self, request: impl IntoRequest<ListPodSandboxRequest>, ) -> Result<Response<ListPodSandboxResponse>, Status>

ListPodSandbox returns a list of PodSandboxes.

Source

pub async fn create_container( &mut self, request: impl IntoRequest<CreateContainerRequest>, ) -> Result<Response<CreateContainerResponse>, Status>

CreateContainer creates a new container in specified PodSandbox

Source

pub async fn start_container( &mut self, request: impl IntoRequest<StartContainerRequest>, ) -> Result<Response<StartContainerResponse>, Status>

StartContainer starts the container.

Source

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.

Source

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.

Source

pub async fn list_containers( &mut self, request: impl IntoRequest<ListContainersRequest>, ) -> Result<Response<ListContainersResponse>, Status>

ListContainers lists all containers by filters.

Source

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.

Source

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.

Source

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.

Source

pub async fn exec_sync( &mut self, request: impl IntoRequest<ExecSyncRequest>, ) -> Result<Response<ExecSyncResponse>, Status>

ExecSync runs a command in a container synchronously.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn list_container_stats( &mut self, request: impl IntoRequest<ListContainerStatsRequest>, ) -> Result<Response<ListContainerStatsResponse>, Status>

ListContainerStats returns stats of all running containers.

Source

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.

Source

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.

Source

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.

Source

pub async fn status( &mut self, request: impl IntoRequest<StatusRequest>, ) -> Result<Response<StatusResponse>, Status>

Status returns the status of the runtime.

Source

pub async fn checkpoint_container( &mut self, request: impl IntoRequest<CheckpointContainerRequest>, ) -> Result<Response<CheckpointContainerResponse>, Status>

CheckpointContainer checkpoints a container

Source

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>

Source§

fn clone(&self) -> RuntimeServiceClient<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for RuntimeServiceClient<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more