1 import { HttpClient } from '@angular/common/http';
2 import { Injectable } from '@angular/core';
4 import { cdEncode } from '../decorators/cd-encode';
10 export class IscsiService {
11 constructor(private http: HttpClient) {}
14 return this.http.get(`api/iscsi/target`);
17 getTarget(target_iqn: string) {
18 return this.http.get(`api/iscsi/target/${target_iqn}`);
21 updateTarget(target_iqn: string, target: any) {
22 return this.http.put(`api/iscsi/target/${target_iqn}`, target, { observe: 'response' });
26 return this.http.get(`ui-api/iscsi/status`);
30 return this.http.get(`ui-api/iscsi/settings`);
34 return this.http.get(`ui-api/iscsi/version`);
38 return this.http.get(`ui-api/iscsi/portals`);
41 createTarget(target: any) {
42 return this.http.post(`api/iscsi/target`, target, { observe: 'response' });
45 deleteTarget(target_iqn: string) {
46 return this.http.delete(`api/iscsi/target/${target_iqn}`, { observe: 'response' });
50 return this.http.get(`api/iscsi/discoveryauth`);
53 updateDiscovery(auth: any) {
54 return this.http.put(`api/iscsi/discoveryauth`, auth);
58 return this.http.get(`ui-api/iscsi/overview`);