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