]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Add support for device management (#30759)
authorLenz Grimmer <lgrimmer@suse.com>
Wed, 6 Nov 2019 12:32:35 +0000 (12:32 +0000)
committerGitHub <noreply@github.com>
Wed, 6 Nov 2019 12:32:35 +0000 (12:32 +0000)
mgr/dashboard: Add support for device management

Reviewed-by: Kiefer Chang <kiefer.chang@suse.com>
Reviewed-by: Ricardo Dias <rdias@suse.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
Reviewed-by: Volker Theile <vtheile@suse.com>
1  2 
qa/tasks/mgr/dashboard/test_osd.py
src/pybind/mgr/dashboard/controllers/osd.py
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts

Simple merge
index f30e099c52b3388ee95642957db71fd66fb9c178,3f74eb9595949ee1e237874e39d6f9d4ab262205..957c646dd3dfccbc60b7d9be96cf1f7e1efd78fc
@@@ -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');
+   });
  });
index f99132a7672e5a9c889db5810af0a2cb37b3ac70,d1da3b7edf748d5548593e5d026ec4087c508607..824bc1c66fdb509081c8be644f9d1149d3c389fa
@@@ -248,6 -251,12 +251,12 @@@ export class OsdService 
        'safe-to-destroy': boolean;
        message?: string;
      }
 -    return this.http.get<SafeToDestroyResponse>(`${this.path}/${ids}/safe_to_destroy`);
 +    return this.http.get<SafeToDestroyResponse>(`${this.path}/safe_to_destroy?ids=${ids}`);
    }
+   getDevices(osdId: number) {
+     return this.http
+       .get<CdDevice[]>(`${this.path}/${osdId}/devices`)
+       .pipe(map((devices) => devices.map((device) => this.deviceService.prepareDevice(device))));
+   }
  }