]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/controllers/telemetry.py
1 # -*- coding: utf-8 -*-
4 from ..exceptions
import DashboardException
5 from ..security
import Scope
6 from . import APIDoc
, APIRouter
, EndpointDoc
, RESTController
10 "leaderboard": (bool, ""),
11 "report_version": (int, ""),
12 "report_timestamp": (str, ""),
13 "report_id": (str, ""),
14 "channels": ([str], ""),
15 "channels_available": ([str], ""),
21 "persistent": ([str], ""),
22 "optional": ([int], "")
24 "min_mon_release": (int, ""),
25 "v1_addr_mons": (int, ""),
26 "v2_addr_mons": (int, ""),
27 "ipv4_addr_mons": (int, ""),
28 "ipv6_addr_mons": (int, ""),
31 "cluster_changed": ([str], ""),
32 "active_changed": ([str], "")
35 "num_pools": (int, ""),
36 "num_images_by_pool": ([int], ""),
37 "mirroring_by_pool": ([bool], ""),
45 "min_size": (int, ""),
46 "pg_autoscale_mode": (str, ""),
47 "target_max_bytes": (int, ""),
48 "target_max_objects": (int, ""),
49 "erasure_code_profile": (str, ""),
50 "cache_mode": (str, ""),
54 "require_osd_release": (str, ""),
55 "require_min_compat_client": (str, ""),
56 "cluster_network": (bool, ""),
59 "num_devices": (int, ""),
60 "num_types": (int, ""),
61 "num_buckets": (int, ""),
62 "num_rules": (int, ""),
63 "device_classes": ([int], ""),
65 "choose_local_tries": (int, ""),
66 "choose_local_fallback_tries": (int, ""),
67 "choose_total_tries": (int, ""),
68 "chooseleaf_descend_once": (int, ""),
69 "chooseleaf_vary_r": (int, ""),
70 "chooseleaf_stable": (int, ""),
71 "straw_calc_version": (int, ""),
72 "allowed_bucket_algs": (int, ""),
74 "optimal_tunables": (int, ""),
75 "legacy_tunables": (int, ""),
76 "minimum_required_version": (str, ""),
77 "require_feature_tunables": (int, ""),
78 "require_feature_tunables2": (int, ""),
79 "has_v2_rules": (int, ""),
80 "require_feature_tunables3": (int, ""),
81 "has_v3_rules": (int, ""),
82 "has_v4_buckets": (int, ""),
83 "require_feature_tunables5": (int, ""),
84 "has_v5_rules": (int, ""),
86 "compat_weight_set": (bool, ""),
87 "num_weight_sets": (int, ""),
103 "enable_multiple": (bool, ""),
104 "ever_enabled_multiple": (bool, ""),
106 "num_standby_mds": (int, ""),
107 "filesystems": ([int], ""),
108 "total_num_mds": (int, ""),
112 "osd_objectstore": ({
113 "bluestore": (int, ""),
122 "ceph version 16.0.0-3151-gf202994fcf": (int, ""),
128 "Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz": (int, ""),
130 "kernel_description": ({
131 "#1 SMP Wed Jul 1 19:53:01 UTC 2020": (int, ""),
134 "5.7.7-200.fc32.x86_64": (int, ""),
136 "distro_description": ({
137 "CentOS Linux 8 (Core)": (int, ""),
148 "ceph version 16.0.0-3151-gf202994fcf": (int, ""),
154 "Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz": (int, ""),
156 "kernel_description": ({
157 "#1 SMP Wed Jul 1 19:53:01 UTC 2020": (int, ""),
160 "5.7.7-200.fc32.x86_64": (int, ""),
162 "distro_description": ({
163 "CentOS Linux 8 (Core)": (int, ""),
172 "num_with_mon": (int, ""),
173 "num_with_mds": (int, ""),
174 "num_with_osd": (int, ""),
175 "num_with_mgr": (int, ""),
180 "total_used_bytes": (int, ""),
181 "total_bytes": (int, ""),
182 "total_avail_bytes": (int, ""),
190 "zonegroups": (int, ""),
191 "frontends": ([str], "")
194 "active": (bool, ""),
197 "crashes": ([int], "")
199 "device_report": (str, "")
203 @APIRouter('/telemetry', Scope
.CONFIG_OPT
)
204 @APIDoc("Display Telemetry Report", "Telemetry")
205 class Telemetry(RESTController
):
207 @RESTController.Collection('GET')
208 @EndpointDoc("Get Detailed Telemetry report",
209 responses
={200: REPORT_SCHEMA
})
212 Get Ceph and device report data
213 :return: Ceph and device report data
216 return mgr
.remote('telemetry', 'get_report_locked', 'all')
218 def singleton_set(self
, enable
=True, license_name
=None):
220 Enables or disables sending data collected by the Telemetry
222 :param enable: Enable or disable sending data
224 :param license_name: License string e.g. 'sharing-1-0' to
225 make sure the user is aware of and accepts the license
226 for sharing Telemetry data.
227 :type license_name: string
230 if not license_name
or (license_name
!= 'sharing-1-0'):
231 raise DashboardException(
232 code
='telemetry_enable_license_missing',
233 msg
='Telemetry data is licensed under the Community Data License Agreement - '
234 'Sharing - Version 1.0 (https://cdla.io/sharing-1-0/). To enable, add '
235 '{"license": "sharing-1-0"} to the request payload.'
237 mgr
.remote('telemetry', 'on', license_name
)
239 mgr
.remote('telemetry', 'off')