[][src]Struct kube::Resource

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

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, 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]

impl Debug for Resource[src]

impl TryFrom<DynamicResource> for Resource[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Sealed<T> for T where
    T: ?Sized

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

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.