diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts new file mode 100644 index 000000000..8a175f66d --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/telemetry.service.ts @@ -0,0 +1,23 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class TelemetryService { + private url = 'api/telemetry'; + + constructor(private http: HttpClient) {} + + getReport() { + return this.http.get(`${this.url}/report`); + } + + enable(enable: boolean = true) { + const body = { enable: enable }; + if (enable) { + body['license_name'] = 'sharing-1-0'; + } + return this.http.put(`${this.url}`, body); + } +} |