]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/controllers/telemetry.py
1 # -*- coding: utf-8 -*-
2 from __future__
import absolute_import
4 from . import ApiController
, RESTController
6 from ..exceptions
import DashboardException
7 from ..security
import Scope
10 @ApiController('/telemetry', Scope
.CONFIG_OPT
)
11 class Telemetry(RESTController
):
13 @RESTController.Collection('GET')
16 Get Ceph and device report data
17 :return: Ceph and device report data
20 return mgr
.remote('telemetry', 'get_report', 'all')
22 def singleton_set(self
, enable
=True, license_name
=None):
24 Enables or disables sending data collected by the Telemetry
26 :param enable: Enable or disable sending data
28 :param license_name: License string e.g. 'sharing-1-0' to
29 make sure the user is aware of and accepts the license
30 for sharing Telemetry data.
31 :type license_name: string
34 if not license_name
or (license_name
!= 'sharing-1-0'):
35 raise DashboardException(
36 code
='telemetry_enable_license_missing',
37 msg
='Telemetry data is licensed under the Community Data License Agreement - '
38 'Sharing - Version 1.0 (https://cdla.io/sharing-1-0/). To enable, add '
39 '{"license": "sharing-1-0"} to the request payload.'
41 mgr
.remote('telemetry', 'on')
43 mgr
.remote('telemetry', 'off')