/// <summary> /// Create or update a Storage Target. This operation is allowed at any time, /// but if the Cache is down or unhealthy, the actual creation/modification of /// the Storage Target may be delayed until the Cache is healthy again. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Target resource group. /// </param> /// <param name='cacheName'> /// Name of Cache. Length of name must be not greater than 80 and chars must be /// in list of [-0-9a-zA-Z_] char class. /// </param> /// <param name='storageTargetName'> /// Name of the Storage Target. Length of name must be not greater than 80 and /// chars must be in list of [-0-9a-zA-Z_] char class. /// </param> /// <param name='storagetarget'> /// Object containing the definition of a Storage Target. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <StorageTarget> CreateOrUpdateAsync(this IStorageTargets operations, string resourceGroupName, string cacheName, string storageTargetName, StorageTarget storagetarget = default(StorageTarget), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, cacheName, storageTargetName, storagetarget, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Returns a list of Storage Targets for the specified Cache. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Target resource group. /// </param> /// <param name='cacheName'> /// Name of Cache. Length of name must be not greater than 80 and chars must be /// in list of [-0-9a-zA-Z_] char class. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <StorageTargetsResult> ListByCacheAsync(this IStorageTargets operations, string resourceGroupName, string cacheName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByCacheWithHttpMessagesAsync(resourceGroupName, cacheName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Operations = new Operations(this); Skus = new Skus(this); UsageModels = new UsageModels(this); Caches = new Caches(this); StorageTargets = new StorageTargets(this); BaseUri = new System.Uri("https://management.azure.com"); SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <StorageTargetProperties>("targetBaseType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <StorageTargetProperties>("targetBaseType")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); }
/// <summary> /// Removes a Storage Target from a Cache. This operation is allowed at any /// time, but if the Cache is down or unhealthy, the actual removal of the /// Storage Target may be delayed until the Cache is healthy again. Note that /// if the Cache has data to flush to the Storage Target, the data will be /// flushed before the Storage Target will be deleted. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Target resource group. /// </param> /// <param name='cacheName'> /// Name of Cache. Length of name must be not greater than 80 and chars must be /// in list of [-0-9a-zA-Z_] char class. /// </param> /// <param name='storageTargetName'> /// Name of Storage Target. /// </param> public static object Delete(this IStorageTargets operations, string resourceGroupName, string cacheName, string storageTargetName) { return(operations.DeleteAsync(resourceGroupName, cacheName, storageTargetName).GetAwaiter().GetResult()); }
/// <summary> /// Returns a list of Storage Targets for the specified Cache. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Target resource group. /// </param> /// <param name='cacheName'> /// Name of Cache. Length of name must be not greater than 80 and chars must be /// in list of [-0-9a-zA-Z_] char class. /// </param> public static StorageTargetsResult ListByCache(this IStorageTargets operations, string resourceGroupName, string cacheName) { return(operations.ListByCacheAsync(resourceGroupName, cacheName).GetAwaiter().GetResult()); }
/// <summary> /// Create or update a Storage Target. This operation is allowed at any time, /// but if the Cache is down or unhealthy, the actual creation/modification of /// the Storage Target may be delayed until the Cache is healthy again. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Target resource group. /// </param> /// <param name='cacheName'> /// Name of Cache. Length of name must be not greater than 80 and chars must be /// in list of [-0-9a-zA-Z_] char class. /// </param> /// <param name='storageTargetName'> /// Name of the Storage Target. Length of name must be not greater than 80 and /// chars must be in list of [-0-9a-zA-Z_] char class. /// </param> /// <param name='storagetarget'> /// Object containing the definition of a Storage Target. /// </param> public static StorageTarget CreateOrUpdate(this IStorageTargets operations, string resourceGroupName, string cacheName, string storageTargetName, StorageTarget storagetarget = default(StorageTarget)) { return(operations.CreateOrUpdateAsync(resourceGroupName, cacheName, storageTargetName, storagetarget).GetAwaiter().GetResult()); }
/// <summary> /// Tells a storage target to refresh its DNS information. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Target resource group. /// </param> /// <param name='cacheName'> /// Name of Cache. Length of name must not be greater than 80 and chars must be /// from the [-0-9a-zA-Z_] char class. /// </param> /// <param name='storageTargetName'> /// Name of Storage Target. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DnsRefreshAsync(this IStorageTargets operations, string resourceGroupName, string cacheName, string storageTargetName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DnsRefreshWithHttpMessagesAsync(resourceGroupName, cacheName, storageTargetName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Tells a storage target to refresh its DNS information. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Target resource group. /// </param> /// <param name='cacheName'> /// Name of Cache. Length of name must not be greater than 80 and chars must be /// from the [-0-9a-zA-Z_] char class. /// </param> /// <param name='storageTargetName'> /// Name of Storage Target. /// </param> public static void DnsRefresh(this IStorageTargets operations, string resourceGroupName, string cacheName, string storageTargetName) { operations.DnsRefreshAsync(resourceGroupName, cacheName, storageTargetName).GetAwaiter().GetResult(); }