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({
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[];
) {}
ngOnInit() {
+ this.imageSpec = new ImageSpec(this.poolName, this.namespace, this.imageName).toString();
this.restoreForm = this.fb.group({
name: this.imageName
});
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,