Trait kubeclient::clients::WriteClient
[−]
[src]
pub trait WriteClient { type R; fn create(&self, resource: &Self::R) -> Result<Self::R>; fn delete(&self, name: &str) -> Result<()>; }
Associated Types
type R
Required Methods
fn create(&self, resource: &Self::R) -> Result<Self::R>
Creates the named resource
This is similar to the kubectl create
CLI commands.
Note: most of the resource type defintions are incomplete Pull requests to fill missing fields/types are appreciated (especially if documented).
Examples:
let kube = Kubernetes::load_conf("admin.conf")?; let mut cfg_map = ConfigMap::new("stage-config")?; cfg_map.insert("environment", "production"); // Note: using the `config_maps()` builder here is optional since resource type can be inferred let response = kube.config_maps().create(&cfg_map)?;
fn delete(&self, name: &str) -> Result<()>
Deleteds the named resource
This is similar to the kubectl delete
CLI commands.
Examples
let kube = Kubernetes::load_conf("admin.conf")?; kube.config_maps().delete("my-config-map")?;
Implementors
impl<R: Resource> WriteClient for KubeClient<R> type R = R;