/// <summary> /// Manual Failover Fail over /// </summary> /// <remarks> /// Perform manual fail over of given hub /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='iotHubName'> /// IotHub to fail over /// </param> /// <param name='failoverInput'> /// Region to failover to. Must be a azure DR pair /// </param> /// <param name='resourceGroupName'> /// resource group which Iot Hub belongs to /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IotHubDescription> ManualFailoverAsync(this IIotHubOperations operations, string iotHubName, FailoverInput failoverInput, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ManualFailoverWithHttpMessagesAsync(iotHubName, failoverInput, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Operations = new Operations(this); IotHubResource = new IotHubResourceOperations(this); ResourceProviderCommon = new ResourceProviderCommonOperations(this); Certificates = new CertificatesOperations(this); IotHub = new IotHubOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2019-07-01-preview"; 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() } }; 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 CloudErrorJsonConverter()); }
/// <summary> /// Manual Failover Fail over /// </summary> /// <remarks> /// Perform manual fail over of given hub /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='iotHubName'> /// IotHub to fail over /// </param> /// <param name='failoverInput'> /// Region to failover to. Must be a azure DR pair /// </param> /// <param name='resourceGroupName'> /// resource group which Iot Hub belongs to /// </param> public static IotHubDescription ManualFailover(this IIotHubOperations operations, string iotHubName, FailoverInput failoverInput, string resourceGroupName) { return(operations.ManualFailoverAsync(iotHubName, failoverInput, resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// Manual Failover Fail over /// </summary> /// <remarks> /// Perform manual fail over of given hub /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='iotHubName'> /// IotHub to fail over /// </param> /// <param name='failoverInput'> /// Region to failover to. Must be a azure DR pair /// </param> /// <param name='resourceGroupName'> /// resource group which Iot Hub belongs to /// </param> public static void BeginManualFailover(this IIotHubOperations operations, string iotHubName, FailoverInput failoverInput, string resourceGroupName) { operations.BeginManualFailoverAsync(iotHubName, failoverInput, resourceGroupName).GetAwaiter().GetResult(); }
/// <summary> /// Manual Failover Fail over /// </summary> /// <remarks> /// Perform manual fail over of given hub /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='iotHubName'> /// IotHub to fail over /// </param> /// <param name='failoverInput'> /// Region to failover to. Must be a azure DR pair /// </param> /// <param name='resourceGroupName'> /// resource group which Iot Hub belongs to /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ManualFailoverAsync(this IIotHubOperations operations, string iotHubName, FailoverInput failoverInput, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.ManualFailoverWithHttpMessagesAsync(iotHubName, failoverInput, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Manually initiate a failover for the IoT Hub to its secondary region /// </summary> /// <remarks> /// Manually initiate a failover for the IoT Hub to its secondary region. To /// learn more, see https://aka.ms/manualfailover /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='iotHubName'> /// Name of the IoT hub to failover /// </param> /// <param name='resourceGroupName'> /// Name of the resource group containing the IoT hub resource /// </param> /// <param name='failoverRegion'> /// Region the hub will be failed over to /// </param> public static void ManualFailover(this IIotHubOperations operations, string iotHubName, string resourceGroupName, string failoverRegion) { operations.ManualFailoverAsync(iotHubName, resourceGroupName, failoverRegion).GetAwaiter().GetResult(); }