@Endpoint()
def get_cluster_fsid(self):
return mgr.get('config')['fsid']
+
+ @Endpoint()
+ def get_telemetry_status(self):
+ return mgr.get_module_option_ex('telemetry', 'enabled', False)
ngOnInit() {
super.ngOnInit();
- this.isHardwareEnabled$ = this.getHardwareConfig();
- this.hardwareSummary$ = this.hardwareSubject.pipe(
- switchMap(() =>
- this.hardwareService.getSummary().pipe(
- switchMap((data: any) => {
- this.hasHardwareError = data.host.flawed;
- return of(data);
- })
+ if (this.permissions.configOpt.read) {
+ this.isHardwareEnabled$ = this.getHardwareConfig();
+ this.hardwareSummary$ = this.hardwareSubject.pipe(
+ switchMap(() =>
+ this.hardwareService.getSummary().pipe(
+ switchMap((data: any) => {
+ this.hasHardwareError = data.host.flawed;
+ return of(data);
+ })
+ )
)
- )
- );
+ );
+ this.managedByConfig$ = this.settingsService.getValues('MANAGED_BY_CLUSTERS');
+ }
this.interval = this.refreshIntervalService.intervalData$.subscribe(() => {
this.getHealth();
this.getCapacityCardData();
this.getPrometheusData(this.prometheusService.lastHourDateObject);
this.getDetailsCardData();
this.getTelemetryReport();
- this.managedByConfig$ = this.settingsService.getValues('MANAGED_BY_CLUSTERS');
this.prometheusAlertService.getAlerts(true);
}
}
private getTelemetryReport() {
- this.mgrModuleService.getConfig('telemetry').subscribe((resp: any) => {
- this.telemetryEnabled = resp?.enabled;
+ this.healthService.getTelemetryStatus().subscribe((enabled: boolean) => {
+ this.telemetryEnabled = enabled;
});
}
import { Subscription } from 'rxjs';
import { MultiClusterService } from '~/app/shared/api/multi-cluster.service';
+import { Permissions } from '~/app/shared/models/permissions';
+import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
import { FaviconService } from '~/app/shared/services/favicon.service';
import { SummaryService } from '~/app/shared/services/summary.service';
})
export class WorkbenchLayoutComponent implements OnInit, OnDestroy {
private subs = new Subscription();
+ permissions: Permissions;
constructor(
public router: Router,
private summaryService: SummaryService,
private taskManagerService: TaskManagerService,
private multiClusterService: MultiClusterService,
- private faviconService: FaviconService
- ) {}
+ private faviconService: FaviconService,
+ private authStorageService: AuthStorageService
+ ) {
+ this.permissions = this.authStorageService.getPermissions();
+ }
ngOnInit() {
- this.subs.add(this.multiClusterService.startPolling());
- this.subs.add(this.multiClusterService.startClusterTokenStatusPolling());
+ if (this.permissions.configOpt.read) {
+ this.subs.add(this.multiClusterService.startPolling());
+ this.subs.add(this.multiClusterService.startClusterTokenStatusPolling());
+ }
this.subs.add(this.summaryService.startPolling());
this.subs.add(this.taskManagerService.init(this.summaryService));
this.faviconService.init();
getOrchestratorName() {
return this.http.get('api/health/get_orchestrator_name');
}
+
+ getTelemetryStatus() {
+ return this.http.get('api/health/get_telemetry_status');
+ }
}
- jwt: []
tags:
- Health
+ /api/health/get_telemetry_status:
+ get:
+ parameters: []
+ responses:
+ '200':
+ content:
+ application/vnd.ceph.api.v1.0+json:
+ type: object
+ description: OK
+ '400':
+ description: Operation exception. Please check the response body for details.
+ '401':
+ description: Unauthenticated access. Please login first.
+ '403':
+ description: Unauthorized access. Please check your permissions.
+ '500':
+ description: Unexpected error. Please check the response body for the stack
+ trace.
+ security:
+ - jwt: []
+ tags:
+ - Health
/api/health/minimal:
get:
parameters: []