From: Lenz Grimmer Date: Wed, 6 Nov 2019 12:32:35 +0000 (+0000) Subject: mgr/dashboard: Add support for device management (#30759) X-Git-Tag: v15.1.0~1023 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b977d7584bc6542e36e72005723f262a8c92f4e;p=ceph.git mgr/dashboard: Add support for device management (#30759) mgr/dashboard: Add support for device management Reviewed-by: Kiefer Chang Reviewed-by: Ricardo Dias Reviewed-by: Tiago Melo Reviewed-by: Volker Theile --- 4b977d7584bc6542e36e72005723f262a8c92f4e diff --cc src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.spec.ts index f30e099c52b3,3f74eb959594..957c646dd3df --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.spec.ts @@@ -108,7 -108,13 +108,13 @@@ describe('OsdService', () => it('should return if it is safe to destroy an OSD', () => { service.safeToDestroy('[0,1]').subscribe(); - const req = httpTesting.expectOne('api/osd/[0,1]/safe_to_destroy'); + const req = httpTesting.expectOne('api/osd/safe_to_destroy?ids=[0,1]'); expect(req.request.method).toBe('GET'); }); + + it('should call the devices endpoint to retrieve smart data', () => { + service.getDevices(1).subscribe(); + const req = httpTesting.expectOne('api/osd/1/devices'); + expect(req.request.method).toBe('GET'); + }); }); diff --cc src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts index f99132a7672e,d1da3b7edf74..824bc1c66fdb --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts @@@ -248,6 -251,12 +251,12 @@@ export class OsdService 'safe-to-destroy': boolean; message?: string; } - return this.http.get(`${this.path}/${ids}/safe_to_destroy`); + return this.http.get(`${this.path}/safe_to_destroy?ids=${ids}`); } + + getDevices(osdId: number) { + return this.http + .get(`${this.path}/${osdId}/devices`) + .pipe(map((devices) => devices.map((device) => this.deviceService.prepareDevice(device)))); + } }