kube_client::api

Struct Request

Source
pub struct Request {
    pub url_path: String,
}
Available on crate feature client only.
Expand description

A Kubernetes request builder

Takes a base_path and supplies constructors for common operations The extra operations all return http::Request objects.

Fields§

§url_path: String

The path component of a url

Implementations§

Source§

impl Request

Source

pub fn new<S>(url_path: S) -> Request
where S: Into<String>,

New request with a resource’s url path

Source§

impl Request

Convenience methods found from API conventions

Source

pub fn list(&self, lp: &ListParams) -> Result<Request<Vec<u8>>, Error>

List a collection of a resource

Source

pub fn watch( &self, wp: &WatchParams, ver: &str, ) -> Result<Request<Vec<u8>>, Error>

Watch a resource at a given version

Source

pub fn get(&self, name: &str, gp: &GetParams) -> Result<Request<Vec<u8>>, Error>

Get a single instance

Source

pub fn create( &self, pp: &PostParams, data: Vec<u8>, ) -> Result<Request<Vec<u8>>, Error>

Create an instance of a resource

Source

pub fn delete( &self, name: &str, dp: &DeleteParams, ) -> Result<Request<Vec<u8>>, Error>

Delete an instance of a resource

Source

pub fn delete_collection( &self, dp: &DeleteParams, lp: &ListParams, ) -> Result<Request<Vec<u8>>, Error>

Delete a collection of a resource

Source

pub fn patch<P>( &self, name: &str, pp: &PatchParams, patch: &Patch<P>, ) -> Result<Request<Vec<u8>>, Error>
where P: Serialize,

Patch an instance of a resource

Requires a serialized merge-patch+json at the moment.

Source

pub fn replace( &self, name: &str, pp: &PostParams, data: Vec<u8>, ) -> Result<Request<Vec<u8>>, Error>

Replace an instance of a resource

Requires metadata.resourceVersion set in data

Source§

impl Request

Subresources

Source

pub fn get_subresource( &self, subresource_name: &str, name: &str, ) -> Result<Request<Vec<u8>>, Error>

Get an instance of the subresource

Source

pub fn create_subresource( &self, subresource_name: &str, name: &str, pp: &PostParams, data: Vec<u8>, ) -> Result<Request<Vec<u8>>, Error>

Create an instance of the subresource

Source

pub fn patch_subresource<P>( &self, subresource_name: &str, name: &str, pp: &PatchParams, patch: &Patch<P>, ) -> Result<Request<Vec<u8>>, Error>
where P: Serialize,

Patch an instance of the subresource

Source

pub fn replace_subresource( &self, subresource_name: &str, name: &str, pp: &PostParams, data: Vec<u8>, ) -> Result<Request<Vec<u8>>, Error>

Replace an instance of the subresource

Source§

impl Request

Metadata-only request implementations

Requests set an extended Accept header compromised of JSON media type and additional parameters that retrieve only necessary metadata from an object.

Source

pub fn get_metadata( &self, name: &str, gp: &GetParams, ) -> Result<Request<Vec<u8>>, Error>

Get a single metadata instance for a named resource

Source

pub fn list_metadata(&self, lp: &ListParams) -> Result<Request<Vec<u8>>, Error>

List a collection of metadata of a resource

Source

pub fn watch_metadata( &self, wp: &WatchParams, ver: &str, ) -> Result<Request<Vec<u8>>, Error>

Watch metadata of a resource at a given version

Source

pub fn patch_metadata<P>( &self, name: &str, pp: &PatchParams, patch: &Patch<P>, ) -> Result<Request<Vec<u8>>, Error>
where P: Serialize,

Patch an instance of a resource and receive its metadata only

Requires a serialized merge-patch+json at the moment

Source§

impl Request

Source

pub fn logs( &self, name: &str, lp: &LogParams, ) -> Result<Request<Vec<u8>>, Error>

Get a pod logs

Source§

impl Request

Source

pub fn evict( &self, name: &str, ep: &EvictParams, ) -> Result<Request<Vec<u8>>, Error>

Create an eviction

Source§

impl Request

Source

pub fn attach( &self, name: &str, ap: &AttachParams, ) -> Result<Request<Vec<u8>>, Error>

Attach to a pod

Source§

impl Request

Source

pub fn exec<I, T>( &self, name: &str, command: I, ap: &AttachParams, ) -> Result<Request<Vec<u8>>, Error>
where I: IntoIterator<Item = T>, T: Into<String>,

Execute command in a pod

Source§

impl Request

Source

pub fn portforward( &self, name: &str, ports: &[u16], ) -> Result<Request<Vec<u8>>, Error>

Request to forward ports of a pod

Source§

impl Request

Source

pub fn restart(&self, name: &str) -> Result<Request<Vec<u8>>, Error>

Restart a resource

Source§

impl Request

Source

pub fn cordon(&self, name: &str) -> Result<Request<Vec<u8>>, Error>

Cordon a resource

Source

pub fn uncordon(&self, name: &str) -> Result<Request<Vec<u8>>, Error>

Uncordon a resource

Trait Implementations§

Source§

impl Clone for Request

Source§

fn clone(&self) -> Request

Returns a copy 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 Debug for Request

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, dst: *mut u8)

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

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T