]>
Commit | Line | Data |
---|---|---|
a4b75251 TL |
1 | import { HttpClient } from '@angular/common/http'; |
2 | import { Injectable } from '@angular/core'; | |
3 | ||
4 | import { Observable } from 'rxjs'; | |
5 | ||
6 | @Injectable({ | |
7 | providedIn: 'root' | |
8 | }) | |
9 | export class ClusterService { | |
10 | baseURL = 'api/cluster'; | |
11 | ||
12 | constructor(private http: HttpClient) {} | |
13 | ||
14 | getStatus(): Observable<string> { | |
15 | return this.http.get<string>(`${this.baseURL}`, { | |
16 | headers: { Accept: 'application/vnd.ceph.api.v0.1+json' } | |
17 | }); | |
18 | } | |
19 | ||
20 | updateStatus(status: string) { | |
21 | return this.http.put( | |
22 | `${this.baseURL}`, | |
23 | { status: status }, | |
24 | { headers: { Accept: 'application/vnd.ceph.api.v0.1+json' } } | |
25 | ); | |
26 | } | |
27 | } |