コード例 #1
0
 /// <summary>
 /// **Gets the baseline values for a specific metric**.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The identifier of the resource. It has the following structure:
 /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
 /// For example:
 /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
 /// </param>
 /// <param name='metricName'>
 /// The name of the metric to retrieve the baseline for.
 /// </param>
 /// <param name='timespan'>
 /// The timespan of the query. It is a string with the following format
 /// 'startDateTime_ISO/endDateTime_ISO'.
 /// </param>
 /// <param name='interval'>
 /// The interval (i.e. timegrain) of the query.
 /// </param>
 /// <param name='aggregation'>
 /// The aggregation type of the metric to retrieve the baseline for.
 /// </param>
 /// <param name='sensitivities'>
 /// The list of sensitivities (comma separated) to retrieve.
 /// </param>
 /// <param name='resultType'>
 /// Allows retrieving only metadata of the baseline. On data request all
 /// information is retrieved. Possible values include: 'Data', 'Metadata'
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <BaselineResponse> GetAsync(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan?interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType?resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #2
0
 /// <summary>
 /// **Lists the baseline values for a resource**.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The identifier of the resource. It has the following structure:
 /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
 /// For example:
 /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
 /// </param>
 /// <param name='timeSeriesInformation'>
 /// Information that need to be specified to calculate a baseline on a time
 /// series.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CalculateBaselineResponse> CalculateBaselineAsync(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CalculateBaselineWithHttpMessagesAsync(resourceUri, timeSeriesInformation, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #3
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     AutoscaleSettings          = new AutoscaleSettingsOperations(this);
     Operations                 = new Operations(this);
     AlertRuleIncidents         = new AlertRuleIncidentsOperations(this);
     AlertRules                 = new AlertRulesOperations(this);
     LogProfiles                = new LogProfilesOperations(this);
     DiagnosticSettings         = new DiagnosticSettingsOperations(this);
     DiagnosticSettingsCategory = new DiagnosticSettingsCategoryOperations(this);
     ActionGroups               = new ActionGroupsOperations(this);
     ActivityLogAlerts          = new ActivityLogAlertsOperations(this);
     ActivityLogs               = new ActivityLogsOperations(this);
     EventCategories            = new EventCategoriesOperations(this);
     TenantActivityLogs         = new TenantActivityLogsOperations(this);
     MetricDefinitions          = new MetricDefinitionsOperations(this);
     Metrics        = new MetricsOperations(this);
     MetricBaseline = new MetricBaselineOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     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()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <RuleDataSource>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <RuleDataSource>("odata.type"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <RuleCondition>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <RuleCondition>("odata.type"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <RuleAction>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <RuleAction>("odata.type"));
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
コード例 #4
0
 /// <summary>
 /// **Gets the baseline values for a specific metric**.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The identifier of the resource. It has the following structure:
 /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
 /// For example:
 /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
 /// </param>
 /// <param name='metricName'>
 /// The name of the metric to retrieve the baseline for.
 /// </param>
 /// <param name='timespan'>
 /// The timespan of the query. It is a string with the following format
 /// 'startDateTime_ISO/endDateTime_ISO'.
 /// </param>
 /// <param name='interval'>
 /// The interval (i.e. timegrain) of the query.
 /// </param>
 /// <param name='aggregation'>
 /// The aggregation type of the metric to retrieve the baseline for.
 /// </param>
 /// <param name='sensitivities'>
 /// The list of sensitivities (comma separated) to retrieve.
 /// </param>
 /// <param name='resultType'>
 /// Allows retrieving only metadata of the baseline. On data request all
 /// information is retrieved. Possible values include: 'Data', 'Metadata'
 /// </param>
 public static BaselineResponse Get(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan?interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType?resultType = default(ResultType?))
 {
     return(operations.GetAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType).GetAwaiter().GetResult());
 }
コード例 #5
0
 /// <summary>
 /// **Lists the baseline values for a resource**.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The identifier of the resource. It has the following structure:
 /// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
 /// For example:
 /// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
 /// </param>
 /// <param name='timeSeriesInformation'>
 /// Information that need to be specified to calculate a baseline on a time
 /// series.
 /// </param>
 public static CalculateBaselineResponse CalculateBaseline(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation)
 {
     return(operations.CalculateBaselineAsync(resourceUri, timeSeriesInformation).GetAwaiter().GetResult());
 }