Skip to content

Commit 2f37c47

Browse files
vcanaaJasonYang-MSFT
authored andcommitted
[Monitor] Diagnostic settings commands (Azure#3668)
* Generated code from latest spec * Updated tests for named diagnostic settings * [Monitor] Increasing version to 0.17.0-preview * [Monitor] Adding release notes and syncing with latest spec * Adding notes about the multi-dim metrics API to the changelog.md file. * [Monitor] Using an aka.ms link for the changelog
1 parent 6a98991 commit 2f37c47

24 files changed

+1491
-638
lines changed

src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/DiagnosticSettingsCategoryOperations.cs

Lines changed: 414 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
//
5+
// Code generated by Microsoft (R) AutoRest Code Generator.
6+
// Changes may cause incorrect behavior and will be lost if the code is
7+
// regenerated.
8+
9+
namespace Microsoft.Azure.Management.Monitor.Management
10+
{
11+
using Microsoft.Azure;
12+
using Microsoft.Azure.Management;
13+
using Microsoft.Azure.Management.Monitor;
14+
using Microsoft.Rest;
15+
using Microsoft.Rest.Azure;
16+
using Models;
17+
using System.Threading;
18+
using System.Threading.Tasks;
19+
20+
/// <summary>
21+
/// Extension methods for DiagnosticSettingsCategoryOperations.
22+
/// </summary>
23+
public static partial class DiagnosticSettingsCategoryOperationsExtensions
24+
{
25+
/// <summary>
26+
/// Gets the diagnostic settings category for the specified resource.
27+
/// </summary>
28+
/// <param name='operations'>
29+
/// The operations group for this extension method.
30+
/// </param>
31+
/// <param name='resourceUri'>
32+
/// The identifier of the resource.
33+
/// </param>
34+
/// <param name='name'>
35+
/// The name of the diagnostic setting.
36+
/// </param>
37+
public static DiagnosticSettingsCategoryResource Get(this IDiagnosticSettingsCategoryOperations operations, string resourceUri, string name)
38+
{
39+
return operations.GetAsync(resourceUri, name).GetAwaiter().GetResult();
40+
}
41+
42+
/// <summary>
43+
/// Gets the diagnostic settings category for the specified resource.
44+
/// </summary>
45+
/// <param name='operations'>
46+
/// The operations group for this extension method.
47+
/// </param>
48+
/// <param name='resourceUri'>
49+
/// The identifier of the resource.
50+
/// </param>
51+
/// <param name='name'>
52+
/// The name of the diagnostic setting.
53+
/// </param>
54+
/// <param name='cancellationToken'>
55+
/// The cancellation token.
56+
/// </param>
57+
public static async Task<DiagnosticSettingsCategoryResource> GetAsync(this IDiagnosticSettingsCategoryOperations operations, string resourceUri, string name, CancellationToken cancellationToken = default(CancellationToken))
58+
{
59+
using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, name, null, cancellationToken).ConfigureAwait(false))
60+
{
61+
return _result.Body;
62+
}
63+
}
64+
65+
/// <summary>
66+
/// Lists the diagnostic settings categories for the specified resource.
67+
/// </summary>
68+
/// <param name='operations'>
69+
/// The operations group for this extension method.
70+
/// </param>
71+
/// <param name='resourceUri'>
72+
/// The identifier of the resource.
73+
/// </param>
74+
public static DiagnosticSettingsCategoryResourceCollection List(this IDiagnosticSettingsCategoryOperations operations, string resourceUri)
75+
{
76+
return operations.ListAsync(resourceUri).GetAwaiter().GetResult();
77+
}
78+
79+
/// <summary>
80+
/// Lists the diagnostic settings categories for the specified resource.
81+
/// </summary>
82+
/// <param name='operations'>
83+
/// The operations group for this extension method.
84+
/// </param>
85+
/// <param name='resourceUri'>
86+
/// The identifier of the resource.
87+
/// </param>
88+
/// <param name='cancellationToken'>
89+
/// The cancellation token.
90+
/// </param>
91+
public static async Task<DiagnosticSettingsCategoryResourceCollection> ListAsync(this IDiagnosticSettingsCategoryOperations operations, string resourceUri, CancellationToken cancellationToken = default(CancellationToken))
92+
{
93+
using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, null, cancellationToken).ConfigureAwait(false))
94+
{
95+
return _result.Body;
96+
}
97+
}
98+
99+
}
100+
}

src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs renamed to src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/DiagnosticSettingsOperations.cs

