]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/api/host.service.ts
import ceph pacific 16.2.5
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / api / host.service.ts
index 74c0c30d449678c69fcfa01180350abefe5edfc2..7f8956baa263d1919219e475b87088d05b408384 100644 (file)
@@ -25,8 +25,12 @@ export class HostService {
     return this.http.get<object[]>(this.baseURL);
   }
 
-  create(hostname: string) {
-    return this.http.post(this.baseURL, { hostname: hostname }, { observe: 'response' });
+  create(hostname: string, addr: string, labels: string[], status: string) {
+    return this.http.post(
+      this.baseURL,
+      { hostname: hostname, addr: addr, labels: labels, status: status },
+      { observe: 'response', headers: { Accept: 'application/vnd.ceph.api.v0.1+json' } }
+    );
   }
 
   delete(hostname: string) {
@@ -58,12 +62,16 @@ export class HostService {
     maintenance = false,
     force = false
   ) {
-    return this.http.put(`${this.baseURL}/${hostname}`, {
-      update_labels: updateLabels,
-      labels: labels,
-      maintenance: maintenance,
-      force: force
-    });
+    return this.http.put(
+      `${this.baseURL}/${hostname}`,
+      {
+        update_labels: updateLabels,
+        labels: labels,
+        maintenance: maintenance,
+        force: force
+      },
+      { headers: { Accept: 'application/vnd.ceph.api.v0.1+json' } }
+    );
   }
 
   identifyDevice(hostname: string, device: string, duration: number) {