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');
+ });
});
'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))));
+ }
}