Skip to content

Commit 767d32e

Browse files
arushiarora24ArcturusZhangHarveyLinkArushi Arora
authored
SDK refresh for Dynatrace 2024-04-24 API version (#53831)
Co-authored-by: Dapeng Zhang <ufo54153@gmail.com> Co-authored-by: Minghao Chen <30464227+HarveyLink@users.noreply.github.com> Co-authored-by: Arushi Arora <arushiarora@microsoft.com>
1 parent a8470e7 commit 767d32e

File tree

83 files changed

+6345
-526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+6345
-526
lines changed

sdk/dynatrace/Azure.ResourceManager.Dynatrace/CHANGELOG.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# Release History
22

3-
## 1.2.0-beta.1 (Unreleased)
3+
## 1.2.0 (2025-11-27)
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
7+
- - Upgraded api-version tag to 'package-2024-04-24'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/7eb817d513e6b2364a823d1f56db45d25fdca7b7/specification/dynatrace/resource-manager/readme.md.
128

139
## 1.1.1 (2025-03-11)
1410

sdk/dynatrace/Azure.ResourceManager.Dynatrace/api/Azure.ResourceManager.Dynatrace.net8.0.cs

Lines changed: 285 additions & 4 deletions
Large diffs are not rendered by default.

sdk/dynatrace/Azure.ResourceManager.Dynatrace/api/Azure.ResourceManager.Dynatrace.netstandard2.0.cs

Lines changed: 285 additions & 4 deletions
Large diffs are not rendered by default.

sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Azure.ResourceManager.Dynatrace.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>1.2.0-beta.1</Version>
3+
<Version>1.2.0</Version>
44
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
55
<ApiCompatVersion>1.1.1</ApiCompatVersion>
66
<PackageId>Azure.ResourceManager.Dynatrace</PackageId>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System;
7+
using System.Collections.Generic;
8+
using System.ComponentModel;
9+
using System.Linq;
10+
using Azure.Core;
11+
using Azure.ResourceManager.Models;
12+
13+
namespace Azure.ResourceManager.Dynatrace.Models
14+
{
15+
public static partial class ArmDynatraceModelFactory
16+
{
17+
/// <summary> Initializes a new instance of <see cref="Models.DynatraceAccountCredentialsInfo"/>. </summary>
18+
/// <param name="accountId"> Account Id of the account this environment is linked to. </param>
19+
/// <param name="apiKey"> API Key of the user account. </param>
20+
/// <param name="regionId"> Region in which the account is created. </param>
21+
/// <returns> A new <see cref="Models.DynatraceAccountCredentialsInfo"/> instance for mocking. </returns>
22+
// Add this model due to the api compatibility for operation: Monitors_GetAccountCredentials.
23+
public static DynatraceAccountCredentialsInfo DynatraceAccountCredentialsInfo(string accountId = null, string apiKey = null, string regionId = null)
24+
{
25+
return new DynatraceAccountCredentialsInfo(accountId, apiKey, regionId, serializedAdditionalRawData: null);
26+
}
27+
28+
/// <summary> Initializes a new instance of <see cref="Dynatrace.DynatraceTagRuleData"/>. </summary>
29+
/// <param name="id"> The id. </param>
30+
/// <param name="name"> The name. </param>
31+
/// <param name="resourceType"> The resourceType. </param>
32+
/// <param name="systemData"> The systemData. </param>
33+
/// <param name="logRules"> Set of rules for sending logs for the Monitor resource. </param>
34+
/// <param name="metricRulesFilteringTags"> Set of rules for sending metrics for the Monitor resource. </param>
35+
/// <param name="provisioningState"> Provisioning state of the resource. </param>
36+
/// <returns> A new <see cref="Dynatrace.DynatraceTagRuleData"/> instance for mocking. </returns>
37+
// Add this custom code due to the previous swagger definition for MetricRules only had FilteringTags as a direct child property.
38+
[EditorBrowsable(EditorBrowsableState.Never)]
39+
public static DynatraceTagRuleData DynatraceTagRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DynatraceMonitorResourceLogRules logRules, IEnumerable<DynatraceMonitorResourceFilteringTag> metricRulesFilteringTags, DynatraceProvisioningState? provisioningState = null)
40+
{
41+
DynatraceMonitorResourceMetricRules metricRules = null;
42+
if (metricRulesFilteringTags != null)
43+
{
44+
metricRules = new DynatraceMonitorResourceMetricRules();
45+
foreach (var tag in metricRulesFilteringTags)
46+
{
47+
metricRules.FilteringTags.Add(tag);
48+
}
49+
}
50+
return DynatraceTagRuleData(id, name, resourceType, systemData, logRules, metricRules, provisioningState);
51+
}
52+
}
53+
}

