ceph_async/
status.rs

1// Copyright 2017 LambdaStack All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#[derive(Deserialize, Serialize)]
16pub struct CephStatus {
17    health: CephStatusHealth,
18    fsid: String,
19    election_epoch: u32,
20    quorum: Vec<u32>,
21    quorum_names: Vec<String>,
22    monmap: CephStatusMonMap,
23    osdmap: CephStatusOSDMapH,
24    pgmap: CephStatusPGMap,
25    mdsmap: CephStatusMDSMap,
26}
27
28#[derive(Deserialize, Serialize)]
29pub struct CephStatusHealth {
30    health: CephStatusHealth2,
31    timechecks: CephStatusHealthTimeChecks,
32    summary: Vec<CephStatusHealthSummary>,
33    overall_status: String,
34    detail: Vec<CephStatusHealthDetail>,
35}
36
37#[derive(Deserialize, Serialize)]
38pub struct CephStatusHealth2 {
39    health: Vec<CephStatusHealthServices>,
40}
41
42#[derive(Deserialize, Serialize)]
43pub struct CephStatusHealthServices {
44    mons: Vec<CephStatusHealthServicesMon>,
45}
46
47#[derive(Deserialize, Serialize)]
48pub struct CephStatusHealthServicesMon {
49    name: String,
50    kb_total: u32,
51    kb_used: u32,
52    kb_avail: u32,
53    avail_percent: u16,
54    last_updated: String,
55    store_stats: CephStatusHealthServicesMonStats,
56    health: String,
57}
58
59#[derive(Deserialize, Serialize)]
60pub struct CephStatusHealthServicesMonStats {
61    bytes_total: u64,
62    bytes_sst: u64,
63    bytes_log: u64,
64    bytes_misc: u64,
65    last_updated: String,
66}
67
68#[derive(Deserialize, Serialize)]
69pub struct CephStatusHealthTimeChecks {
70    epoch: u32,
71    round: u32,
72    round_status: String,
73    mons: Vec<CephStatusHealthMons>,
74}
75
76#[derive(Deserialize, Serialize)]
77pub struct CephStatusHealthMons {
78    name: String,
79    skew: f32,
80    latency: f32,
81    health: String,
82}
83
84#[derive(Deserialize, Serialize)]
85pub struct CephStatusHealthSummary {
86    severity: String,
87    summary: String,
88}
89
90#[derive(Deserialize, Serialize)]
91pub struct CephStatusHealthDetail {
92    dummy: String,
93}
94
95#[derive(Deserialize, Serialize)]
96pub struct CephStatusMonMap {
97    epoch: u32,
98    fsid: String,
99    modified: String,
100    created: String,
101    mons: Vec<CephStatusMonRank>,
102}
103
104#[derive(Deserialize, Serialize)]
105pub struct CephStatusMonRank {
106    rank: u16,
107    name: String,
108    addr: String,
109}
110
111#[derive(Deserialize, Serialize)]
112pub struct CephStatusOSDMapH {
113    osdmap: CephStatusOSDMapL,
114}
115
116#[derive(Deserialize, Serialize)]
117pub struct CephStatusOSDMapL {
118    epoch: u32,
119    num_osds: u32,
120    num_up_osds: u32,
121    num_in_osds: u32,
122    full: bool,
123    nearfull: bool,
124    num_remapped_pgs: u32,
125}
126
127#[derive(Deserialize, Serialize)]
128pub struct CephStatusPGMap {
129    pgs_by_state: Vec<CephStatusPGState>,
130    version: u32,
131    num_pgs: u32,
132    data_bytes: u64,
133    bytes_used: u64,
134    bytes_avail: u64,
135    bytes_total: u64,
136}
137
138#[derive(Deserialize, Serialize)]
139pub struct CephStatusPGState {
140    state_name: String,
141    count: u32,
142}
143
144#[derive(Deserialize, Serialize)]
145pub struct CephStatusMDSMap {
146    epoch: u32,
147    up: u32,
148    _in: u32,
149    max: u32,
150    by_rank: Vec<CephStatusMDSRank>,
151}
152
153#[derive(Deserialize, Serialize)]
154pub struct CephStatusMDSRank {
155    rank: u16,
156    name: String,
157    addr: String,
158}