]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts
import ceph quincy 17.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / telemetry.service.ts
CommitLineData
e306af50
TL
1import { HttpClient } from '@angular/common/http';
2import { Injectable } from '@angular/core';
3
e306af50 4@Injectable({
f67539c2 5 providedIn: 'root'
e306af50
TL
6})
7export class TelemetryService {
8 private url = 'api/telemetry';
9
10 constructor(private http: HttpClient) {}
11
12 getReport() {
13 return this.http.get(`${this.url}/report`);
14 }
15
16 enable(enable: boolean = true) {
17 const body = { enable: enable };
18 if (enable) {
19 body['license_name'] = 'sharing-1-0';
20 }
21 return this.http.put(`${this.url}`, body);
22 }
23}