Lines changed: 205 additions & 47 deletions
Large diffs are not rendered by default.
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
//
5+
// Code generated by Microsoft (R) AutoRest Code Generator.
6+
// Changes may cause incorrect behavior and will be lost if the code is
7+
// regenerated.
8+
9+
namespace Microsoft.Azure.Management.Monitor.Management
10+
{
11+
using Microsoft.Azure;
12+
using Microsoft.Azure.Management;
13+
using Microsoft.Azure.Management.Monitor;
14+
using Microsoft.Rest;
15+
using Microsoft.Rest.Azure;
16+
using Models;
17+
using System.Threading;
18+
using System.Threading.Tasks;
19+
20+
/// <summary>
21+
/// Extension methods for DiagnosticSettingsOperations.
22+
/// </summary>
23+
public static partial class DiagnosticSettingsOperationsExtensions
24+
{
25+
/// <summary>
26+
/// Gets the active diagnostic settings for the specified resource.
27+
/// </summary>
28+
/// <param name='operations'>
29+
/// The operations group for this extension method.
30+
/// </param>
31+
/// <param name='resourceUri'>
32+
/// The identifier of the resource.
33+
/// </param>
34+
/// <param name='name'>
35+
/// The name of the diagnostic setting.
36+
/// </param>
37+
public static DiagnosticSettingsResource Get(this IDiagnosticSettingsOperations operations, string resourceUri, string name)
38+
{
39+
return operations.GetAsync(resourceUri, name).GetAwaiter().GetResult();
40+
}
41+
42+
/// <summary>
43+
/// Gets the active diagnostic settings for the specified resource.
44+
/// </summary>
45+
/// <param name='operations'>
46+
/// The operations group for this extension method.
47+
/// </param>
48+
/// <param name='resourceUri'>
49+
/// The identifier of the resource.
50+
/// </param>
51+
/// <param name='name'>
52+
/// The name of the diagnostic setting.
53+
/// </param>
54+
/// <param name='cancellationToken'>
55+
/// The cancellation token.
56+
/// </param>
57+
public static async Task<DiagnosticSettingsResource> GetAsync(this IDiagnosticSettingsOperations operations, string resourceUri, string name, CancellationToken cancellationToken = default(CancellationToken))
58+
{
59+
using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, name, null, cancellationToken).ConfigureAwait(false))
60+
{
61+
return _result.Body;
62+
}
63+
}
64+
65+
/// <summary>
66+
/// Creates or updates diagnostic settings for the specified resource.
67+
/// </summary>
68+
/// <param name='operations'>
69+
/// The operations group for this extension method.
70+
/// </param>
71+
/// <param name='resourceUri'>
72+
/// The identifier of the resource.
73+
/// </param>
74+
/// <param name='parameters'>
75+
/// Parameters supplied to the operation.
76+
/// </param>
77+
/// <param name='name'>
78+
/// The name of the diagnostic setting.
79+
/// </param>
80+
public static DiagnosticSettingsResource CreateOrUpdate(this IDiagnosticSettingsOperations operations, string resourceUri, DiagnosticSettingsResource parameters, string name)
81+
{
82+
return operations.CreateOrUpdateAsync(resourceUri, parameters, name).GetAwaiter().GetResult();
83+
}
84+
85+
/// <summary>
86+
/// Creates or updates diagnostic settings for the specified resource.
87+
/// </summary>
88+
/// <param name='operations'>
89+
/// The operations group for this extension method.
90+
/// </param>
91+
/// <param name='resourceUri'>
92+
/// The identifier of the resource.
93+
/// </param>
94+
/// <param name='parameters'>
95+
/// Parameters supplied to the operation.
96+
/// </param>
97+
/// <param name='name'>
98+
/// The name of the diagnostic setting.
99+
/// </param>
100+
/// <param name='cancellationToken'>
101+
/// The cancellation token.
102+
/// </param>
103+
public static async Task<DiagnosticSettingsResource> CreateOrUpdateAsync(this IDiagnosticSettingsOperations operations, string resourceUri, DiagnosticSettingsResource parameters, string name, CancellationToken cancellationToken = default(CancellationToken))
104+
{
105+
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceUri, parameters, name, null, cancellationToken).ConfigureAwait(false))
106+
{
107+
return _result.Body;
108+
}
109+
}
110+
111+
/// <summary>
112+
/// Deletes existing diagnostic settings for the specified resource.
113+
/// </summary>
114+
/// <param name='operations'>
115+
/// The operations group for this extension method.
116+
/// </param>
117+
/// <param name='resourceUri'>
118+
/// The identifier of the resource.
119+
/// </param>
120+
/// <param name='name'>
121+
/// The name of the diagnostic setting.
122+
/// </param>
123+
public static void Delete(this IDiagnosticSettingsOperations operations, string resourceUri, string name)
124+
{
125+
operations.DeleteAsync(resourceUri, name).GetAwaiter().GetResult();
126+
}
127+
128+
/// <summary>
129+
/// Deletes existing diagnostic settings for the specified resource.
130+
/// </summary>
131+
/// <param name='operations'>
132+
/// The operations group for this extension method.
133+
/// </param>
134+
/// <param name='resourceUri'>
135+
/// The identifier of the resource.
136+
/// </param>
137+
/// <param name='name'>
138+
/// The name of the diagnostic setting.
139+
/// </param>
140+
/// <param name='cancellationToken'>
141+
/// The cancellation token.
142+
/// </param>
143+
public static async Task DeleteAsync(this IDiagnosticSettingsOperations operations, string resourceUri, string name, CancellationToken cancellationToken = default(CancellationToken))
144+
{
145+
(await operations.DeleteWithHttpMessagesAsync(resourceUri, name, null, cancellationToken).ConfigureAwait(false)).Dispose();
146+
}
147+
148+
/// <summary>
149+
/// Gets the active diagnostic settings list for the specified resource.
150+
/// </summary>
151+
/// <param name='operations'>
152+
/// The operations group for this extension method.
153+
/// </param>
154+
/// <param name='resourceUri'>
155+
/// The identifier of the resource.
156+
/// </param>
157+
public static DiagnosticSettingsResourceCollection List(this IDiagnosticSettingsOperations operations, string resourceUri)
158+
{
159+
return operations.ListAsync(resourceUri).GetAwaiter().GetResult();
160+
}
161+
162+
/// <summary>
163+
/// Gets the active diagnostic settings list for the specified resource.
164+
/// </summary>
165+
/// <param name='operations'>
166+
/// The operations group for this extension method.
167+
/// </param>
168+
/// <param name='resourceUri'>
169+
/// The identifier of the resource.
170+
/// </param>
171+
/// <param name='cancellationToken'>
172+
/// The cancellation token.
173+
/// </param>
174+
public static async Task<DiagnosticSettingsResourceCollection> ListAsync(this IDiagnosticSettingsOperations operations, string resourceUri, CancellationToken cancellationToken = default(CancellationToken))
175+
{
176+
using (var _result = await operations.ListWithHttpMessagesAsync(resourceUri, null, cancellationToken).ConfigureAwait(false))
177+
{
178+
return _result.Body;
179+
}
180+
}
181+
182+
}
183+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
//
5+
// Code generated by Microsoft (R) AutoRest Code Generator.
6+
// Changes may cause incorrect behavior and will be lost if the code is
7+
// regenerated.
8+
9+
namespace Microsoft.Azure.Management.Monitor.Management
10+
{
11+
using Microsoft.Azure;
12+
using Microsoft.Azure.Management;
13+
using Microsoft.Azure.Management.Monitor;
14+
using Microsoft.Rest;
15+
using Microsoft.Rest.Azure;
16+
using Models;
17+
using System.Collections;
18+
using System.Collections.Generic;
19+
using System.Threading;
20+
using System.Threading.Tasks;
21+
22+
/// <summary>
23+
/// DiagnosticSettingsCategoryOperations operations.
24+
/// </summary>
25+
public partial interface IDiagnosticSettingsCategoryOperations
26+
{
27+
/// <summary>
28+
/// Gets the diagnostic settings category for the specified resource.
29+
/// </summary>
30+
/// <param name='resourceUri'>
31+
/// The identifier of the resource.
32+
/// </param>
33+
/// <param name='name'>
34+
/// The name of the diagnostic setting.
35+
/// </param>
36+
/// <param name='customHeaders'>
37+
/// The headers that will be added to request.
38+
/// </param>
39+
/// <param name='cancellationToken'>
40+
/// The cancellation token.
41+
/// </param>
42+
/// <exception cref="ErrorResponseException">
43+
/// Thrown when the operation returned an invalid status code
44+
/// </exception>
45+
/// <exception cref="Microsoft.Rest.SerializationException">
46+
/// Thrown when unable to deserialize the response
47+
/// </exception>
48+
/// <exception cref="Microsoft.Rest.ValidationException">
49+
/// Thrown when a required parameter is null
50+
/// </exception>
51+
Task<AzureOperationResponse<DiagnosticSettingsCategoryResource>> GetWithHttpMessagesAsync(string resourceUri, string name, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
52+
/// <summary>
53+
/// Lists the diagnostic settings categories for the specified
54+
/// resource.
55+
/// </summary>
56+
/// <param name='resourceUri'>
57+
/// The identifier of the resource.
58+
/// </param>
59+
/// <param name='customHeaders'>
60+
/// The headers that will be added to request.
61+
/// </param>
62+
/// <param name='cancellationToken'>
63+
/// The cancellation token.
64+
/// </param>
65+
/// <exception cref="ErrorResponseException">
66+
/// Thrown when the operation returned an invalid status code
67+
/// </exception>
68+
/// <exception cref="Microsoft.Rest.SerializationException">
69+
/// Thrown when unable to deserialize the response
70+
/// </exception>
71+
/// <exception cref="Microsoft.Rest.ValidationException">
72+
/// Thrown when a required parameter is null
73+
/// </exception>
74+
Task<AzureOperationResponse<DiagnosticSettingsCategoryResourceCollection>> ListWithHttpMessagesAsync(string resourceUri, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
75+
}
76+
}

0 commit comments

Comments
 (0)