예제 #1
0
 /// <summary>
 /// Get a list of all the jobs in an IoT hub. For more information, see:
 /// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
 /// </summary>
 /// <remarks>
 /// Get a list of all the jobs in an IoT hub. For more information, see:
 /// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
 /// </remarks>
 /// <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 <JobResponseInner> > ListJobsNextAsync(this IIotHubResourceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListJobsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.IotHubResource = new IotHubResourceOperations(this);
     this.BaseUri        = new Uri("https://management.azure.com");
     this.ApiVersion     = "2016-02-03";
     this.AcceptLanguage = "en-US";
     this.LongRunningOperationRetryTimeout = 30;
     this.GenerateClientRequestId          = true;
     SerializationSettings = new JsonSerializerSettings
     {
         Formatting            = Formatting.Indented,
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
예제 #3
0
 /// <summary>
 /// Create or update the metadata of an IoT hub.
 /// </summary>
 /// <remarks>
 /// Create or update the metadata of an Iot hub. The usual pattern to modify a
 /// property is to retrieve the IoT hub metadata and security metadata, and
 /// then combine them with the modified values in a new body to update the IoT
 /// hub.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the IoT hub.
 /// </param>
 /// <param name='resourceName'>
 /// The name of the IoT hub to create or update.
 /// </param>
 /// <param name='iotHubDescription'>
 /// The IoT hub metadata and security metadata.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IotHubDescriptionInner> CreateOrUpdateAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, IotHubDescriptionInner iotHubDescription, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, iotHubDescription, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #4
0
 /// <summary>
 /// Import, update, or delete device identities in the IoT hub identity
 /// registry from a blob. For more information, see:
 /// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
 /// </summary>
 /// <remarks>
 /// Import, update, or delete device identities in the IoT hub identity
 /// registry from a blob. For more information, see:
 /// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the IoT hub.
 /// </param>
 /// <param name='resourceName'>
 /// The name of the IoT hub.
 /// </param>
 /// <param name='importDevicesParameters'>
 /// The parameters that specify the import devices operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <JobResponseInner> ImportDevicesAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, ImportDevicesRequestInner importDevicesParameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ImportDevicesWithHttpMessagesAsync(resourceGroupName, resourceName, importDevicesParameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #5
0
 /// <summary>
 /// Delete an IoT hub.
 /// </summary>
 /// <remarks>
 /// Delete an IoT hub.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the IoT hub.
 /// </param>
 /// <param name='resourceName'>
 /// The name of the IoT hub to delete.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> BeginDeleteAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #6
0
 /// <summary>
 /// Get the details of a job from an IoT hub. For more information, see:
 /// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
 /// </summary>
 /// <remarks>
 /// Get the details of a job from an IoT hub. For more information, see:
 /// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the IoT hub.
 /// </param>
 /// <param name='resourceName'>
 /// The name of the IoT hub.
 /// </param>
 /// <param name='jobId'>
 /// The job identifier.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <JobResponseInner> GetJobAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, string jobId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetJobWithHttpMessagesAsync(resourceGroupName, resourceName, jobId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #7
0
 /// <summary>
 /// Get a list of the consumer groups in the Event Hub-compatible
 /// device-to-cloud endpoint in an IoT hub.
 /// </summary>
 /// <remarks>
 /// Get a list of the consumer groups in the Event Hub-compatible
 /// device-to-cloud endpoint in an IoT hub.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the IoT hub.
 /// </param>
 /// <param name='resourceName'>
 /// The name of the IoT hub.
 /// </param>
 /// <param name='eventHubEndpointName'>
 /// The name of the Event Hub-compatible endpoint.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <string> > ListEventHubConsumerGroupsAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, string eventHubEndpointName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListEventHubConsumerGroupsWithHttpMessagesAsync(resourceGroupName, resourceName, eventHubEndpointName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #8
0
 /// <summary>
 /// Get the list of valid SKUs for an IoT hub.
 /// </summary>
 /// <remarks>
 /// Get the list of valid SKUs for an IoT hub.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the IoT hub.
 /// </param>
 /// <param name='resourceName'>
 /// The name of the IoT hub.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <IotHubSkuDescription> > GetValidSkusAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetValidSkusWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #9
0
 /// <summary>
 /// Get the quota metrics for an IoT hub.
 /// </summary>
 /// <remarks>
 /// Get the quota metrics for an IoT hub.
 /// </remarks>
 /// <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 <IotHubQuotaMetricInfo> > GetQuotaMetricsNextAsync(this IIotHubResourceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetQuotaMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #10
0
 /// <summary>
 /// Get a shared access policy by name from an IoT hub. For more information,
 /// see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
 /// </summary>
 /// <remarks>
 /// Get a shared access policy by name from an IoT hub. For more information,
 /// see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the IoT hub.
 /// </param>
 /// <param name='resourceName'>
 /// The name of the IoT hub.
 /// </param>
 /// <param name='keyName'>
 /// The name of the shared access policy.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <SharedAccessSignatureAuthorizationRuleInner> GetKeysForKeyNameAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, string keyName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetKeysForKeyNameWithHttpMessagesAsync(resourceGroupName, resourceName, keyName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #11
0
 /// <summary>
 /// Check if an IoT hub name is available.
 /// </summary>
 /// <remarks>
 /// Check if an IoT hub name is available.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// The name of the IoT hub to check.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IotHubNameAvailabilityInfoInner> CheckNameAvailabilityAsync(this IIotHubResourceOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #12
0
 /// <summary>
 /// Delete a consumer group from an Event Hub-compatible endpoint in an IoT
 /// hub.
 /// </summary>
 /// <remarks>
 /// Delete a consumer group from an Event Hub-compatible endpoint in an IoT
 /// hub.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the IoT hub.
 /// </param>
 /// <param name='resourceName'>
 /// The name of the IoT hub.
 /// </param>
 /// <param name='eventHubEndpointName'>
 /// The name of the Event Hub-compatible endpoint in the IoT hub.
 /// </param>
 /// <param name='name'>
 /// The name of the consumer group to delete.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteEventHubConsumerGroupAsync(this IIotHubResourceOperations operations, string resourceGroupName, string resourceName, string eventHubEndpointName, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteEventHubConsumerGroupWithHttpMessagesAsync(resourceGroupName, resourceName, eventHubEndpointName, name, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
예제 #13
0
 /// <summary>
 /// Get all the IoT hubs in a subscription.
 /// </summary>
 /// <remarks>
 /// Get all the IoT hubs in a subscription.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <IotHubDescriptionInner> > ListBySubscriptionAsync(this IIotHubResourceOperations operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }