]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/daemon.service.ts
import quincy beta 17.1.0
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / daemon.service.ts
1 import { HttpClient } from '@angular/common/http';
2 import { Injectable } from '@angular/core';
3
4 import { cdEncode } from '~/app/shared/decorators/cd-encode';
5
6 @cdEncode
7 @Injectable({
8 providedIn: 'root'
9 })
10 export class DaemonService {
11 private url = 'api/daemon';
12
13 constructor(private http: HttpClient) {}
14
15 action(daemonName: string, actionType: string) {
16 return this.http.put(
17 `${this.url}/${daemonName}`,
18 {
19 action: actionType,
20 container_image: null
21 },
22 {
23 headers: { Accept: 'application/vnd.ceph.api.v0.1+json' },
24 observe: 'response'
25 }
26 );
27 }
28 }