Kubeapi

Struct Kubeapi 

Source
pub struct Kubeapi { /* private fields */ }
Expand description

Kubeapi is a higher-level Kubernetes API client that provides additional features such as caching, namespace management, and easier access to common Kubernetes resources.

Implementations§

Source§

impl Kubeapi

Source

pub async fn features(&self) -> Result<Vec<Feature>>

Source

pub async fn metrics(&self) -> Result<Scrape>

Source§

impl Kubeapi

Source

pub async fn info(&self) -> Result<()>

Source§

impl Kubeapi

Source

pub async fn kubeconfig( options: KubeConfigOptions, debug: bool, ) -> Result<(Config, Kubeconfig), KubeconfigError>

Source

pub fn current_context(&self) -> Result<()>

Source

pub fn get_clusters(&self) -> Result<()>

Source

pub fn get_contexts(&self) -> Result<()>

Source

pub fn get_users(&self) -> Result<()>

Source

pub fn view(&self) -> Result<()>

Source§

impl Kubeapi

Source

pub async fn raw_get(&self, name: &str) -> Result<String>

Perform a raw GET request to the Kubernetes API server. The name parameter is the path to the resource, e.g., “metrics”.

Source§

impl Kubeapi

Source§

impl Kubeapi

Source

pub async fn version(&self) -> Result<String>

Source§

impl Kubeapi

Source

pub async fn new( config: &KubeConfigOptions, options: &KubeapiOptions, debug: bool, ) -> Result<Self>

Source

pub fn cluster_url(&self) -> String

Source

pub fn debug(&self, item: impl Debug)

Source

pub fn client(&self) -> Result<Client>

Create a kube::Client from the current configuration.

Source

pub fn with_namespace(self, namespace: Namespace) -> Self

Set the namespace for the Kubeapi instance. This method returns a new instance with the updated namespace.

Source

pub fn namespace(&self) -> &Namespace

Get the current namespace of the Kubeapi instance.

Source

pub fn show_namespace(&self) -> bool

Source

pub fn cached_server_api_resources(&self) -> Vec<APIResourceList>

Source

pub async fn server_preferred_resources(&self) -> Result<Vec<APIResourceList>>

Source

pub async fn api_versions(&self) -> Result<()>

Source

pub fn dynamic_object_api( &self, scope: Scope, dyntype: &ApiResource, ) -> Result<Api<DynamicObject>>

Source

pub fn get_params(&self) -> GetParams

Source

pub fn list_params(&self) -> ListParams

Source

pub fn post_params(&self) -> PostParams

Source

pub fn delete_params(&self, cascade: Cascade, dry_run: DryRun) -> DeleteParams

Source

pub fn post_params_with_manager(&self, manager: &str) -> PostParams

Source

pub fn clusterroles(&self) -> Result<Api<ClusterRole>>

Source

pub fn namespaces(&self) -> Result<Api<Namespace>>

Source

pub fn pods(&self) -> Result<Api<Pod>>

Source

pub fn configmaps(&self) -> Result<Api<ConfigMap>>

Source

pub fn secrets(&self) -> Result<Api<Secret>>

Source

pub fn componentstatuses(&self) -> Result<Api<ComponentStatus>>

Source

pub fn nodes(&self) -> Result<Api<Node>>

Source

pub fn selfsubjectaccessreviews(&self) -> Result<Api<SelfSubjectAccessReview>>

Source

pub fn selfsubjectrulesreviews(&self) -> Result<Api<SelfSubjectRulesReview>>

Source

pub fn selfsubjectreviews(&self) -> Result<Api<SelfSubjectReview>>

Source

pub fn inspect<K>(&self, k: &K)
where K: Serialize,

Source

pub fn inspect_err(&self, err: &Error)

Source

pub fn full_name<K>(&self, k: &K) -> String

Source§

impl Kubeapi

Source

pub fn local() -> Self

Trait Implementations§

Source§

impl Debug for Kubeapi

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more