summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/shared/api/daemon.service.ts
blob: a66ed7edb1983d1a144eeab89d6dd4aea4825f8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

import { cdEncode } from '~/app/shared/decorators/cd-encode';

@cdEncode
@Injectable({
  providedIn: 'root'
})
export class DaemonService {
  private url = 'api/daemon';

  constructor(private http: HttpClient) {}

  action(daemonName: string, actionType: string) {
    return this.http.put(
      `${this.url}/${daemonName}`,
      {
        action: actionType,
        container_image: null
      },
      {
        headers: { Accept: 'application/vnd.ceph.api.v0.1+json' },
        observe: 'response'
      }
    );
  }
}