/// <summary> /// Initializes a new instance of the RestorePartitionDescription class. /// </summary> /// <param name="backupId">Unique backup ID.</param> /// <param name="backupLocation">Location of the backup relative to the backup storage specified/ configured.</param> /// <param name="backupStorage">Location of the backup from where the partition will be restored.</param> public RestorePartitionDescription( Guid?backupId, string backupLocation, BackupStorageDescription backupStorage = default(BackupStorageDescription)) { backupId.ThrowIfNull(nameof(backupId)); backupLocation.ThrowIfNull(nameof(backupLocation)); this.BackupId = backupId; this.BackupLocation = backupLocation; this.BackupStorage = backupStorage; }
/// <summary> /// Initializes a new instance of the GetBackupByStorageQueryDescription class. /// </summary> /// <param name="storage">Describes the parameters for the backup storage from where to enumerate backups. This is /// optional and by default backups are enumerated from the backup storage where this backup entity is currently being /// backed up (as specified in backup policy). This parameter is useful to be able to enumerate backups from another /// cluster where you may intend to restore.</param> /// <param name="backupEntity">Indicates the entity for which to enumerate backups.</param> /// <param name="startDateTimeFilter">Specifies the start date time in ISO8601 from which to enumerate backups. If not /// specified, backups are enumerated from the beginning.</param> /// <param name="endDateTimeFilter">Specifies the end date time in ISO8601 till which to enumerate backups. If not /// specified, backups are enumerated till the end.</param> /// <param name="latest">If specified as true, gets the most recent backup (within the specified time range) for every /// partition under the specified backup entity.</param> public GetBackupByStorageQueryDescription( BackupStorageDescription storage, BackupEntity backupEntity, DateTime?startDateTimeFilter = default(DateTime?), DateTime?endDateTimeFilter = default(DateTime?), bool?latest = false) { storage.ThrowIfNull(nameof(storage)); backupEntity.ThrowIfNull(nameof(backupEntity)); this.Storage = storage; this.BackupEntity = backupEntity; this.StartDateTimeFilter = startDateTimeFilter; this.EndDateTimeFilter = endDateTimeFilter; this.Latest = latest; }
/// <summary> /// Initializes a new instance of the BackupPolicyDescription class. /// </summary> /// <param name="name">The unique name identifying this backup policy.</param> /// <param name="autoRestoreOnDataLoss">Specifies whether to trigger restore automatically using the latest available /// backup in case the partition experiences a data loss event.</param> /// <param name="maxIncrementalBackups">Defines the maximum number of incremental backups to be taken between two full /// backups. This is just the upper limit. A full backup may be taken before specified number of incremental backups /// are completed in one of the following conditions /// - The replica has never taken a full backup since it has become primary, /// - Some of the log records since the last backup has been truncated, or /// - Replica passed the MaxAccumulatedBackupLogSizeInMB limit. /// </param> /// <param name="schedule">Describes the backup schedule parameters.</param> /// <param name="storage">Describes the details of backup storage where to store the periodic backups.</param> public BackupPolicyDescription( string name, bool?autoRestoreOnDataLoss, int?maxIncrementalBackups, BackupScheduleDescription schedule, BackupStorageDescription storage) { name.ThrowIfNull(nameof(name)); autoRestoreOnDataLoss.ThrowIfNull(nameof(autoRestoreOnDataLoss)); maxIncrementalBackups.ThrowIfNull(nameof(maxIncrementalBackups)); schedule.ThrowIfNull(nameof(schedule)); storage.ThrowIfNull(nameof(storage)); maxIncrementalBackups?.ThrowIfOutOfInclusiveRange("maxIncrementalBackups", 0, 255); this.Name = name; this.AutoRestoreOnDataLoss = autoRestoreOnDataLoss; this.MaxIncrementalBackups = maxIncrementalBackups; this.Schedule = schedule; this.Storage = storage; }
/// <summary> /// Initializes a new instance of the BackupPartitionDescription class. /// </summary> /// <param name="backupStorage">Specifies the details of the backup storage where to save the backup.</param> public BackupPartitionDescription( BackupStorageDescription backupStorage = default(BackupStorageDescription)) { this.BackupStorage = backupStorage; }