public static async Task <Status> InitiateBackup(
     this IComputeApiClient client,
     string serverId,
     BackupClientDetailsType backupClient)
 {
     return(await client.Backup.InitiateBackup(serverId, backupClient));
 }
 public static async Task <Status> CancelBackupJob(
     this IComputeApiClient client,
     string serverId,
     BackupClientDetailsType backupClient)
 {
     return(await client.Backup.CancelBackupJob(serverId, backupClient));
 }
        /// <summary>
        /// Modifies the backup client on the specified server.
        /// </summary>
        /// <param name="client">The <see cref="ComputeApiClient"/> object</param>
        /// <param name="serverId">The server id</param>
        /// <param name="backupClient">The backup client to modify</param>
        /// <param name="storagePolicy">The storage policy to modify</param>
        /// <param name="schedulePolicy">The schedule policy to modify</param>
        /// <param name="alertingType">The alerting type to modify</param>
        /// <returns>The status of the request</returns>
        public static async Task <Status> ModifyBackupClientAsync(
            this IComputeApiClient client,
            string serverId,
            BackupClientDetailsType backupClient,
            BackupStoragePolicy storagePolicy,
            BackupSchedulePolicy schedulePolicy,
            AlertingType alertingType)
        {
            if (backupClient == null)
            {
                throw new ArgumentNullException("backupClient", "argument cannot be null!");
            }
            if (storagePolicy == null)
            {
                throw new ArgumentNullException("storagePolicy", "argument cannot be null!");
            }
            if (schedulePolicy == null)
            {
                throw new ArgumentNullException("schedulePolicy", "argument cannot be null!");
            }

            return
                (await
                 client.WebApi.ApiPostAsync <ModifyBackupClient, Status>(
                     ApiUris.ModifyBackupClient(client.Account.OrganizationId, serverId, backupClient.id),
                     new ModifyBackupClient
            {
                schedulePolicyName = schedulePolicy.name,
                storagePolicyName = storagePolicy.name,
                alerting = alertingType
            }));
        }
Пример #4
0
        /// <summary>
        /// The cancel backup job.
        /// </summary>
        /// <param name="serverId">
        /// The server id.
        /// </param>
        /// <param name="backupClient">
        /// The backup client.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <Status> CancelBackupJob(string serverId, BackupClientDetailsType backupClient)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(serverId), "Server cannot be null or empty");
            Contract.Requires(backupClient != null, "Backup client cannot be null");

            return
                (await _apiClient.GetAsync <Status>(ApiUris.CancelBackupJobs(_apiClient.OrganizationId, serverId, backupClient.id)));
        }
 public static async Task <Status> ModifyBackupClient(
     this IComputeApiClient client,
     string serverId,
     BackupClientDetailsType backupClient,
     BackupStoragePolicy storagePolicy,
     BackupSchedulePolicy schedulePolicy,
     AlertingType alertingType)
 {
     return(await client.Backup.ModifyBackupClient(serverId, backupClient, storagePolicy, schedulePolicy, alertingType));
 }
Пример #6
0
 /// <summary>
 /// The modify backup client.
 /// </summary>
 /// <param name="serverId">
 /// The server id.
 /// </param>
 /// <param name="backupClient">
 /// The backup client.
 /// </param>
 /// <param name="storagePolicy">
 /// The storage policy.
 /// </param>
 /// <param name="schedulePolicy">
 /// The schedule policy.
 /// </param>
 /// <param name="alertingType">
 /// The alerting type.
 /// </param>
 /// <returns>
 /// The <see cref="Task"/>.
 /// </returns>
 public async Task <Status> ModifyBackupClient(
     string serverId,
     BackupClientDetailsType backupClient,
     BackupStoragePolicy storagePolicy,
     BackupSchedulePolicy schedulePolicy,
     AlertingType alertingType)
 {
     return
         (await
          _apiClient.PostAsync <ModifyBackupClient, Status>(
              ApiUris.ModifyBackupClient(_apiClient.OrganizationId, serverId, backupClient.id),
              new ModifyBackupClient
     {
         schedulePolicyName = schedulePolicy.name,
         storagePolicyName = storagePolicy.name,
         alerting = alertingType
     }));
 }
        /// <summary>
        /// Requests a cancellation for any running job for a backup client
        /// </summary>
        /// <param name="client">The <see cref="ComputeApiClient"/> object</param>
        /// <param name="serverId">The server id</param>
        /// <param name="backupClient">The backup client to modify</param>
        /// <returns>The status of the request</returns>
        public static async Task <Status> CancelBackupJobAsync(
            this IComputeApiClient client,
            string serverId,
            BackupClientDetailsType backupClient)
        {
            if (string.IsNullOrWhiteSpace(serverId))
            {
                throw new ArgumentException("argument cannot be null, empty or composed of whitespaces only!", "serverId");
            }
            if (backupClient == null)
            {
                throw new ArgumentNullException("backupClient", "argument cannot be null!");
            }

            return
                (await
                 client.WebApi.ApiGetAsync <Status>(
                     ApiUris.CancelBackupJobs(client.Account.OrganizationId, serverId, backupClient.id)));
        }
