summaryrefslogtreecommitdiffstats
path: root/src/common/json/BalancerStructures.cc
blob: 48dfb84376113a5a2f7da20a331ee8c7da082aeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "BalancerStructures.h"

#include "common/ceph_json.h"

using namespace ceph::messaging::balancer;

void BalancerOffRequest::dump(Formatter* f) const {
  encode_json("prefix", "balancer off", f);
}

void BalancerOffRequest::decode_json(JSONObj* obj) {}

void BalancerStatusRequest::dump(Formatter* f) const {
  encode_json("prefix", "balancer status", f);
}

void BalancerStatusRequest::decode_json(JSONObj* obj) {}

void BalancerStatusReply::dump(Formatter* f) const {
  encode_json("active", active, f);
  encode_json("last_optimization_duration", last_optimization_duration, f);
  encode_json("last_optimization_started", last_optimization_started, f);
  encode_json("mode", mode, f);
  encode_json("no_optimization_needed", no_optimization_needed, f);
  encode_json("optimize_result", optimize_result, f);
}

void BalancerStatusReply::decode_json(JSONObj* obj) {
  JSONDecoder::decode_json("active", active, obj);
  JSONDecoder::decode_json("last_optimization_duration",
                           last_optimization_duration, obj);
  JSONDecoder::decode_json("last_optimization_started",
                           last_optimization_started, obj);
  JSONDecoder::decode_json("mode", mode, obj);
  JSONDecoder::decode_json("no_optimization_needed", no_optimization_needed,
                           obj);
  JSONDecoder::decode_json("optimize_result", optimize_result, obj);
}