]> git.proxmox.com Git - ceph.git/blame - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cluster.service.ts
import ceph quincy 17.2.4
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / cluster.service.ts
CommitLineData
a4b75251
TL
1import { HttpClient } from '@angular/common/http';
2import { Injectable } from '@angular/core';
3
4import { Observable } from 'rxjs';
5
6@Injectable({
7 providedIn: 'root'
8})
9export 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}