Skip to content

Commit 02bed37

Browse files
authored
TrafficManager New API 2022-04-01-preview with Track1 SDK (#20426)
* Migration to Track2 SDK. * Updated README to generate code as per .NET SDK track2. Updated project file accordingly. * Used directives as per .NET and generated code again. * Add always serve flag in the Endpoint cmdlet. * Generate help document. * Re-recording all the tests.
1 parent 756a039 commit 02bed37

File tree

127 files changed

+18084
-13667
lines changed

Some content is hidden

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

127 files changed

+18084
-13667
lines changed

src/TrafficManager/TrafficManager.Management.Sdk/Generated/EndpointsOperations.cs

Lines changed: 1040 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
// <auto-generated>
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
// Licensed under the MIT License. See License.txt in the project root for
4+
// license information.
5+
//
6+
// Code generated by Microsoft (R) AutoRest Code Generator.
7+
// Changes may cause incorrect behavior and will be lost if the code is
8+
// regenerated.
9+
// </auto-generated>
10+
11+
namespace Microsoft.Azure.Management.TrafficManager
12+
{
13+
using Microsoft.Rest;
14+
using Microsoft.Rest.Azure;
15+
using Models;
16+
using System.Threading;
17+
using System.Threading.Tasks;
18+
19+
/// <summary>
20+
/// Extension methods for EndpointsOperations.
21+
/// </summary>
22+
public static partial class EndpointsOperationsExtensions
23+
{
24+
/// <summary>
25+
/// Update a Traffic Manager endpoint.
26+
/// </summary>
27+
/// <param name='operations'>
28+
/// The operations group for this extension method.
29+
/// </param>
30+
/// <param name='resourceGroupName'>
31+
/// The name of the resource group. The name is case insensitive.
32+
/// </param>
33+
/// <param name='profileName'>
34+
/// The name of the Traffic Manager profile.
35+
/// </param>
36+
/// <param name='endpointType'>
37+
/// The type of the Traffic Manager endpoint to be updated. Only
38+
/// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
39+
/// </param>
40+
/// <param name='endpointName'>
41+
/// The name of the Traffic Manager endpoint to be updated.
42+
/// </param>
43+
/// <param name='parameters'>
44+
/// The Traffic Manager endpoint parameters supplied to the Update operation.
45+
/// </param>
46+
public static Endpoint Update(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters)
47+
{
48+
return operations.UpdateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).GetAwaiter().GetResult();
49+
}
50+
51+
/// <summary>
52+
/// Update a Traffic Manager endpoint.
53+
/// </summary>
54+
/// <param name='operations'>
55+
/// The operations group for this extension method.
56+
/// </param>
57+
/// <param name='resourceGroupName'>
58+
/// The name of the resource group. The name is case insensitive.
59+
/// </param>
60+
/// <param name='profileName'>
61+
/// The name of the Traffic Manager profile.
62+
/// </param>
63+
/// <param name='endpointType'>
64+
/// The type of the Traffic Manager endpoint to be updated. Only
65+
/// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
66+
/// </param>
67+
/// <param name='endpointName'>
68+
/// The name of the Traffic Manager endpoint to be updated.
69+
/// </param>
70+
/// <param name='parameters'>
71+
/// The Traffic Manager endpoint parameters supplied to the Update operation.
72+
/// </param>
73+
/// <param name='cancellationToken'>
74+
/// The cancellation token.
75+
/// </param>
76+
public static async Task<Endpoint> UpdateAsync(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters, CancellationToken cancellationToken = default(CancellationToken))
77+
{
78+
using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, profileName, endpointType, endpointName, parameters, null, cancellationToken).ConfigureAwait(false))
79+
{
80+
return _result.Body;
81+
}
82+
}
83+
84+
/// <summary>
85+
/// Gets a Traffic Manager endpoint.
86+
/// </summary>
87+
/// <param name='operations'>
88+
/// The operations group for this extension method.
89+
/// </param>
90+
/// <param name='resourceGroupName'>
91+
/// The name of the resource group. The name is case insensitive.
92+
/// </param>
93+
/// <param name='profileName'>
94+
/// The name of the Traffic Manager profile.
95+
/// </param>
96+
/// <param name='endpointType'>
97+
/// The type of the Traffic Manager endpoint. Only AzureEndpoints,
98+
/// ExternalEndpoints and NestedEndpoints are allowed here.
99+
/// </param>
100+
/// <param name='endpointName'>
101+
/// The name of the Traffic Manager endpoint.
102+
/// </param>
103+
public static Endpoint Get(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName)
104+
{
105+
return operations.GetAsync(resourceGroupName, profileName, endpointType, endpointName).GetAwaiter().GetResult();
106+
}
107+
108+
/// <summary>
109+
/// Gets a Traffic Manager endpoint.
110+
/// </summary>
111+
/// <param name='operations'>
112+
/// The operations group for this extension method.
113+
/// </param>
114+
/// <param name='resourceGroupName'>
115+
/// The name of the resource group. The name is case insensitive.
116+
/// </param>
117+
/// <param name='profileName'>
118+
/// The name of the Traffic Manager profile.
119+
/// </param>
120+
/// <param name='endpointType'>
121+
/// The type of the Traffic Manager endpoint. Only AzureEndpoints,
122+
/// ExternalEndpoints and NestedEndpoints are allowed here.
123+
/// </param>
124+
/// <param name='endpointName'>
125+
/// The name of the Traffic Manager endpoint.
126+
/// </param>
127+
/// <param name='cancellationToken'>
128+
/// The cancellation token.
129+
/// </param>
130+
public static async Task<Endpoint> GetAsync(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, CancellationToken cancellationToken = default(CancellationToken))
131+
{
132+
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, profileName, endpointType, endpointName, null, cancellationToken).ConfigureAwait(false))
133+
{
134+
return _result.Body;
135+
}
136+
}
137+
138+
/// <summary>
139+
/// Create or update a Traffic Manager endpoint.
140+
/// </summary>
141+
/// <param name='operations'>
142+
/// The operations group for this extension method.
143+
/// </param>
144+
/// <param name='resourceGroupName'>
145+
/// The name of the resource group. The name is case insensitive.
146+
/// </param>
147+
/// <param name='profileName'>
148+
/// The name of the Traffic Manager profile.
149+
/// </param>
150+
/// <param name='endpointType'>
151+
/// The type of the Traffic Manager endpoint to be created or updated. Only
152+
/// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
153+
/// </param>
154+
/// <param name='endpointName'>
155+
/// The name of the Traffic Manager endpoint to be created or updated.
156+
/// </param>
157+
/// <param name='parameters'>
158+
/// The Traffic Manager endpoint parameters supplied to the CreateOrUpdate
159+
/// operation.
160+
/// </param>
161+
public static Endpoint CreateOrUpdate(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters)
162+
{
163+
return operations.CreateOrUpdateAsync(resourceGroupName, profileName, endpointType, endpointName, parameters).GetAwaiter().GetResult();
164+
}
165+
166+
/// <summary>
167+
/// Create or update a Traffic Manager endpoint.
168+
/// </summary>
169+
/// <param name='operations'>
170+
/// The operations group for this extension method.
171+
/// </param>
172+
/// <param name='resourceGroupName'>
173+
/// The name of the resource group. The name is case insensitive.
174+
/// </param>
175+
/// <param name='profileName'>
176+
/// The name of the Traffic Manager profile.
177+
/// </param>
178+
/// <param name='endpointType'>
179+
/// The type of the Traffic Manager endpoint to be created or updated. Only
180+
/// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
181+
/// </param>
182+
/// <param name='endpointName'>
183+
/// The name of the Traffic Manager endpoint to be created or updated.
184+
/// </param>
185+
/// <param name='parameters'>
186+
/// The Traffic Manager endpoint parameters supplied to the CreateOrUpdate
187+
/// operation.
188+
/// </param>
189+
/// <param name='cancellationToken'>
190+
/// The cancellation token.
191+
/// </param>
192+
public static async Task<Endpoint> CreateOrUpdateAsync(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, Endpoint parameters, CancellationToken cancellationToken = default(CancellationToken))
193+
{
194+
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, profileName, endpointType, endpointName, parameters, null, cancellationToken).ConfigureAwait(false))
195+
{
196+
return _result.Body;
197+
}
198+
}
199+
200+
/// <summary>
201+
/// Deletes a Traffic Manager endpoint.
202+
/// </summary>
203+
/// <param name='operations'>
204+
/// The operations group for this extension method.
205+
/// </param>
206+
/// <param name='resourceGroupName'>
207+
/// The name of the resource group. The name is case insensitive.
208+
/// </param>
209+
/// <param name='profileName'>
210+
/// The name of the Traffic Manager profile.
211+
/// </param>
212+
/// <param name='endpointType'>
213+
/// The type of the Traffic Manager endpoint to be deleted. Only
214+
/// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
215+
/// </param>
216+
/// <param name='endpointName'>
217+
/// The name of the Traffic Manager endpoint to be deleted.
218+
/// </param>
219+
public static void Delete(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName)
220+
{
221+
operations.DeleteAsync(resourceGroupName, profileName, endpointType, endpointName).GetAwaiter().GetResult();
222+
}
223+
224+
/// <summary>
225+
/// Deletes a Traffic Manager endpoint.
226+
/// </summary>
227+
/// <param name='operations'>
228+
/// The operations group for this extension method.
229+
/// </param>
230+
/// <param name='resourceGroupName'>
231+
/// The name of the resource group. The name is case insensitive.
232+
/// </param>
233+
/// <param name='profileName'>
234+
/// The name of the Traffic Manager profile.
235+
/// </param>
236+
/// <param name='endpointType'>
237+
/// The type of the Traffic Manager endpoint to be deleted. Only
238+
/// AzureEndpoints, ExternalEndpoints and NestedEndpoints are allowed here.
239+
/// </param>
240+
/// <param name='endpointName'>
241+
/// The name of the Traffic Manager endpoint to be deleted.
242+
/// </param>
243+
/// <param name='cancellationToken'>
244+
/// The cancellation token.
245+
/// </param>
246+
public static async Task DeleteAsync(this IEndpointsOperations operations, string resourceGroupName, string profileName, string endpointType, string endpointName, CancellationToken cancellationToken = default(CancellationToken))
247+
{
248+
(await operations.DeleteWithHttpMessagesAsync(resourceGroupName, profileName, endpointType, endpointName, null, cancellationToken).ConfigureAwait(false)).Dispose();
249+
}
250+
251+
}
252+
}

0 commit comments

Comments
 (0)