[−][src]Struct kube::api::Api
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]
K: Clone + DeserializeOwned + KubeObject,
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>>>
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 + KubeObject + LoggingObject,
[src]
K: Clone + DeserializeOwned + KubeObject + LoggingObject,
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,
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
Auto Trait Implementations
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>
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]
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 = !
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,