[][src]Struct kube::Api

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

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)

Methods

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: Vec<u8>
) -> Result<K>
[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: Vec<u8>
) -> Result<K>
[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 log<'_, '_, '_>(
    &'_ 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]

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]

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.