Struct ceph::CephClient[][src]

pub struct CephClient { /* fields omitted */ }

A CephClient is a struct that handles communicating with Ceph in a nicer, Rustier way

let client = CephClient::new("admin", "/etc/ceph/ceph.conf")?;
let tree = client.osd_tree()?;

Implementations

impl CephClient[src]

pub fn new<T1: AsRef<str>, T2: AsRef<str>>(
    user_id: T1,
    config_file: T2
) -> Result<CephClient, RadosError>
[src]

pub fn simulate(self) -> Self[src]

pub fn osd_out(&self, osd_id: u64) -> Result<(), RadosError>[src]

pub fn osd_crush_remove(&self, osd_id: u64) -> Result<(), RadosError>[src]

pub fn osd_pool_get(
    &self,
    pool: &str,
    choice: &PoolOption
) -> Result<String, RadosError>
[src]

Query a ceph pool.

pub fn osd_pool_set(
    &self,
    pool: &str,
    key: &str,
    value: &str
) -> Result<(), RadosError>
[src]

Set a pool value

pub fn osd_set(&self, key: OsdOption, force: bool) -> Result<(), RadosError>[src]

Can be used to set options on an OSD

let client = CephClient::new("admin", "/etc/ceph/ceph.conf")?;
client.osd_set(OsdOption::NoDown, false)?;

pub fn osd_unset(&self, key: OsdOption) -> Result<(), RadosError>[src]

Can be used to unset options on an OSD

let client = CephClient::new("admin", "/etc/ceph/ceph.conf")?;
client.osd_unset(OsdOption::NoDown)?;

pub fn osd_tree(&self) -> Result<CrushTree, RadosError>[src]

pub fn status(&self) -> Result<String, RadosError>[src]

Get cluster status

pub fn mon_dump(&self) -> Result<MonDump, RadosError>[src]

List all the monitors in the cluster and their current rank

pub fn mon_quorum(&self) -> Result<String, RadosError>[src]

Get the mon quorum

pub fn version(&self) -> Result<CephVersion, RadosError>[src]

Show mon daemon version

pub fn osd_pool_quota_get(&self, pool: &str) -> Result<u64, RadosError>[src]

pub fn auth_del(&self, osd_id: u64) -> Result<(), RadosError>[src]

pub fn osd_rm(&self, osd_id: u64) -> Result<(), RadosError>[src]

pub fn osd_create(&self, id: Option<u64>) -> Result<u64, RadosError>[src]

pub fn mgr_auth_add(&self, mgr_id: &str) -> Result<(), RadosError>[src]

pub fn osd_auth_add(&self, osd_id: u64) -> Result<(), RadosError>[src]

pub fn auth_get_key(
    &self,
    client_type: &str,
    id: &str
) -> Result<String, RadosError>
[src]

Get a ceph-x key. The id parameter can be either a number or a string depending on the type of client so I went with string.

pub fn osd_crush_add(
    &self,
    osd_id: u64,
    weight: f64,
    host: &str
) -> Result<(), RadosError>
[src]

add or update crushmap position and weight for an osd

pub fn osd_crush_reweight(
    &self,
    osd_id: u64,
    weight: f64
) -> Result<(), RadosError>
[src]

reweight an osd in the CRUSH map

pub fn osd_safe_to_destroy(&self, osd_id: u64) -> bool[src]

check if a single osd is safe to destroy/remove

pub fn mgr_dump(&self) -> Result<MgrDump, RadosError>[src]

pub fn mgr_fail(&self, mgr_id: &str) -> Result<(), RadosError>[src]

pub fn mgr_list_modules(&self) -> Result<Vec<String>, RadosError>[src]

pub fn mgr_list_services(&self) -> Result<Vec<String>, RadosError>[src]

pub fn mgr_enable_module(
    &self,
    module: &str,
    force: bool
) -> Result<(), RadosError>
[src]

pub fn mgr_disable_module(&self, module: &str) -> Result<(), RadosError>[src]

pub fn mgr_metadata(&self) -> Result<Vec<MgrMetadata>, RadosError>[src]

pub fn osd_metadata(&self) -> Result<Vec<OsdMetadata>, RadosError>[src]

pub fn mgr_count_metadata(
    &self,
    property: &str
) -> Result<HashMap<String, u64>, RadosError>
[src]

pub fn mgr_versions(&self) -> Result<HashMap<String, u64>, RadosError>[src]

pub fn run_command(&self, command: MonCommand<'_>) -> Result<String, RadosError>[src]

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> Instrument for T[src]

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

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.