/// <summary>
 /// Adds a linked server to the Redis cache (requires Premium SKU).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='name'>
 /// The name of the Redis cache.
 /// </param>
 /// <param name='linkedServerName'>
 /// The name of the linked server that is being added to the Redis cache.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Linked server operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <RedisLinkedServerWithProperties> CreateAsync(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, name, linkedServerName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 protected override void Initialize()
 {
     Operations     = new Operations(this);
     Redis          = new RedisOperations(this);
     FirewallRules  = new FirewallRulesOperations(this);
     PatchSchedules = new PatchSchedulesOperations(this);
     LinkedServer   = new LinkedServerOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2018-03-01";
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     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()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
 /// <summary>
 /// Deletes the linked server from a redis cache (requires Premium SKU).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='name'>
 /// The name of the redis cache.
 /// </param>
 /// <param name='linkedServerName'>
 /// The name of the linked server that is being added to the Redis cache.
 /// </param>
 public static void Delete(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName)
 {
     operations.DeleteAsync(resourceGroupName, name, linkedServerName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Adds a linked server to the Redis cache (requires Premium SKU).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='name'>
 /// The name of the Redis cache.
 /// </param>
 /// <param name='linkedServerName'>
 /// The name of the linked server that is being added to the Redis cache.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Linked server operation.
 /// </param>
 public static RedisLinkedServerWithProperties Create(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, RedisLinkedServerCreateParameters parameters)
 {
     return(operations.CreateAsync(resourceGroupName, name, linkedServerName, parameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets the list of linked servers associated with this redis cache (requires
 /// Premium SKU).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <RedisLinkedServerWithProperties> > ListNextAsync(this ILinkedServerOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the list of linked servers associated with this redis cache (requires
 /// Premium SKU).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <RedisLinkedServerWithProperties> ListNext(this ILinkedServerOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets the list of linked servers associated with this redis cache (requires
 /// Premium SKU).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='name'>
 /// The name of the redis cache.
 /// </param>
 public static IPage <RedisLinkedServerWithProperties> List(this ILinkedServerOperations operations, string resourceGroupName, string name)
 {
     return(operations.ListAsync(resourceGroupName, name).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes the linked server from a redis cache (requires Premium SKU).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='name'>
 /// The name of the redis cache.
 /// </param>
 /// <param name='linkedServerName'>
 /// The name of the linked server that is being added to the Redis cache.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this ILinkedServerOperations operations, string resourceGroupName, string name, string linkedServerName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, name, linkedServerName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Gets the list of linked servers associated with this redis cache (requires
 /// Premium SKU).
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='name'>
 /// The name of the redis cache.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <RedisLinkedServerWithPropertiesInner> > ListAsync(this ILinkedServerOperations operations, string resourceGroupName, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, name, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }