/// <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 }); }
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); }
/// <summary> /// The add backup client. /// </summary> /// <param name="serverId"> /// The server id. /// </param> /// <param name="clientType"> /// The client type. /// </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> AddBackupClient( string serverId, BackupClientType clientType, BackupStoragePolicy storagePolicy, BackupSchedulePolicy schedulePolicy, AlertingType alertingType) { Contract.Requires(!string.IsNullOrEmpty(serverId), "Server id cannot be null or empty"); Contract.Requires(clientType != null, "Client type cannot be null"); Contract.Requires(storagePolicy != null, "Storage policy cannot be null"); Contract.Requires(schedulePolicy != null, "Schedule policy cannot be null"); return await _apiClient.PostAsync<NewBackupClient, Status>( ApiUris.AddBackupClient(_apiClient.OrganizationId, serverId), new NewBackupClient { schedulePolicyName = schedulePolicy.name, storagePolicyName = storagePolicy.name, type = clientType.type, alerting = alertingType }); }
public static async Task<Status> AddBackupClient( this IComputeApiClient client, string serverId, BackupClientType clientType, BackupStoragePolicy storagePolicy, BackupSchedulePolicy schedulePolicy, AlertingType alertingType) { return await client.Backup.AddBackupClient(serverId, clientType, storagePolicy, schedulePolicy, alertingType); }