/// <summary>
        /// Initializes a new instance of the <see cref="MonitoringAccountConfigurationManager"/> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information for the MDM endpoint being used.</param>
        public MonitoringAccountConfigurationManager(ConnectionInfo connectionInfo)
        {
            if (connectionInfo == null)
            {
                throw new ArgumentNullException(nameof(connectionInfo));
            }

            this.connectionInfo = connectionInfo;

            this.operation = this.connectionInfo.GetAuthRelativeUrl("v1/config");

            this.monitoringAccountUrlPrefix = this.operation + "/monitoringAccount/";
            this.tenantUrlPrefix            = this.operation + "/tenant/";

            this.httpClient = HttpClientHelper.CreateHttpClientWithAuthInfo(connectionInfo);

            var migrations = new[]
            {
                new ClientAssemblyMigration(
                    "Metrics.Server",
                    "Microsoft.Online.Metrics.Server.Utilities.ConfigurationUpdateResult",
                    typeof(ConfigurationUpdateResult))
            };

            this.serializerSettings = new JsonSerializerSettings
            {
                TypeNameHandling = TypeNameHandling.Auto,
                Binder           = new ClientAssemblyMigrationSerializationBinder(migrations)
            };
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OboMetricReader"/> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        /// <param name="clientId">The string identifying client.</param>
        public OboMetricReader(ConnectionInfo connectionInfo, string clientId = "OBO")
        {
            if (connectionInfo == null)
            {
                throw new ArgumentNullException(nameof(connectionInfo));
            }

            this.connectionInfo = connectionInfo;
            this.clientId       = clientId;
            this.httpClient     = HttpClientHelper.CreateHttpClientWithAuthInfo(connectionInfo);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PreaggregateFiltersManager"/> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information for the MDM endpoint being used.</param>
        public PreaggregateFiltersManager(ConnectionInfo connectionInfo)
        {
            if (connectionInfo == null)
            {
                throw new ArgumentNullException(nameof(connectionInfo));
            }

            this.connectionInfo         = connectionInfo;
            this.configurationUrlPrefix = this.connectionInfo.GetAuthRelativeUrl("v1/config/preaggregate/dimensionfilters/");

            this.httpClient = HttpClientHelper.CreateHttpClientWithAuthInfo(connectionInfo);
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MonitorReader"/> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information.</param>
        public MonitorReader(ConnectionInfo connectionInfo)
        {
            if (connectionInfo == null)
            {
                throw new ArgumentNullException(nameof(connectionInfo));
            }

            this.connectionInfo      = connectionInfo;
            this.HealthRelativeUrl   = this.connectionInfo.GetAuthRelativeUrl(MetricsServerRelativeUris.HealthRelativeUrl);
            this.ConfigRelativeUrlV2 = this.connectionInfo.GetAuthRelativeUrl(MetricsServerRelativeUris.ConfigRelativeUrlV2);
            this.httpClient          = HttpClientHelper.CreateHttpClientWithAuthInfo(connectionInfo);

            this.GetResponseAsStringDelegate = HttpClientHelper.GetResponse;
        }
Example #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StampLevelMetricEnrichmentRuleManager"/> class.
        /// </summary>
        /// <param name="connectionInfo">The connection information for the MDM endpoint being used.</param>
        public StampLevelMetricEnrichmentRuleManager(ConnectionInfo connectionInfo)
        {
            if (connectionInfo == null)
            {
                throw new ArgumentNullException(nameof(connectionInfo));
            }

            this.connectionInfo         = connectionInfo;
            this.configurationUrlPrefix = this.connectionInfo.GetAuthRelativeUrl("v1/config/enrichmentrules/");

            this.httpClient = HttpClientHelper.CreateHttpClientWithAuthInfo(connectionInfo);

            this.serializerSettings = new JsonSerializerSettings
            {
                TypeNameHandling = TypeNameHandling.Auto
            };
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MonitorConfigurationManager" /> class.
 /// </summary>
 /// <param name="connectionInfo">The connection information for the endpoint being used.</param>
 public MonitorConfigurationManager(ConnectionInfo connectionInfo)
     : this(connectionInfo, HttpClientHelper.CreateHttpClientWithAuthInfo(connectionInfo), new MetricReader(connectionInfo))
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MetricConfigurationManager" /> class.
 /// </summary>
 /// <param name="connectionInfo">The connection information.</param>
 public MetricConfigurationManager(ConnectionInfo connectionInfo)
 {
     this.connectionInfo    = connectionInfo;
     this.ConfigRelativeUrl = this.connectionInfo.GetAuthRelativeUrl(MetricsServerRelativeUris.ConfigRelativeUrl);
     this.httpClient        = HttpClientHelper.CreateHttpClientWithAuthInfo(connectionInfo);
 }