示例#1
0
 /// <summary>
 /// Main Controller
 /// </summary>
 /// <param name="userProfile">User Service</param>
 /// <param name="blobRepo">Blob Repository</param>
 public AzureBlobStorageController(IUserProfileService userProfile,
                                   IBlobStorageRepository blobRepo,
                                   IOptionsSnapshot <IoTHubOptions> iotOptions,
                                   IOptionsSnapshot <BlobOptions> blobOptions,
                                   IOptionsSnapshot <CosmosDbOptions> cosmostOptions,
                                   ILogger <AzureBlobStorageController> logger)
     : base(userProfile)
 {
     _blobRepo           = blobRepo;
     this.logger         = logger;
     this.cosmostOptions = cosmostOptions.Value;
     this.iotOptions     = iotOptions.Value;
     this.blobOptions    = blobOptions.Value;
 }
示例#2
0
        /// <summary>
        /// Add a health check for Azure IoT Hub.
        /// </summary>
        /// <param name="builder">The <see cref="IHealthChecksBuilder"/>.</param>
        /// <param name="optionsFactory">A action to configure the Azure IoT Hub connection to use.</param>
        /// <param name="name">The health check name. Optional. If <c>null</c> the type name 'iothub' will be used for the name.</param>
        /// <param name="failureStatus">
        /// The <see cref="HealthStatus"/> that should be reported when the health check fails. Optional. If <c>null</c> then
        /// the default status of <see cref="HealthStatus.Unhealthy"/> will be reported.
        /// </param>
        /// <param name="tags">A list of tags that can be used to filter sets of health checks. Optional.</param>
        /// <param name="timeout">An optional System.TimeSpan representing the timeout of the check.</param>
        /// <returns>The <see cref="IHealthChecksBuilder"/>.</returns>
        public static IHealthChecksBuilder AddAzureIoTHub(this IHealthChecksBuilder builder,
                                                          Action <IoTHubOptions> optionsFactory,
                                                          string name = default,
                                                          HealthStatus?failureStatus = default,
                                                          IEnumerable <string> tags  = default,
                                                          TimeSpan?timeout           = default)
        {
            var options = new IoTHubOptions();

            optionsFactory?.Invoke(options);

            var registrationName = name ?? NAME;

            return(builder.Add(new HealthCheckRegistration(
                                   registrationName,
                                   sp => new IoTHubHealthCheck(options),
                                   failureStatus,
                                   tags,
                                   timeout)));
        }
示例#3
0
 public IoTHubModuleTwinService(IoTHubOptions options)
 {
     _options = options;
 }