Struct kube::Resource [−][src]
A Kubernetes resource that can be accessed through the API
Fields
api_version: String
The API version of the resource.
This is a composite of Resource::GROUP
and Resource::VERSION
(eg “apiextensions.k8s.io/v1beta1”)
or just the version for resources without a group (eg “v1”).
This is the string used in the apiVersion
field of the resource’s serialized form.
group: String
The group of the resource
or the empty string if the resource doesn’t have a group.
kind: String
The kind of the resource.
This is the string used in the kind field of the resource’s serialized form.
version: String
The version of the resource.
namespace: Option<String>
The namespace if the resource resides (if namespaced)
Implementations
impl Resource
[src]
pub fn all<K: Resource>() -> Self
[src]
Cluster level resources, or resources viewed across all namespaces
pub fn namespaced<K: Resource>(ns: &str) -> Self
[src]
Namespaced resource within a given namespace
pub fn dynamic(kind: &str) -> DynamicResource
[src]
Manually configured resource or custom resource
This is the only entrypoint to Resource
that bypasses k8s_openapi
entirely.
If you need a CustomResource
consider using kube-derive
for its
#[derive(CustomResource)]
proc-macro.
impl Resource
[src]
Convenience methods found from API conventions
pub fn list(&self, lp: &ListParams) -> Result<Request<Vec<u8>>>
[src]
List a collection of a resource
pub fn watch(&self, lp: &ListParams, ver: &str) -> Result<Request<Vec<u8>>>
[src]
Watch a resource at a given version
pub fn get(&self, name: &str) -> Result<Request<Vec<u8>>>
[src]
Get a single instance
pub fn create(&self, pp: &PostParams, data: Vec<u8>) -> Result<Request<Vec<u8>>>
[src]
Create an instance of a resource
pub fn delete(&self, name: &str, dp: &DeleteParams) -> Result<Request<Vec<u8>>>
[src]
Delete an instance of a resource
pub fn delete_collection(
&self,
dp: &DeleteParams,
lp: &ListParams
) -> Result<Request<Vec<u8>>>
[src]
&self,
dp: &DeleteParams,
lp: &ListParams
) -> Result<Request<Vec<u8>>>
Delete a collection of a resource
pub fn patch<P: Serialize>(
&self,
name: &str,
pp: &PatchParams,
patch: &Patch<P>
) -> Result<Request<Vec<u8>>>
[src]
&self,
name: &str,
pp: &PatchParams,
patch: &Patch<P>
) -> Result<Request<Vec<u8>>>
Patch an instance of a resource
Requires a serialized merge-patch+json at the moment.
pub fn replace(
&self,
name: &str,
pp: &PostParams,
data: Vec<u8>
) -> Result<Request<Vec<u8>>>
[src]
&self,
name: &str,
pp: &PostParams,
data: Vec<u8>
) -> Result<Request<Vec<u8>>>
Replace an instance of a resource
Requires metadata.resourceVersion
set in data
impl Resource
[src]
Scale subresource
pub fn get_scale(&self, name: &str) -> Result<Request<Vec<u8>>>
[src]
Get an instance of the scale subresource
pub fn patch_scale<P: Serialize>(
&self,
name: &str,
pp: &PatchParams,
patch: &Patch<P>
) -> Result<Request<Vec<u8>>>
[src]
&self,
name: &str,
pp: &PatchParams,
patch: &Patch<P>
) -> Result<Request<Vec<u8>>>
Patch an instance of the scale subresource
pub fn replace_scale(
&self,
name: &str,
pp: &PostParams,
data: Vec<u8>
) -> Result<Request<Vec<u8>>>
[src]
&self,
name: &str,
pp: &PostParams,
data: Vec<u8>
) -> Result<Request<Vec<u8>>>
Replace an instance of the scale subresource
impl Resource
[src]
Status subresource
pub fn get_status(&self, name: &str) -> Result<Request<Vec<u8>>>
[src]
Get an instance of the status subresource
pub fn patch_status<P: Serialize>(
&self,
name: &str,
pp: &PatchParams,
patch: &Patch<P>
) -> Result<Request<Vec<u8>>>
[src]
&self,
name: &str,
pp: &PatchParams,
patch: &Patch<P>
) -> Result<Request<Vec<u8>>>
Patch an instance of the status subresource
pub fn replace_status(
&self,
name: &str,
pp: &PostParams,
data: Vec<u8>
) -> Result<Request<Vec<u8>>>
[src]
&self,
name: &str,
pp: &PostParams,
data: Vec<u8>
) -> Result<Request<Vec<u8>>>
Replace an instance of the status subresource
impl Resource
[src]
impl Resource
[src]
pub fn evict(&self, name: &str, ep: &EvictParams) -> Result<Request<Vec<u8>>>
[src]
Create an eviction
impl Resource
[src]
pub fn attach(&self, name: &str, ap: &AttachParams) -> Result<Request<Vec<u8>>>
[src]
ws
only.Attach to a pod
impl Resource
[src]
pub fn exec<I, T>(
&self,
name: &str,
command: I,
ap: &AttachParams
) -> Result<Request<Vec<u8>>> where
I: IntoIterator<Item = T>,
T: Into<String>,
[src]
&self,
name: &str,
command: I,
ap: &AttachParams
) -> Result<Request<Vec<u8>>> where
I: IntoIterator<Item = T>,
T: Into<String>,
ws
only.Execute command in a pod
Trait Implementations
impl Clone for Resource
[src]
impl Debug for Resource
[src]
impl TryFrom<DynamicResource> for Resource
[src]
Auto Trait Implementations
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,