Skip to content

Commit cc4d65f

Browse files
author
Chris Jones
committed
Updated json data
1 parent 3e9c959 commit cc4d65f

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

examples/ceph.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ fn main() {
9696
let s: &str = str::from_utf8(slice).unwrap();
9797
println!("rados_cluster_fsid len: {} - {}", len, s);
9898

99+
let ping_monitor = ceph_helpers::ping_monitor(cluster, "ceph-mon.ceph-vm1"); // Change to support your mon name
100+
println!("Ping monitor: {:?}", ping_monitor);
101+
99102
// Rust specific example...
100103
let cluster_stat = ceph_helpers::rados_stat_cluster(cluster);
101104
println!("Cluster stat: {:?}", cluster_stat);

src/ceph.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,15 @@ pub fn rados_fsid(cluster: rados_t) -> Result<Uuid, RadosError> {
15791579
/// May be used as a simply way to assess liveness, or to obtain
15801580
/// information about the monitor in a simple way even in the
15811581
/// absence of quorum.
1582+
/// NB: There must be a section in ceph.conf like `[mon.whatever_name]` for this to work.
1583+
/// Example of how Chef-bcs builds a Ceph cluster for testing with VirtualBox:
1584+
/// `[mon]`
1585+
/// ` mon host = ceph-vm1, ceph-vm2, ceph-vm3`
1586+
/// ` mon addr = 10.0.100.21:6789, 10.0.100.22:6789, 10.0.100.23:6789`
1587+
///
1588+
/// `[mon.ceph-vm1]`
1589+
/// ` mon host = ceph-vm1`
1590+
/// ` mon addr = 10.0.100.21:6789`
15821591
pub fn ping_monitor(cluster: rados_t, mon_id: &str) -> Result<String, RadosError> {
15831592
if cluster.is_null() {
15841593
return Err(RadosError::new("Rados not connected. Please initialize cluster".to_string()));

src/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::str;
1717
use rustc_serialize::json::*;
1818

1919
use JsonData;
20-
use JsonValue;
20+
// use JsonValue;
2121

2222
/// First json call that takes a JSON formatted string and converts it to JsonData object that can
2323
/// then be traversed using `json_find` via the key path.

src/status.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ pub struct CephStatusHealthMons {
8383

8484
#[derive(RustcDecodable, RustcEncodable)]
8585
pub struct CephStatusHealthSummary {
86-
dummy: String,
86+
severity: String,
87+
summary: String,
8788
}
8889

8990
#[derive(RustcDecodable, RustcEncodable)]

0 commit comments

Comments
 (0)