sdk/dynatrace/Azure.ResourceManager.Dynatrace/src/Customized/DynatraceMonitorData.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
using System;
77
using System.Collections.Generic;
88
using Azure.Core;
9-
using Azure.ResourceManager.Dynatrace.Models;
109
using Azure.ResourceManager.Models;
1110

1211
namespace Azure.ResourceManager.Dynatrace
1312
{
1413
public partial class DynatraceMonitorData : TrackedResourceData
1514
{
1615
/// <summary> The managed service identities assigned to this resource. Current supported identity types: SystemAssigned, UserAssigned, SystemAndUserAssigned. </summary>
17-
public ManagedServiceIdentity Identity { get; set; }
16+
public ResourceManager.Models.ManagedServiceIdentity Identity { get; set; }
1817
}
1918
}
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System;
7+
using System.ComponentModel;
8+
using System.Threading;
9+
using System.Threading.Tasks;
10+
using Autorest.CSharp.Core;
11+
using Azure.Core;
12+
using Azure.ResourceManager.Dynatrace.Models;
13+
14+
namespace Azure.ResourceManager.Dynatrace
15+
{
16+
public partial class DynatraceMonitorResource
17+
{
18+
/// <summary>
19+
/// Gets the user account credentials for a Monitor
20+
/// <list type="bullet">
21+
/// <item>
22+
/// <term>Request Path</term>
23+
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getAccountCredentials</description>
24+
/// </item>
25+
/// <item>
26+
/// <term>Operation Id</term>
27+
/// <description>Monitors_GetAccountCredentials</description>
28+
/// </item>
29+
/// <item>
30+
/// <term>Default Api Version</term>
31+
/// <description>2021-09-01</description>
32+
/// </item>
33+
/// <item>
34+
/// <term>Resource</term>
35+
/// <description><see cref="DynatraceMonitorResource"/></description>
36+
/// </item>
37+
/// </list>
38+
/// </summary>
39+
/// <param name="cancellationToken"> The cancellation token to use. </param>
40+
// Add this custom code due to the api compatibility for operation: Monitors_GetAccountCredentials.
41+
[EditorBrowsable(EditorBrowsableState.Never)]
42+
public virtual async Task<Response<DynatraceAccountCredentialsInfo>> GetAccountCredentialsAsync(CancellationToken cancellationToken = default)
43+
{
44+
using var scope = _dynatraceMonitorMonitorsClientDiagnostics.CreateScope("DynatraceMonitorResource.GetAccountCredentials");
45+
scope.Start();
46+
try
47+
{
48+
var response = await _dynatraceMonitorMonitorsRestClient.GetAccountCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
49+
return response;
50+
}
51+
catch (Exception e)
52+
{
53+
scope.Failed(e);
54+
throw;
55+
}
56+
}
57+
58+
/// <summary>
59+
/// Gets the user account credentials for a Monitor
60+
/// <list type="bullet">
61+
/// <item>
62+
/// <term>Request Path</term>
63+
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/getAccountCredentials</description>
64+
/// </item>
65+
/// <item>
66+
/// <term>Operation Id</term>
67+
/// <description>Monitors_GetAccountCredentials</description>
68+
/// </item>
69+
/// <item>
70+
/// <term>Default Api Version</term>
71+
/// <description>2021-09-01</description>
72+
/// </item>
73+
/// <item>
74+
/// <term>Resource</term>
75+
/// <description><see cref="DynatraceMonitorResource"/></description>
76+
/// </item>
77+
/// </list>
78+
/// </summary>
79+
/// <param name="cancellationToken"> The cancellation token to use. </param>
80+
// Add this custom code due to the api compatibility for operation: Monitors_GetAccountCredentials.
81+
[EditorBrowsable(EditorBrowsableState.Never)]
82+
public virtual Response<DynatraceAccountCredentialsInfo> GetAccountCredentials(CancellationToken cancellationToken = default)
83+
{
84+
using var scope = _dynatraceMonitorMonitorsClientDiagnostics.CreateScope("DynatraceMonitorResource.GetAccountCredentials");
85+
scope.Start();
86+
try
87+
{
88+
var response = _dynatraceMonitorMonitorsRestClient.GetAccountCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
89+
return response;
90+
}
91+
catch (Exception e)
92+
{
93+
scope.Failed(e);
94+
throw;
95+
}
96+
}
97+
98+
/// <summary>
99+
/// List the resources currently being monitored by the Dynatrace monitor resource.
100+
/// <list type="bullet">
101+
/// <item>
102+
/// <term>Request Path</term>
103+
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/listMonitoredResources</description>
104+
/// </item>
105+
/// <item>
106+
/// <term>Operation Id</term>
107+
/// <description>Monitors_ListMonitoredResources</description>
108+
/// </item>
109+
/// <item>
110+
/// <term>Default Api Version</term>
111+
/// <description>2021-09-01</description>
112+
/// </item>
113+
/// <item>
114+
/// <term>Resource</term>
115+
/// <description><see cref="DynatraceMonitorResource"/></description>
116+
/// </item>
117+
/// </list>
118+
/// </summary>
119+
/// <param name="cancellationToken"> The cancellation token to use. </param>
120+
/// <returns> An async collection of <see cref="DynatraceMonitoredResourceDetails"/> that may take multiple service requests to iterate over. </returns>
121+
// Add this custom code due to previous version didn't have request body parameter.
122+
[EditorBrowsable(EditorBrowsableState.Never)]
123+
public virtual AsyncPageable<DynatraceMonitoredResourceDetails> GetMonitoredResourcesAsync(CancellationToken cancellationToken)=> GetMonitoredResourcesAsync(null, cancellationToken);
124+
125+
/// <summary>
126+
/// List the resources currently being monitored by the Dynatrace monitor resource.
127+
/// <list type="bullet">
128+
/// <item>
129+
/// <term>Request Path</term>
130+
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/listMonitoredResources</description>
131+
/// </item>
132+
/// <item>
133+
/// <term>Operation Id</term>
134+
/// <description>Monitors_ListMonitoredResources</description>
135+
/// </item>
136+
/// <item>
137+
/// <term>Default Api Version</term>
138+
/// <description>2021-09-01</description>
139+
/// </item>
140+
/// <item>
141+
/// <term>Resource</term>
142+
/// <description><see cref="DynatraceMonitorResource"/></description>
143+
/// </item>
144+
/// </list>
145+
/// </summary>
146+
/// <param name="cancellationToken"> The cancellation token to use. </param>
147+
/// <returns> A collection of <see cref="DynatraceMonitoredResourceDetails"/> that may take multiple service requests to iterate over. </returns>
148+
// Add this custom code due to previous version didn't have request body parameter.
149+
[EditorBrowsable(EditorBrowsableState.Never)]
150+
public virtual Pageable<DynatraceMonitoredResourceDetails> GetMonitoredResources(CancellationToken cancellationToken)=> GetMonitoredResources(null, cancellationToken);
151+
}
152+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System.Collections.Generic;
7+
using System.ComponentModel;
8+
using Azure.ResourceManager.Dynatrace.Models;
9+
10+
namespace Azure.ResourceManager.Dynatrace
11+
{
12+
public partial class DynatraceTagRuleData
13+
{
14+
/// <summary> List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. </summary>
15+
// Add this property due to the previous swagger definition for MetricRules only had FilteringTags as a direct child property.
16+
[EditorBrowsable(EditorBrowsableState.Never)]
17+
public IList<DynatraceMonitorResourceFilteringTag> MetricRulesFilteringTags
18+
{
19+
get
20+
{
21+
if (MetricRules is null)
22+
MetricRules = new DynatraceMonitorResourceMetricRules();
23+
return MetricRules.FilteringTags;
24+
}
25+
}
26+
}
27+
}
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System;
7+
using System.ComponentModel;
8+
using System.Threading;
9+
using System.Threading.Tasks;
10+
using Azure.ResourceManager.Dynatrace.Models;
11+
12+
namespace Azure.ResourceManager.Dynatrace
13+
{
14+
// The Patch operation is removed in the swagger, we add it back for compatibility reason.
15+
public partial class DynatraceTagRuleResource
16+
{
17+
/// <summary>
18+
/// Update a TagRule
19+
/// <list type="bullet">
20+
/// <item>
21+
/// <term>Request Path</term>
22+
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}</description>
23+
/// </item>
24+
/// <item>
25+
/// <term>Operation Id</term>
26+
/// <description>TagRules_Update</description>
27+
/// </item>
28+
/// <item>
29+
/// <term>Default Api Version</term>
30+
/// <description>2021-09-01</description>
31+
/// </item>
32+
/// <item>
33+
/// <term>Resource</term>
34+
/// <description><see cref="DynatraceTagRuleResource"/></description>
35+
/// </item>
36+
/// </list>
37+
/// </summary>
38+
/// <param name="patch"> The resource properties to be updated. </param>
39+
/// <param name="cancellationToken"> The cancellation token to use. </param>
40+
/// <exception cref="ArgumentNullException"> <paramref name="patch"/> is null. </exception>
41+
[EditorBrowsable(EditorBrowsableState.Never)]
42+
public virtual async Task<Response<DynatraceTagRuleResource>> UpdateAsync(DynatraceTagRulePatch patch, CancellationToken cancellationToken = default)
43+
{
44+
Argument.AssertNotNull(patch, nameof(patch));
45+
46+
var data = new DynatraceTagRuleData()
47+
{
48+
LogRules = patch.LogRules,
49+
MetricRules = patch.MetricRules
50+
};
51+
52+
using var scope = _dynatraceTagRuleTagRulesClientDiagnostics.CreateScope("DynatraceTagRuleResource.UpdateAsync");
53+
scope.Start();
54+
try
55+
{
56+
var operation = await UpdateAsync(WaitUntil.Completed, data, cancellationToken).ConfigureAwait(false);
57+
return Response.FromValue(operation.Value, operation.GetRawResponse());
58+
}
59+
catch (Exception e)
60+
{
61+
scope.Failed(e);
62+
throw;
63+
}
64+
}
65+
66+
/// <summary>
67+
/// Update a TagRule
68+
/// <list type="bullet">
69+
/// <item>
70+
/// <term>Request Path</term>
71+
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Dynatrace.Observability/monitors/{monitorName}/tagRules/{ruleSetName}</description>
72+
/// </item>
73+
/// <item>
74+
/// <term>Operation Id</term>
75+
/// <description>TagRules_Update</description>
76+
/// </item>
77+
/// <item>
78+
/// <term>Default Api Version</term>
79+
/// <description>2021-09-01</description>
80+
/// </item>
81+
/// <item>
82+
/// <term>Resource</term>
83+
/// <description><see cref="DynatraceTagRuleResource"/></description>
84+
/// </item>
85+
/// </list>
86+
/// </summary>
87+
/// <param name="patch"> The resource properties to be updated. </param>
88+
/// <param name="cancellationToken"> The cancellation token to use. </param>
89+
/// <exception cref="ArgumentNullException"> <paramref name="patch"/> is null. </exception>
90+
[EditorBrowsable(EditorBrowsableState.Never)]
91+
public virtual Response<DynatraceTagRuleResource> Update(DynatraceTagRulePatch patch, CancellationToken cancellationToken = default)
92+
{
93+
Argument.AssertNotNull(patch, nameof(patch));
94+
95+
var data = new DynatraceTagRuleData()
96+
{
97+
LogRules = patch.LogRules,
98+
MetricRules = patch.MetricRules
99+
};
100+
101+
using var scope = _dynatraceTagRuleTagRulesClientDiagnostics.CreateScope("DynatraceTagRuleResource.UpdateAsync");
102+
scope.Start();
103+
try
104+
{
105+
var operation = Update(WaitUntil.Completed, data, cancellationToken);
106+
return Response.FromValue(operation.Value, operation.GetRawResponse());
107+
}
108+
catch (Exception e)
109+
{
110+
scope.Failed(e);
111+
throw;
112+
}
113+
}
114+
}
115+
}

0 commit comments

Comments
 (0)