]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/iscsi.service.ts
import ceph quincy 17.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / iscsi.service.ts
1 import { HttpClient } from '@angular/common/http';
2 import { Injectable } from '@angular/core';
3
4 import { cdEncode } from '../decorators/cd-encode';
5
6 @cdEncode
7 @Injectable({
8 providedIn: 'root'
9 })
10 export class IscsiService {
11 constructor(private http: HttpClient) {}
12
13 listTargets() {
14 return this.http.get(`api/iscsi/target`);
15 }
16
17 getTarget(target_iqn: string) {
18 return this.http.get(`api/iscsi/target/${target_iqn}`);
19 }
20
21 updateTarget(target_iqn: string, target: any) {
22 return this.http.put(`api/iscsi/target/${target_iqn}`, target, { observe: 'response' });
23 }
24
25 status() {
26 return this.http.get(`ui-api/iscsi/status`);
27 }
28
29 settings() {
30 return this.http.get(`ui-api/iscsi/settings`);
31 }
32
33 version() {
34 return this.http.get(`ui-api/iscsi/version`);
35 }
36
37 portals() {
38 return this.http.get(`ui-api/iscsi/portals`);
39 }
40
41 createTarget(target: any) {
42 return this.http.post(`api/iscsi/target`, target, { observe: 'response' });
43 }
44
45 deleteTarget(target_iqn: string) {
46 return this.http.delete(`api/iscsi/target/${target_iqn}`, { observe: 'response' });
47 }
48
49 getDiscovery() {
50 return this.http.get(`api/iscsi/discoveryauth`);
51 }
52
53 updateDiscovery(auth: any) {
54 return this.http.put(`api/iscsi/discoveryauth`, auth);
55 }
56
57 overview() {
58 return this.http.get(`ui-api/iscsi/overview`);
59 }
60 }