Sharad Mishra has uploaded a new change for review. Change subject: core: WIP: Add support for backup/restore API for ISVs ......................................................................
core: WIP: Add support for backup/restore API for ISVs This is a work in progress. Its not a complete patch. Please review and let me know if its going in the right direction. Change-Id: I8f48e96856acc47bc748aed777f11c6ebee3f140 Signed-off-by: Sharad Mishra <snmis...@linux.vnet.ibm.com> --- A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Backup.java A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/vdscommands/archive/PrepareDiskForBackupVDSCommandParameters.java A backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/PrepareDiskForBackupVDSCommand.java 3 files changed, 143 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/79/13279/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Backup.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Backup.java new file mode 100644 index 0000000..9d07db1 --- /dev/null +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Backup.java @@ -0,0 +1,100 @@ +package org.ovirt.engine.core.common.businessentities; + +import java.util.Date; + +import org.ovirt.engine.core.compat.Guid; + +public class Backup extends IVdcQueryable implements BusinessEntity<Guid> { + + /** + * Needed for java serialization/deserialization mechanism. + */ + private static final long serialVersionUID = -9170488484982522244L; + + /** + * The backup ID uniquely identifies the backup on the system. + */ + private Guid id; + + /** + * The status of the backup (ok, snapshot_complete, etc). + */ + private BackupStatus status; + + /** + * A short description which the user gave for the backup. + */ + private String description; + + /** + * When was the backup was taken. + */ + private Date creationDate; + + /** + * The snapshot captured by the backup. + */ + private Snapshot snapshot; + + public Backup(Guid id, + BackupStatus status, + String description, + Date creationDate, + Snapshot snapshot) { + this.id = id; + this.status = status; + this.description = description; + this.creationDate = creationDate; + this.snapshot = snapshot; + } + + @Override + public Guid getId() { + return id; + } + + @Override + public void setId(Guid id) { + this.id = id; + } + + public BackupStatus getStatus() { + return status; + } + + public void setStatus(BackupStatus status) { + this.status = status; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreationDate() { + return creationDate; + } + + public void setCreationDate(Date creationDate) { + this.creationDate = creationDate; + } + + public Snapshot getSnapshot() { + return snapshot; + } + + public void setSnapshot(Snapshot snapshot) { + this.snapshot = snapshot; + } + + public enum BackupStatus { + OK, + SNAPSHOT_COMPLETE, + MOUNT_COMPLETE, + BROKEN + } + +} diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/vdscommands/archive/PrepareDiskForBackupVDSCommandParameters.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/vdscommands/archive/PrepareDiskForBackupVDSCommandParameters.java new file mode 100644 index 0000000..9264a8f --- /dev/null +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/vdscommands/archive/PrepareDiskForBackupVDSCommandParameters.java @@ -0,0 +1,26 @@ +package org.ovirt.engine.core.common.vdscommands.archive; + +import org.ovirt.engine.core.compat.Guid; + +import org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase; + +public class PrepareDiskForBackupVDSCommandParameters extends VdsAndVmIDVDSParametersBase { + private String _diskPath; + + public PrepareDiskForBackupVDSCommandParameters(Guid vdsId, Guid vmId, String diskPath) { + super(vdsId, vmId); + _diskPath = diskPath; + } + + public String getDiskPath() { + return _diskPath; + } + + public PrepareDiskForBackupVDSCommandParameters() { + } + + @Override + public String toString() { + return String.format("%s, diskPath=%s", super.toString(), getDiskPath()); + } +} diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/PrepareDiskForBackupVDSCommand.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/PrepareDiskForBackupVDSCommand.java new file mode 100644 index 0000000..fc17693 --- /dev/null +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/PrepareDiskForBackupVDSCommand.java @@ -0,0 +1,17 @@ +package org.ovirt.engine.core.vdsbroker.vdsbroker; + +import org.ovirt.engine.core.common.vdscommands.archive.PrepareDiskForBackupVDSCommandParameters; + +public class PrepareDiskForBackupVDSCommand<P extends PrepareDiskForBackupVDSCommandParameters> extends VdsBrokerCommand<P> { + + public PrepareDiskForBackupVDSCommand(P parameters) { + super(parameters); + } + + @Override + protected void ExecuteVdsBrokerCommand() { + // TODO Auto-generated method stub + + } + +} -- To view, visit http://gerrit.ovirt.org/13279 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f48e96856acc47bc748aed777f11c6ebee3f140 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Sharad Mishra <snmis...@linux.vnet.ibm.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches