[][src]Struct kube::api::Api

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

A typed Api variant that does not expose request internals

The upsides of working with this rather than RawApi direct are:

  • easiers interface (no figuring out return types)
  • openapi types for free

But the downsides are:

  • k8s-openapi dependency required (behind feature)
  • openapi types are unnecessarily heavy on Option use
  • memory intensive structs because they contain the full data
  • no control over requests (opinionated)

Methods

impl<K> Api<K>[src]

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

pub fn within(self, ns: &str) -> Self[src]

pub fn group(self, group: &str) -> Self[src]

pub fn version(self, version: &str) -> Self[src]

impl<K> Api<K> where
    K: Clone + DeserializeOwned + KubeObject
[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]

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 + KubeObject + LoggingObject, 
[src]

pub async fn log<'_, '_, '_>(
    &'_ self,
    name: &'_ str,
    lp: &'_ LogParams
) -> Result<String>
[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]

Api Constructor for CRDs

Because it relies entirely on user definitions, this ctor does not rely on openapi.

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

Trait Implementations

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

Auto Trait Implementations

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>

impl<K> !RefUnwindSafe for Api<K>

Blanket Implementations

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 = !

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.

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

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

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