Struct kube::api::Resource[][src]

pub struct Resource {
    pub api_version: String,
    pub group: String,
    pub kind: String,
    pub version: String,
    pub namespace: Option<String>,
}
Expand description

The Resource information needed to operate a kubernetes client

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

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, lp: &ListParams) -> Result<Request<Vec<u8>>>[src]

Delete a collection of a resource

pub fn patch(
    &self,
    name: &str,
    pp: &PatchParams,
    patch: Vec<u8>
) -> Result<Request<Vec<u8>>>
[src]

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]

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(
    &self,
    name: &str,
    pp: &PatchParams,
    patch: Vec<u8>
) -> Result<Request<Vec<u8>>>
[src]

Patch an instance of the scale subresource

pub fn replace_scale(
    &self,
    name: &str,
    pp: &PostParams,
    data: Vec<u8>
) -> Result<Request<Vec<u8>>>
[src]

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(
    &self,
    name: &str,
    pp: &PatchParams,
    patch: Vec<u8>
) -> Result<Request<Vec<u8>>>
[src]

Patch an instance of the status subresource

pub fn replace_status(
    &self,
    name: &str,
    pp: &PostParams,
    data: Vec<u8>
) -> Result<Request<Vec<u8>>>
[src]

Replace an instance of the status subresource

impl Resource[src]

pub fn logs(&self, name: &str, lp: &LogParams) -> Result<Request<Vec<u8>>>[src]

Get a pod logs

Trait Implementations

impl Clone for Resource[src]

fn clone(&self) -> Resource[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Resource[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<CustomResource> for Resource[src]

Make Resource useable on CRDs without k8s_openapi

fn from(c: CustomResource) -> Self[src]

Performs the conversion.

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.