Struct kube::Api[][src]

pub struct Api<K> { /* fields omitted */ }
Expand description

An easy Api interaction helper

The upsides of working with this rather than a Resource directly are:

  • easiers serialization interface (no figuring out return types)
  • client hidden within, less arguments

But the downsides are:

  • openapi types can take up a large amount of memory
  • openapi types can be annoying to wrangle with their heavy Option use
  • no control over requests (opinionated)

Implementations

impl<K> Api<K> where
    K: Resource
[src]

Expose same interface as Api for controlling scope/group/versions/ns

pub fn all(client: APIClient) -> Self[src]

Cluster level resources, or resources viewed across all namespaces

pub fn namespaced(client: APIClient, ns: &str) -> Self[src]

Namespaced resource within a given namespace

impl<K> Api<K> where
    K: Clone + DeserializeOwned + Meta
[src]

PUSH/PUT/POST/GET abstractions

pub async fn get(&self, name: &str) -> Result<K>[src]

pub async fn create(&self, pp: &PostParams, data: &K) -> Result<K> where
    K: Serialize
[src]

pub async fn delete(
    &self,
    name: &str,
    dp: &DeleteParams
) -> Result<Either<K, Status>>
[src]

pub async fn list(&self, lp: &ListParams) -> Result<ObjectList<K>>[src]

pub async fn delete_collection(
    &self,
    lp: &ListParams
) -> Result<Either<ObjectList<K>, Status>>
[src]

pub async fn patch(
    &self,
    name: &str,
    pp: &PatchParams,
    patch: Vec<u8>
) -> Result<K>
[src]

pub async fn replace(&self, name: &str, pp: &PostParams, data: &K) -> Result<K> where
    K: Serialize
[src]

pub async fn watch(
    &self,
    lp: &ListParams,
    version: &str
) -> Result<impl Stream<Item = WatchEvent<K>>>
[src]

impl<K> Api<K> where
    K: Clone + DeserializeOwned
[src]

Scale subresource

https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#scale-subresource

pub async fn get_scale(&self, name: &str) -> Result<Scale>[src]

pub async fn patch_scale(
    &self,
    name: &str,
    pp: &PatchParams,
    patch: Vec<u8>
) -> Result<Scale>
[src]

pub async fn replace_scale(
    &self,
    name: &str,
    pp: &PostParams,
    data: Vec<u8>
) -> Result<Scale>
[src]

impl<K> Api<K> where
    K: Clone + DeserializeOwned
[src]

Status subresource

https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#status-subresource

pub async fn get_status(&self, name: &str) -> Result<K>[src]

pub async fn patch_status(
    &self,
    name: &str,
    pp: &PatchParams,
    patch: Vec<u8>
) -> Result<K>
[src]

pub async fn replace_status(
    &self,
    name: &str,
    pp: &PostParams,
    data: Vec<u8>
) -> Result<K>
[src]

impl<K> Api<K> where
    K: Clone + DeserializeOwned + LoggingObject
[src]

pub async fn logs(&self, name: &str, lp: &LogParams) -> Result<String>[src]

pub async fn log_stream(
    &self,
    name: &str,
    lp: &LogParams
) -> Result<impl Stream<Item = Result<Bytes>>>
[src]

Trait Implementations

impl<K: Clone> Clone for Api<K>[src]

fn clone(&self) -> Api<K>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<K> !RefUnwindSafe for Api<K>

impl<K> Send for Api<K> where
    K: Send

impl<K> Sync for Api<K> where
    K: Sync

impl<K> Unpin for Api<K> where
    K: Unpin

impl<K> !UnwindSafe for Api<K>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.