[−][src]Struct kube::Api
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]
K: Resource,
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]
K: Clone + DeserializeOwned + Meta,
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]
&'_ self,
pp: &'_ PostParams,
data: Vec<u8>
) -> Result<K>
pub async fn delete<'_, '_, '_>(
&'_ self,
name: &'_ str,
dp: &'_ DeleteParams
) -> Result<Either<K, Status>>
[src]
&'_ self,
name: &'_ str,
dp: &'_ DeleteParams
) -> Result<Either<K, Status>>
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]
&'_ self,
lp: &'_ ListParams
) -> Result<Either<ObjectList<K>, Status>>
pub async fn patch<'_, '_, '_>(
&'_ self,
name: &'_ str,
pp: &'_ PatchParams,
patch: Vec<u8>
) -> Result<K>
[src]
&'_ self,
name: &'_ str,
pp: &'_ PatchParams,
patch: Vec<u8>
) -> Result<K>
pub async fn replace<'_, '_, '_>(
&'_ self,
name: &'_ str,
pp: &'_ PostParams,
data: Vec<u8>
) -> Result<K>
[src]
&'_ self,
name: &'_ str,
pp: &'_ PostParams,
data: Vec<u8>
) -> Result<K>
pub async fn watch<'_, '_, '_>(
&'_ self,
lp: &'_ ListParams,
version: &'_ str
) -> Result<impl Stream<Item = WatchEvent<K>>>
[src]
&'_ self,
lp: &'_ ListParams,
version: &'_ str
) -> Result<impl Stream<Item = WatchEvent<K>>>
impl<K> Api<K> where
K: Clone + DeserializeOwned,
[src]
K: Clone + DeserializeOwned,
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]
&'_ self,
name: &'_ str,
pp: &'_ PatchParams,
patch: Vec<u8>
) -> Result<Scale>
pub async fn replace_scale<'_, '_, '_>(
&'_ self,
name: &'_ str,
pp: &'_ PostParams,
data: Vec<u8>
) -> Result<Scale>
[src]
&'_ self,
name: &'_ str,
pp: &'_ PostParams,
data: Vec<u8>
) -> Result<Scale>
impl<K> Api<K> where
K: Clone + DeserializeOwned,
[src]
K: Clone + DeserializeOwned,
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]
&'_ self,
name: &'_ str,
pp: &'_ PatchParams,
patch: Vec<u8>
) -> Result<K>
pub async fn replace_status<'_, '_, '_>(
&'_ self,
name: &'_ str,
pp: &'_ PostParams,
data: Vec<u8>
) -> Result<K>
[src]
&'_ self,
name: &'_ str,
pp: &'_ PostParams,
data: Vec<u8>
) -> Result<K>
impl<K> Api<K> where
K: Clone + DeserializeOwned + LoggingObject,
[src]
K: Clone + DeserializeOwned + LoggingObject,
pub async fn log<'_, '_, '_>(
&'_ self,
name: &'_ str,
lp: &'_ LogParams
) -> Result<String>
[src]
&'_ self,
name: &'_ str,
lp: &'_ LogParams
) -> Result<String>
pub async fn log_stream<'_, '_, '_>(
&'_ self,
name: &'_ str,
lp: &'_ LogParams
) -> Result<impl Stream<Item = Result<Bytes>>>
[src]
&'_ self,
name: &'_ str,
lp: &'_ LogParams
) -> Result<impl Stream<Item = Result<Bytes>>>
Trait Implementations
Auto Trait Implementations
impl<K> !RefUnwindSafe for Api<K>
impl<K> Send for Api<K> where
K: Send,
K: Send,
impl<K> Sync for Api<K> where
K: Sync,
K: Sync,
impl<K> Unpin for Api<K> where
K: Unpin,
K: Unpin,
impl<K> !UnwindSafe for Api<K>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,