Skip to content

Commit c451d93

Browse files
feat: add support for the 2024-02-01 metric ns API (Azure#50841)
* feat: add support for the 2024-02-01 metric ns API * Update sdk/monitor/Azure.Monitor.Query/CHANGELOG.md Co-authored-by: Scott Addie <[email protected]> --------- Co-authored-by: Scott Addie <[email protected]>
1 parent ecfd7be commit c451d93

File tree

8 files changed

+17
-16
lines changed

8 files changed

+17
-16
lines changed

sdk/monitor/Azure.Monitor.Query/CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
7+
- Added support for the `2024-02-01` metric namespaces service version to `MetricsQueryClient`.
128

139
## 1.6.0 (2024-12-03)
1410

sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.net8.0.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,12 @@ public MetricsQueryClient(System.Uri endpoint, Azure.Core.TokenCredential creden
141141
}
142142
public partial class MetricsQueryClientOptions : Azure.Core.ClientOptions
143143
{
144-
public MetricsQueryClientOptions(Azure.Monitor.Query.MetricsQueryClientOptions.ServiceVersion version = Azure.Monitor.Query.MetricsQueryClientOptions.ServiceVersion.V2018_01_01) { }
144+
public MetricsQueryClientOptions(Azure.Monitor.Query.MetricsQueryClientOptions.ServiceVersion version = Azure.Monitor.Query.MetricsQueryClientOptions.ServiceVersion.V2024_02_01) { }
145145
public Azure.Monitor.Query.MetricsQueryAudience? Audience { get { throw null; } set { } }
146146
public enum ServiceVersion
147147
{
148148
V2018_01_01 = 1,
149+
V2024_02_01 = 2,
149150
}
150151
}
151152
public partial class MetricsQueryOptions

sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,12 @@ public MetricsQueryClient(System.Uri endpoint, Azure.Core.TokenCredential creden
141141
}
142142
public partial class MetricsQueryClientOptions : Azure.Core.ClientOptions
143143
{
144-
public MetricsQueryClientOptions(Azure.Monitor.Query.MetricsQueryClientOptions.ServiceVersion version = Azure.Monitor.Query.MetricsQueryClientOptions.ServiceVersion.V2018_01_01) { }
144+
public MetricsQueryClientOptions(Azure.Monitor.Query.MetricsQueryClientOptions.ServiceVersion version = Azure.Monitor.Query.MetricsQueryClientOptions.ServiceVersion.V2024_02_01) { }
145145
public Azure.Monitor.Query.MetricsQueryAudience? Audience { get { throw null; } set { } }
146146
public enum ServiceVersion
147147
{
148148
V2018_01_01 = 1,
149+
V2024_02_01 = 2,
149150
}
150151
}
151152
public partial class MetricsQueryOptions

sdk/monitor/Azure.Monitor.Query/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "net",
44
"TagPrefix": "net/monitor/Azure.Monitor.Query",
5-
"Tag": "net/monitor/Azure.Monitor.Query_3bd28d9e3d"
5+
"Tag": "net/monitor/Azure.Monitor.Query_8e43bc53d8"
66
}

sdk/monitor/Azure.Monitor.Query/src/Generated/MetricNamespacesRestClient.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/monitor/Azure.Monitor.Query/src/MetricsQueryClientOptions.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class MetricsQueryClientOptions: ClientOptions
1515
/// <summary>
1616
/// The latest service version supported by this client library.
1717
/// </summary>
18-
internal const ServiceVersion LatestVersion = ServiceVersion.V2018_01_01;
18+
internal const ServiceVersion LatestVersion = ServiceVersion.V2024_02_01;
1919

2020
/// <summary>
2121
/// Initializes a new instance of the <see cref="MetricsQueryClientOptions"/> class.
@@ -35,12 +35,15 @@ public MetricsQueryClientOptions(ServiceVersion version = LatestVersion)
3535
/// </summary>
3636
public enum ServiceVersion
3737
{
38-
#pragma warning disable CA1707 // Identifiers should not contain underscores
3938
/// <summary>
4039
/// Version 2018-01-01 of the service.
4140
/// </summary>
4241
V2018_01_01 = 1,
43-
#pragma warning restore CA1707 // Identifiers should not contain underscores
42+
43+
/// <summary>
44+
/// Version 2024-02-01 of the service.
45+
/// </summary>
46+
V2024_02_01 = 2,
4447
}
4548

4649
/// <summary>

sdk/monitor/Azure.Monitor.Query/src/autorest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: MonitorQuery
77
input-file:
88
- https://github.com/Azure/azure-rest-api-specs/blob/0373f0edc4414fd402603fac51d0df93f1f70507/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-10-01/metricDefinitions_API.json
99
- https://github.com/Azure/azure-rest-api-specs/blob/0373f0edc4414fd402603fac51d0df93f1f70507/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-10-01/metrics_API.json
10-
- https://github.com/Azure/azure-rest-api-specs/blob/0373f0edc4414fd402603fac51d0df93f1f70507/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json
10+
- https://github.com/Azure/azure-rest-api-specs/blob/0b64ca7cbe3af8cd13228dfb783a16b8272b8be2/specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/metricNamespaces_API.json
1111
- https://github.com/Azure/azure-rest-api-specs/blob/0550754fb421cd3a5859abf6713a542b682f626c/specification/monitor/data-plane/Microsoft.Insights/stable/2023-10-01/metricBatch.json
1212
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/21f5332f2dc7437d1446edf240e9a3d4c90c6431/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/2022-10-27/OperationalInsights.json
1313
generation1-convenience-client: true

sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientLiveTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ public async Task CanListNamespacesMetrics()
247247
TestEnvironment.MetricsResource).ToEnumerableAsync();
248248

249249
Assert.True(results.Any(ns =>
250-
ns.Name == "microsoft.operationalinsights-workspaces" &&
251-
ns.Type == "Microsoft.Insights/metricNamespaces" &&
252-
ns.FullyQualifiedName == "microsoft.operationalinsights/workspaces"));
250+
ns.Name.Equals("microsoft.operationalinsights-workspaces", StringComparison.OrdinalIgnoreCase) &&
251+
ns.Type.Equals("Microsoft.Insights/metricNamespaces", StringComparison.OrdinalIgnoreCase) &&
252+
ns.FullyQualifiedName.Equals("microsoft.operationalinsights/workspaces", StringComparison.OrdinalIgnoreCase)));
253253
}
254254

255255
[RecordedTest]

0 commit comments

Comments
 (0)