Skip to content

Commit e96dd6d

Browse files
authored
[MetricsAdvisor] Added options for configuration listing methods (Azure#21448)
1 parent 5890f31 commit e96dd6d

File tree

7 files changed

+190
-25
lines changed

7 files changed

+190
-25
lines changed

sdk/metricsadvisor/Azure.AI.MetricsAdvisor/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
- Added properties `Value` and `ExpectedValue` to `DataPointAnomaly` to provide more information about the anomalous data point.
77
- Added properties `ValueOfRootNode` and `ExpectedValueOfRootNode` to `AnomalyIncident` to provide more information about the anomalous data point at the root node of the indicent.
88
- Response headers that were marked as `REDACTED` in error messages and logs are now exposed by default.
9+
- `GetDetectionConfigurations` and `GetAlertConfigurations` in the `MetricsAdvisorAdministrationClient` can now take a set of options with `Skip` and `MaxPageSize` properties to configure paging behavior.
910

1011
### Breaking Changes
1112
- `NotificationHook.ExternalLink` and `WebNotificationHook.Endpoint` are now of type `Uri`.
12-
- Removed getter from `GetIncidentsForDetectionConfigurationOptions.DimensionsToFilter`. Elements can be added directly to it without user instantiation.
13+
- Removed setter from `GetIncidentsForDetectionConfigurationOptions.DimensionsToFilter`. Elements can be added directly to it without user instantiation.
1314
- Renamed all `SkipCount` listing options to `Skip`. Affected classes include `GetAlertsOptions`, `GetDataFeedsOptions`, `GetHooksOptions`, and others.
1415
- Renamed all `TopCount` listing options to `MaxPageSize`. Affected classes include `GetAlertsOptions`, `GetDataFeedsOptions`, `GetHooksOptions`, and others.
1516
- Removed data feed sources `ElasticsearchDataFeedSource` and `HttpRequestDataFeedSource` as they are not supported by the service anymore. A different type of data feed source must be used for data ingestion instead.

sdk/metricsadvisor/Azure.AI.MetricsAdvisor/api/Azure.AI.MetricsAdvisor.netstandard2.0.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ public static partial class AzureCognitiveServiceMetricsAdvisorRestAPIOpenAPIV2M
5050
public static bool operator !=(Azure.AI.MetricsAdvisor.FeedbackQueryTimeMode left, Azure.AI.MetricsAdvisor.FeedbackQueryTimeMode right) { throw null; }
5151
public override string ToString() { throw null; }
5252
}
53+
public partial class GetAlertConfigurationsOptions
54+
{
55+
public GetAlertConfigurationsOptions() { }
56+
public int? MaxPageSize { get { throw null; } set { } }
57+
public int? Skip { get { throw null; } set { } }
58+
}
5359
public partial class GetAlertsOptions
5460
{
5561
public GetAlertsOptions(System.DateTimeOffset startTime, System.DateTimeOffset endTime, Azure.AI.MetricsAdvisor.AlertQueryTimeMode timeMode) { }
@@ -93,6 +99,12 @@ public GetAnomaliesForDetectionConfigurationOptions(System.DateTimeOffset startT
9399
public int? Skip { get { throw null; } set { } }
94100
public System.DateTimeOffset StartTime { get { throw null; } }
95101
}
102+
public partial class GetDetectionConfigurationsOptions
103+
{
104+
public GetDetectionConfigurationsOptions() { }
105+
public int? MaxPageSize { get { throw null; } set { } }
106+
public int? Skip { get { throw null; } set { } }
107+
}
96108
public partial class GetDimensionValuesOptions
97109
{
98110
public GetDimensionValuesOptions() { }
@@ -264,8 +276,8 @@ public MetricsAdvisorAdministrationClient(System.Uri endpoint, Azure.Core.TokenC
264276
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteHookAsync(string hookId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
265277
public virtual Azure.Response<Azure.AI.MetricsAdvisor.Models.AnomalyAlertConfiguration> GetAlertConfiguration(string alertConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
266278
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.MetricsAdvisor.Models.AnomalyAlertConfiguration>> GetAlertConfigurationAsync(string alertConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
267-
public virtual Azure.Pageable<Azure.AI.MetricsAdvisor.Models.AnomalyAlertConfiguration> GetAlertConfigurations(string detectionConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
268-
public virtual Azure.AsyncPageable<Azure.AI.MetricsAdvisor.Models.AnomalyAlertConfiguration> GetAlertConfigurationsAsync(string detectionConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
279+
public virtual Azure.Pageable<Azure.AI.MetricsAdvisor.Models.AnomalyAlertConfiguration> GetAlertConfigurations(string detectionConfigurationId, Azure.AI.MetricsAdvisor.GetAlertConfigurationsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
280+
public virtual Azure.AsyncPageable<Azure.AI.MetricsAdvisor.Models.AnomalyAlertConfiguration> GetAlertConfigurationsAsync(string detectionConfigurationId, Azure.AI.MetricsAdvisor.GetAlertConfigurationsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
269281
public virtual Azure.Response<Azure.AI.MetricsAdvisor.Models.DataSourceCredentialEntity> GetCredentialEntity(string credentialEntityId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
270282
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.MetricsAdvisor.Models.DataSourceCredentialEntity>> GetCredentialEntityAsync(string credentialEntityId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
271283
public virtual Azure.Response<Azure.AI.MetricsAdvisor.Models.DataFeed> GetDataFeed(string dataFeedId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
@@ -278,8 +290,8 @@ public MetricsAdvisorAdministrationClient(System.Uri endpoint, Azure.Core.TokenC
278290
public virtual Azure.AsyncPageable<Azure.AI.MetricsAdvisor.Models.DataFeed> GetDataFeedsAsync(Azure.AI.MetricsAdvisor.Administration.GetDataFeedsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
279291
public virtual Azure.Response<Azure.AI.MetricsAdvisor.Models.AnomalyDetectionConfiguration> GetDetectionConfiguration(string detectionConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
280292
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.MetricsAdvisor.Models.AnomalyDetectionConfiguration>> GetDetectionConfigurationAsync(string detectionConfigurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
281-
public virtual Azure.Pageable<Azure.AI.MetricsAdvisor.Models.AnomalyDetectionConfiguration> GetDetectionConfigurations(string metricId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
282-
public virtual Azure.AsyncPageable<Azure.AI.MetricsAdvisor.Models.AnomalyDetectionConfiguration> GetDetectionConfigurationsAsync(string metricId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
293+
public virtual Azure.Pageable<Azure.AI.MetricsAdvisor.Models.AnomalyDetectionConfiguration> GetDetectionConfigurations(string metricId, Azure.AI.MetricsAdvisor.GetDetectionConfigurationsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
294+
public virtual Azure.AsyncPageable<Azure.AI.MetricsAdvisor.Models.AnomalyDetectionConfiguration> GetDetectionConfigurationsAsync(string metricId, Azure.AI.MetricsAdvisor.GetDetectionConfigurationsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
283295
public virtual Azure.Response<Azure.AI.MetricsAdvisor.Models.NotificationHook> GetHook(string hookId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
284296
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.MetricsAdvisor.Models.NotificationHook>> GetHookAsync(string hookId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
285297
public virtual Azure.Pageable<Azure.AI.MetricsAdvisor.Models.NotificationHook> GetHooks(Azure.AI.MetricsAdvisor.Administration.GetHooksOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Azure.AI.MetricsAdvisor.Administration;
5+
6+
namespace Azure.AI.MetricsAdvisor
7+
{
8+
/// <summary>
9+
/// The set of options that can be specified when calling <see cref="MetricsAdvisorAdministrationClient.GetAlertConfigurations"/>
10+
/// or <see cref="MetricsAdvisorAdministrationClient.GetAlertConfigurationsAsync"/> to configure the behavior of the request.
11+
/// </summary>
12+
public class GetAlertConfigurationsOptions
13+
{
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="GetAlertConfigurationsOptions"/> class.
16+
/// </summary>
17+
public GetAlertConfigurationsOptions()
18+
{
19+
}
20+
21+
/// <summary>
22+
/// If set, skips the first set of items returned. This property specifies the amount of items to
23+
/// be skipped.
24+
/// </summary>
25+
public int? Skip { get; set; }
26+
27+
/// <summary>
28+
/// If set, specifies the maximum limit of items returned in each page of results. Note:
29+
/// unless the number of pages enumerated from the service is limited, the service will
30+
/// return an unlimited number of total items.
31+
/// </summary>
32+
public int? MaxPageSize { get; set; }
33+
}
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Azure.AI.MetricsAdvisor.Administration;
5+
6+
namespace Azure.AI.MetricsAdvisor
7+
{
8+
/// <summary>
9+
/// The set of options that can be specified when calling <see cref="MetricsAdvisorAdministrationClient.GetDetectionConfigurations"/>
10+
/// or <see cref="MetricsAdvisorAdministrationClient.GetDetectionConfigurationsAsync"/> to configure the behavior of the request.
11+
/// </summary>
12+
public class GetDetectionConfigurationsOptions
13+
{
14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="GetDetectionConfigurationsOptions"/> class.
16+
/// </summary>
17+
public GetDetectionConfigurationsOptions()
18+
{
19+
}
20+
21+
/// <summary>
22+
/// If set, skips the first set of items returned. This property specifies the amount of items to
23+
/// be skipped.
24+
/// </summary>
25+
public int? Skip { get; set; }
26+
27+
/// <summary>
28+
/// If set, specifies the maximum limit of items returned in each page of results. Note:
29+
/// unless the number of pages enumerated from the service is limited, the service will
30+
/// return an unlimited number of total items.
31+
/// </summary>
32+
public int? MaxPageSize { get; set; }
33+
}
34+
}

0 commit comments

Comments
 (0)