Пример #8
0
        /// <summary>
        /// The modify backup client.
        /// </summary>
        /// <param name="serverId">
        /// The server id.
        /// </param>
        /// <param name="backupClient">
        /// The backup client.
        /// </param>
        /// <param name="storagePolicy">
        /// The storage policy.
        /// </param>
        /// <param name="schedulePolicy">
        /// The schedule policy.
        /// </param>
        /// <param name="alertingType">
        /// The alerting type.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <Status> ModifyBackupClient(
            string serverId,
            BackupClientDetailsType backupClient,
            BackupStoragePolicy storagePolicy,
            BackupSchedulePolicy schedulePolicy,
            AlertingType alertingType)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(serverId), "Server cannot be null or empty");
            Contract.Requires(backupClient != null, "Backup client cannot be null");

            return
                (await
                 _apiClient.PostAsync <ModifyBackupClient, Status>(
                     ApiUris.ModifyBackupClient(_apiClient.OrganizationId, serverId, backupClient.id),
                     new ModifyBackupClient
            {
                schedulePolicyName = schedulePolicy.name,
                storagePolicyName = storagePolicy.name,
                alerting = alertingType
            }));
        }
Пример #9
0
 /// <summary>	Out of place restore. </summary>
 /// <param name="serverId">	    The server id. </param>
 /// <param name="backupClient">	The backup client. </param>
 /// <param name="asAtDate">	    The date and time to recover to. </param>
 /// <param name="targetServer">	Target server. </param>
 /// <returns>	A Status message from the API; </returns>
 /// <seealso cref="M:DD.CBU.Compute.Api.Client.Interfaces.Backup.IBackupAccessor.OutOfPlaceRestore(string,BackupClientDetailsType,DateTime,ServerType)"/>
 public async Task <Status> OutOfPlaceRestore(string serverId, BackupClientDetailsType backupClient, DateTime asAtDate, ServerType targetServer)
 {
     return(await this.OutOfPlaceRestore(serverId, backupClient.id, asAtDate, targetServer.id));
 }
Пример #10
0
 /// <summary>	In place restore. </summary>
 /// <param name="serverId">	    The server id. </param>
 /// <param name="backupClient">	The backup client. </param>
 /// <param name="asAtDate">	    The date and time to recover to. </param>
 /// <returns>	A Status message from the API. </returns>
 /// <seealso cref="M:DD.CBU.Compute.Api.Client.Interfaces.Backup.IBackupAccessor.InPlaceRestore(BackupClientDetailsType,DateTime)"/>
 public async Task <Status> InPlaceRestore(string serverId, BackupClientDetailsType backupClient, DateTime asAtDate)
 {
     return(await InPlaceRestore(serverId, backupClient.id, asAtDate));
 }
Пример #11
0
 /// <summary>
 /// The cancel backup job.
 /// </summary>
 /// <param name="serverId">
 /// The server id.
 /// </param>
 /// <param name="backupClient">
 /// The backup client.
 /// </param>
 /// <returns>
 /// The <see cref="Task"/>.
 /// </returns>
 public async Task <Status> CancelBackupJob(string serverId, BackupClientDetailsType backupClient)
 {
     return(await CancelBackupJob(serverId, backupClient.id));
 }
Пример #12
0
 /// <summary>
 /// The initiate backup.
 /// </summary>
 /// <param name="serverId">
 /// The server id.
 /// </param>
 /// <param name="backupClient">
 /// The backup client.
 /// </param>
 /// <returns>
 /// The <see cref="Task"/>.
 /// </returns>
 public async Task <Status> InitiateBackup(string serverId, BackupClientDetailsType backupClient)
 {
     return(await InitiateBackup(serverId, backupClient.id));
 }
Пример #13
0
 /// <summary>
 /// The remove backup client.
 /// </summary>
 /// <param name="serverId">
 /// The server id.
 /// </param>
 /// <param name="backupClient">
 /// The backup client.
 /// </param>
 /// <returns>
 /// The <see cref="Task"/>.
 /// </returns>
 public async Task <Status> RemoveBackupClient(string serverId, BackupClientDetailsType backupClient)
 {
     return
         (await _apiClient.GetAsync <Status>(ApiUris.RemoveBackupClient(_apiClient.OrganizationId, serverId, backupClient.id)));
 }