]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.ts
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / block / rbd-trash-restore-modal / rbd-trash-restore-modal.component.ts
index 42794419821324fd20af575cec626ceae4a2ba8d..4e687994e505c364192799d4503fc82478f6b9f7 100644 (file)
@@ -7,6 +7,7 @@ import { CdFormBuilder } from '../../../shared/forms/cd-form-builder';
 import { CdFormGroup } from '../../../shared/forms/cd-form-group';
 import { ExecutingTask } from '../../../shared/models/executing-task';
 import { FinishedTask } from '../../../shared/models/finished-task';
+import { ImageSpec } from '../../../shared/models/image-spec';
 import { TaskWrapperService } from '../../../shared/services/task-wrapper.service';
 
 @Component({
@@ -15,9 +16,10 @@ import { TaskWrapperService } from '../../../shared/services/task-wrapper.servic
   styleUrls: ['./rbd-trash-restore-modal.component.scss']
 })
 export class RbdTrashRestoreModalComponent implements OnInit {
-  metaType: string;
   poolName: string;
+  namespace: string;
   imageName: string;
+  imageSpec: string;
   imageId: string;
   executingTasks: ExecutingTask[];
 
@@ -31,6 +33,7 @@ export class RbdTrashRestoreModalComponent implements OnInit {
   ) {}
 
   ngOnInit() {
+    this.imageSpec = new ImageSpec(this.poolName, this.namespace, this.imageName).toString();
     this.restoreForm = this.fb.group({
       name: this.imageName
     });
@@ -38,15 +41,15 @@ export class RbdTrashRestoreModalComponent implements OnInit {
 
   restore() {
     const name = this.restoreForm.getValue('name');
+    const imageSpec = new ImageSpec(this.poolName, this.namespace, this.imageId);
 
     this.taskWrapper
       .wrapTaskAroundCall({
         task: new FinishedTask('rbd/trash/restore', {
-          pool_name: this.poolName,
-          image_id: this.imageId,
+          image_id_spec: imageSpec.toString(),
           new_image_name: name
         }),
-        call: this.rbdService.restoreTrash(this.poolName, this.imageId, name)
+        call: this.rbdService.restoreTrash(imageSpec, name)
       })
       .subscribe(
         undefined,