ALL_CHANNELS = ['basic', 'ident']
+LICENSE='sharing-1-0'
+LICENSE_NAME='Community Data License Agreement - Sharing - Version 1.0'
+LICENSE_URL='https://cdla.io/sharing-1-0/'
+
+
class Module(MgrModule):
config = dict()
"perm": "r"
},
{
- "cmd": "telemetry on",
+ "cmd": "telemetry on name=license,type=CephString,req=false",
"desc": "Enable telemetry reports from this cluster",
"perm": "rw",
},
'report_id': self.report_id,
'channels': channels,
'channels_available': ALL_CHANNELS,
+ 'license': LICENSE,
}
if 'ident' in channels:
self.set_config(key, value)
return 0, 'Configuration option {0} updated'.format(key), ''
elif command['prefix'] == 'telemetry on':
+ if command.get('license') != LICENSE:
+ return -errno.EPERM, '', "Telemetry data is licensed under the " + LICENSE_NAME + " (" + LICENSE_URL + ").\nTo enable, add '--license " + LICENSE + "' to the 'ceph telemetry on' command."
self.set_config('enabled', True)
return 0, '', ''
elif command['prefix'] == 'telemetry off':