-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
HybridContainerServiceExtensions.cs
389 lines (353 loc) · 24.7 KB
/
HybridContainerServiceExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.HybridContainerService.Mocking;
using Azure.ResourceManager.Resources;
namespace Azure.ResourceManager.HybridContainerService
{
/// <summary> A class to add extension methods to Azure.ResourceManager.HybridContainerService. </summary>
public static partial class HybridContainerServiceExtensions
{
private static MockableHybridContainerServiceArmClient GetMockableHybridContainerServiceArmClient(ArmClient client)
{
return client.GetCachedClient(client0 => new MockableHybridContainerServiceArmClient(client0));
}
private static MockableHybridContainerServiceResourceGroupResource GetMockableHybridContainerServiceResourceGroupResource(ArmResource resource)
{
return resource.GetCachedClient(client => new MockableHybridContainerServiceResourceGroupResource(client, resource.Id));
}
private static MockableHybridContainerServiceSubscriptionResource GetMockableHybridContainerServiceSubscriptionResource(ArmResource resource)
{
return resource.GetCachedClient(client => new MockableHybridContainerServiceSubscriptionResource(client, resource.Id));
}
/// <summary>
/// Gets an object representing a ProvisionedClusterResource along with the instance operations that can be performed on it in the ArmClient.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetProvisionedCluster(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="ProvisionedClusterResource"/> object. </returns>
public static ProvisionedClusterResource GetProvisionedCluster(this ArmClient client, ResourceIdentifier scope)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetProvisionedCluster(scope);
}
/// <summary>
/// Gets an object representing a KubernetesVersionProfileResource along with the instance operations that can be performed on it in the ArmClient.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetKubernetesVersionProfile(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="KubernetesVersionProfileResource"/> object. </returns>
public static KubernetesVersionProfileResource GetKubernetesVersionProfile(this ArmClient client, ResourceIdentifier scope)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetKubernetesVersionProfile(scope);
}
/// <summary>
/// Gets an object representing a HybridContainerServiceVmSkuResource along with the instance operations that can be performed on it in the ArmClient.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetHybridContainerServiceVmSku(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="scope"> The scope that the resource will apply against. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="HybridContainerServiceVmSkuResource"/> object. </returns>
public static HybridContainerServiceVmSkuResource GetHybridContainerServiceVmSku(this ArmClient client, ResourceIdentifier scope)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetHybridContainerServiceVmSku(scope);
}
/// <summary>
/// Gets an object representing a <see cref="ProvisionedClusterResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="ProvisionedClusterResource.CreateResourceIdentifier" /> to create a <see cref="ProvisionedClusterResource" /> <see cref="ResourceIdentifier" /> from its components.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetProvisionedClusterResource(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="ProvisionedClusterResource"/> object. </returns>
public static ProvisionedClusterResource GetProvisionedClusterResource(this ArmClient client, ResourceIdentifier id)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetProvisionedClusterResource(id);
}
/// <summary>
/// Gets an object representing a <see cref="ProvisionedClusterUpgradeProfileResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="ProvisionedClusterUpgradeProfileResource.CreateResourceIdentifier" /> to create a <see cref="ProvisionedClusterUpgradeProfileResource" /> <see cref="ResourceIdentifier" /> from its components.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetProvisionedClusterUpgradeProfileResource(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="ProvisionedClusterUpgradeProfileResource"/> object. </returns>
public static ProvisionedClusterUpgradeProfileResource GetProvisionedClusterUpgradeProfileResource(this ArmClient client, ResourceIdentifier id)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetProvisionedClusterUpgradeProfileResource(id);
}
/// <summary>
/// Gets an object representing a <see cref="HybridIdentityMetadataResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridIdentityMetadataResource.CreateResourceIdentifier" /> to create a <see cref="HybridIdentityMetadataResource" /> <see cref="ResourceIdentifier" /> from its components.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetHybridIdentityMetadataResource(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="HybridIdentityMetadataResource"/> object. </returns>
public static HybridIdentityMetadataResource GetHybridIdentityMetadataResource(this ArmClient client, ResourceIdentifier id)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetHybridIdentityMetadataResource(id);
}
/// <summary>
/// Gets an object representing a <see cref="HybridContainerServiceAgentPoolResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridContainerServiceAgentPoolResource.CreateResourceIdentifier" /> to create a <see cref="HybridContainerServiceAgentPoolResource" /> <see cref="ResourceIdentifier" /> from its components.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetHybridContainerServiceAgentPoolResource(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="HybridContainerServiceAgentPoolResource"/> object. </returns>
public static HybridContainerServiceAgentPoolResource GetHybridContainerServiceAgentPoolResource(this ArmClient client, ResourceIdentifier id)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetHybridContainerServiceAgentPoolResource(id);
}
/// <summary>
/// Gets an object representing a <see cref="KubernetesVersionProfileResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="KubernetesVersionProfileResource.CreateResourceIdentifier" /> to create a <see cref="KubernetesVersionProfileResource" /> <see cref="ResourceIdentifier" /> from its components.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetKubernetesVersionProfileResource(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="KubernetesVersionProfileResource"/> object. </returns>
public static KubernetesVersionProfileResource GetKubernetesVersionProfileResource(this ArmClient client, ResourceIdentifier id)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetKubernetesVersionProfileResource(id);
}
/// <summary>
/// Gets an object representing a <see cref="HybridContainerServiceVmSkuResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridContainerServiceVmSkuResource.CreateResourceIdentifier" /> to create a <see cref="HybridContainerServiceVmSkuResource" /> <see cref="ResourceIdentifier" /> from its components.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetHybridContainerServiceVmSkuResource(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="HybridContainerServiceVmSkuResource"/> object. </returns>
public static HybridContainerServiceVmSkuResource GetHybridContainerServiceVmSkuResource(this ArmClient client, ResourceIdentifier id)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetHybridContainerServiceVmSkuResource(id);
}
/// <summary>
/// Gets an object representing a <see cref="HybridContainerServiceVirtualNetworkResource" /> along with the instance operations that can be performed on it but with no data.
/// You can use <see cref="HybridContainerServiceVirtualNetworkResource.CreateResourceIdentifier" /> to create a <see cref="HybridContainerServiceVirtualNetworkResource" /> <see cref="ResourceIdentifier" /> from its components.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceArmClient.GetHybridContainerServiceVirtualNetworkResource(ResourceIdentifier)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="client"> The <see cref="ArmClient" /> instance the method will execute against. </param>
/// <param name="id"> The resource ID of the resource to get. </param>
/// <exception cref="ArgumentNullException"> <paramref name="client"/> is null. </exception>
/// <returns> Returns a <see cref="HybridContainerServiceVirtualNetworkResource"/> object. </returns>
public static HybridContainerServiceVirtualNetworkResource GetHybridContainerServiceVirtualNetworkResource(this ArmClient client, ResourceIdentifier id)
{
Argument.AssertNotNull(client, nameof(client));
return GetMockableHybridContainerServiceArmClient(client).GetHybridContainerServiceVirtualNetworkResource(id);
}
/// <summary>
/// Gets a collection of HybridContainerServiceVirtualNetworkResources in the ResourceGroupResource.
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceResourceGroupResource.GetHybridContainerServiceVirtualNetworks()"/> instead.</description>
/// </item>
/// </summary>
/// <param name="resourceGroupResource"> The <see cref="ResourceGroupResource" /> instance the method will execute against. </param>
/// <exception cref="ArgumentNullException"> <paramref name="resourceGroupResource"/> is null. </exception>
/// <returns> An object representing collection of HybridContainerServiceVirtualNetworkResources and their operations over a HybridContainerServiceVirtualNetworkResource. </returns>
public static HybridContainerServiceVirtualNetworkCollection GetHybridContainerServiceVirtualNetworks(this ResourceGroupResource resourceGroupResource)
{
Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
return GetMockableHybridContainerServiceResourceGroupResource(resourceGroupResource).GetHybridContainerServiceVirtualNetworks();
}
/// <summary>
/// Gets the specified virtual network resource
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks/{virtualNetworkName}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>virtualNetworks_Retrieve</description>
/// </item>
/// <item>
/// <term>Default Api Version</term>
/// <description>2024-01-01</description>
/// </item>
/// <item>
/// <term>Resource</term>
/// <description><see cref="HybridContainerServiceVirtualNetworkResource"/></description>
/// </item>
/// </list>
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceResourceGroupResource.GetHybridContainerServiceVirtualNetworkAsync(string,CancellationToken)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="resourceGroupResource"> The <see cref="ResourceGroupResource" /> instance the method will execute against. </param>
/// <param name="virtualNetworkName"> Parameter for the name of the virtual network. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="resourceGroupResource"/> or <paramref name="virtualNetworkName"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="virtualNetworkName"/> is an empty string, and was expected to be non-empty. </exception>
[ForwardsClientCalls]
public static async Task<Response<HybridContainerServiceVirtualNetworkResource>> GetHybridContainerServiceVirtualNetworkAsync(this ResourceGroupResource resourceGroupResource, string virtualNetworkName, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
return await GetMockableHybridContainerServiceResourceGroupResource(resourceGroupResource).GetHybridContainerServiceVirtualNetworkAsync(virtualNetworkName, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// Gets the specified virtual network resource
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridContainerService/virtualNetworks/{virtualNetworkName}</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>virtualNetworks_Retrieve</description>
/// </item>
/// <item>
/// <term>Default Api Version</term>
/// <description>2024-01-01</description>
/// </item>
/// <item>
/// <term>Resource</term>
/// <description><see cref="HybridContainerServiceVirtualNetworkResource"/></description>
/// </item>
/// </list>
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceResourceGroupResource.GetHybridContainerServiceVirtualNetwork(string,CancellationToken)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="resourceGroupResource"> The <see cref="ResourceGroupResource" /> instance the method will execute against. </param>
/// <param name="virtualNetworkName"> Parameter for the name of the virtual network. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="resourceGroupResource"/> or <paramref name="virtualNetworkName"/> is null. </exception>
/// <exception cref="ArgumentException"> <paramref name="virtualNetworkName"/> is an empty string, and was expected to be non-empty. </exception>
[ForwardsClientCalls]
public static Response<HybridContainerServiceVirtualNetworkResource> GetHybridContainerServiceVirtualNetwork(this ResourceGroupResource resourceGroupResource, string virtualNetworkName, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
return GetMockableHybridContainerServiceResourceGroupResource(resourceGroupResource).GetHybridContainerServiceVirtualNetwork(virtualNetworkName, cancellationToken);
}
/// <summary>
/// Lists the virtual networks in the specified subscription
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/providers/Microsoft.HybridContainerService/virtualNetworks</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>virtualNetworks_ListBySubscription</description>
/// </item>
/// <item>
/// <term>Default Api Version</term>
/// <description>2024-01-01</description>
/// </item>
/// <item>
/// <term>Resource</term>
/// <description><see cref="HybridContainerServiceVirtualNetworkResource"/></description>
/// </item>
/// </list>
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceSubscriptionResource.GetHybridContainerServiceVirtualNetworks(CancellationToken)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="subscriptionResource"> The <see cref="SubscriptionResource" /> instance the method will execute against. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="subscriptionResource"/> is null. </exception>
/// <returns> An async collection of <see cref="HybridContainerServiceVirtualNetworkResource"/> that may take multiple service requests to iterate over. </returns>
public static AsyncPageable<HybridContainerServiceVirtualNetworkResource> GetHybridContainerServiceVirtualNetworksAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
return GetMockableHybridContainerServiceSubscriptionResource(subscriptionResource).GetHybridContainerServiceVirtualNetworksAsync(cancellationToken);
}
/// <summary>
/// Lists the virtual networks in the specified subscription
/// <list type="bullet">
/// <item>
/// <term>Request Path</term>
/// <description>/subscriptions/{subscriptionId}/providers/Microsoft.HybridContainerService/virtualNetworks</description>
/// </item>
/// <item>
/// <term>Operation Id</term>
/// <description>virtualNetworks_ListBySubscription</description>
/// </item>
/// <item>
/// <term>Default Api Version</term>
/// <description>2024-01-01</description>
/// </item>
/// <item>
/// <term>Resource</term>
/// <description><see cref="HybridContainerServiceVirtualNetworkResource"/></description>
/// </item>
/// </list>
/// <item>
/// <term>Mocking</term>
/// <description>To mock this method, please mock <see cref="MockableHybridContainerServiceSubscriptionResource.GetHybridContainerServiceVirtualNetworks(CancellationToken)"/> instead.</description>
/// </item>
/// </summary>
/// <param name="subscriptionResource"> The <see cref="SubscriptionResource" /> instance the method will execute against. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <exception cref="ArgumentNullException"> <paramref name="subscriptionResource"/> is null. </exception>
/// <returns> A collection of <see cref="HybridContainerServiceVirtualNetworkResource"/> that may take multiple service requests to iterate over. </returns>
public static Pageable<HybridContainerServiceVirtualNetworkResource> GetHybridContainerServiceVirtualNetworks(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
{
Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
return GetMockableHybridContainerServiceSubscriptionResource(subscriptionResource).GetHybridContainerServiceVirtualNetworks(cancellationToken);
}
}
}