| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Threading; |
| | 10 | | using System.Threading.Tasks; |
| | 11 | | using Azure; |
| | 12 | | using Azure.Core; |
| | 13 | | using Azure.Core.Pipeline; |
| | 14 | | using Azure.ResourceManager.Compute.Models; |
| | 15 | |
|
| | 16 | | namespace Azure.ResourceManager.Compute |
| | 17 | | { |
| | 18 | | /// <summary> The VirtualMachineScaleSets service client. </summary> |
| | 19 | | public partial class VirtualMachineScaleSetsOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 1196 | 23 | | internal VirtualMachineScaleSetsRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of VirtualMachineScaleSetsOperations for mocking. </summary> |
| 396 | 25 | | protected VirtualMachineScaleSetsOperations() |
| | 26 | | { |
| 396 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of VirtualMachineScaleSetsOperations. </summary> |
| | 29 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 30 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 31 | | /// <param name="subscriptionId"> Subscription credentials which uniquely identify Microsoft Azure subscription. |
| | 32 | | /// <param name="endpoint"> server parameter. </param> |
| 396 | 33 | | internal VirtualMachineScaleSetsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string su |
| | 34 | | { |
| 396 | 35 | | RestClient = new VirtualMachineScaleSetsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint |
| 396 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 396 | 37 | | _pipeline = pipeline; |
| 396 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Display information about a virtual machine scale set. </summary> |
| | 41 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 42 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 43 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 44 | | public virtual async Task<Response<VirtualMachineScaleSet>> GetAsync(string resourceGroupName, string vmScaleSet |
| | 45 | | { |
| 110 | 46 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.Get"); |
| 110 | 47 | | scope.Start(); |
| | 48 | | try |
| | 49 | | { |
| 110 | 50 | | return await RestClient.GetAsync(resourceGroupName, vmScaleSetName, cancellationToken).ConfigureAwait(fa |
| | 51 | | } |
| 0 | 52 | | catch (Exception e) |
| | 53 | | { |
| 0 | 54 | | scope.Failed(e); |
| 0 | 55 | | throw; |
| | 56 | | } |
| 110 | 57 | | } |
| | 58 | |
|
| | 59 | | /// <summary> Display information about a virtual machine scale set. </summary> |
| | 60 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 61 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 62 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 63 | | public virtual Response<VirtualMachineScaleSet> Get(string resourceGroupName, string vmScaleSetName, Cancellatio |
| | 64 | | { |
| 110 | 65 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.Get"); |
| 110 | 66 | | scope.Start(); |
| | 67 | | try |
| | 68 | | { |
| 110 | 69 | | return RestClient.Get(resourceGroupName, vmScaleSetName, cancellationToken); |
| | 70 | | } |
| 0 | 71 | | catch (Exception e) |
| | 72 | | { |
| 0 | 73 | | scope.Failed(e); |
| 0 | 74 | | throw; |
| | 75 | | } |
| 110 | 76 | | } |
| | 77 | |
|
| | 78 | | /// <summary> Gets the status of a VM scale set instance. </summary> |
| | 79 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 80 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 81 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 82 | | public virtual async Task<Response<VirtualMachineScaleSetInstanceView>> GetInstanceViewAsync(string resourceGrou |
| | 83 | | { |
| 30 | 84 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.GetInstanceView"); |
| 30 | 85 | | scope.Start(); |
| | 86 | | try |
| | 87 | | { |
| 30 | 88 | | return await RestClient.GetInstanceViewAsync(resourceGroupName, vmScaleSetName, cancellationToken).Confi |
| | 89 | | } |
| 0 | 90 | | catch (Exception e) |
| | 91 | | { |
| 0 | 92 | | scope.Failed(e); |
| 0 | 93 | | throw; |
| | 94 | | } |
| 30 | 95 | | } |
| | 96 | |
|
| | 97 | | /// <summary> Gets the status of a VM scale set instance. </summary> |
| | 98 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 99 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 100 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 101 | | public virtual Response<VirtualMachineScaleSetInstanceView> GetInstanceView(string resourceGroupName, string vmS |
| | 102 | | { |
| 30 | 103 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.GetInstanceView"); |
| 30 | 104 | | scope.Start(); |
| | 105 | | try |
| | 106 | | { |
| 30 | 107 | | return RestClient.GetInstanceView(resourceGroupName, vmScaleSetName, cancellationToken); |
| | 108 | | } |
| 0 | 109 | | catch (Exception e) |
| | 110 | | { |
| 0 | 111 | | scope.Failed(e); |
| 0 | 112 | | throw; |
| | 113 | | } |
| 30 | 114 | | } |
| | 115 | |
|
| | 116 | | /// <summary> Manual platform update domain walk to update virtual machines in a service fabric virtual machine |
| | 117 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 118 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 119 | | /// <param name="platformUpdateDomain"> The platform update domain for which a manual recovery walk is requested |
| | 120 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 121 | | public virtual async Task<Response<RecoveryWalkResponse>> ForceRecoveryServiceFabricPlatformUpdateDomainWalkAsyn |
| | 122 | | { |
| 0 | 123 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ForceRecoveryServiceFabr |
| 0 | 124 | | scope.Start(); |
| | 125 | | try |
| | 126 | | { |
| 0 | 127 | | return await RestClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalkAsync(resourceGroupName, vmSca |
| | 128 | | } |
| 0 | 129 | | catch (Exception e) |
| | 130 | | { |
| 0 | 131 | | scope.Failed(e); |
| 0 | 132 | | throw; |
| | 133 | | } |
| 0 | 134 | | } |
| | 135 | |
|
| | 136 | | /// <summary> Manual platform update domain walk to update virtual machines in a service fabric virtual machine |
| | 137 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 138 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 139 | | /// <param name="platformUpdateDomain"> The platform update domain for which a manual recovery walk is requested |
| | 140 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 141 | | public virtual Response<RecoveryWalkResponse> ForceRecoveryServiceFabricPlatformUpdateDomainWalk(string resource |
| | 142 | | { |
| 0 | 143 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ForceRecoveryServiceFabr |
| 0 | 144 | | scope.Start(); |
| | 145 | | try |
| | 146 | | { |
| 0 | 147 | | return RestClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk(resourceGroupName, vmScaleSetName, |
| | 148 | | } |
| 0 | 149 | | catch (Exception e) |
| | 150 | | { |
| 0 | 151 | | scope.Failed(e); |
| 0 | 152 | | throw; |
| | 153 | | } |
| 0 | 154 | | } |
| | 155 | |
|
| | 156 | | /// <summary> Converts SinglePlacementGroup property to false for a existing virtual machine scale set. </summar |
| | 157 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 158 | | /// <param name="vmScaleSetName"> The name of the virtual machine scale set to create or update. </param> |
| | 159 | | /// <param name="parameters"> The input object for ConvertToSinglePlacementGroup API. </param> |
| | 160 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 161 | | public virtual async Task<Response> ConvertToSinglePlacementGroupAsync(string resourceGroupName, string vmScaleS |
| | 162 | | { |
| 0 | 163 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ConvertToSinglePlacement |
| 0 | 164 | | scope.Start(); |
| | 165 | | try |
| | 166 | | { |
| 0 | 167 | | return await RestClient.ConvertToSinglePlacementGroupAsync(resourceGroupName, vmScaleSetName, parameters |
| | 168 | | } |
| 0 | 169 | | catch (Exception e) |
| | 170 | | { |
| 0 | 171 | | scope.Failed(e); |
| 0 | 172 | | throw; |
| | 173 | | } |
| 0 | 174 | | } |
| | 175 | |
|
| | 176 | | /// <summary> Converts SinglePlacementGroup property to false for a existing virtual machine scale set. </summar |
| | 177 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 178 | | /// <param name="vmScaleSetName"> The name of the virtual machine scale set to create or update. </param> |
| | 179 | | /// <param name="parameters"> The input object for ConvertToSinglePlacementGroup API. </param> |
| | 180 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 181 | | public virtual Response ConvertToSinglePlacementGroup(string resourceGroupName, string vmScaleSetName, VMScaleSe |
| | 182 | | { |
| 0 | 183 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ConvertToSinglePlacement |
| 0 | 184 | | scope.Start(); |
| | 185 | | try |
| | 186 | | { |
| 0 | 187 | | return RestClient.ConvertToSinglePlacementGroup(resourceGroupName, vmScaleSetName, parameters, cancellat |
| | 188 | | } |
| 0 | 189 | | catch (Exception e) |
| | 190 | | { |
| 0 | 191 | | scope.Failed(e); |
| 0 | 192 | | throw; |
| | 193 | | } |
| 0 | 194 | | } |
| | 195 | |
|
| | 196 | | /// <summary> Gets a list of all VM scale sets under a resource group. </summary> |
| | 197 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 198 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 199 | | public virtual AsyncPageable<VirtualMachineScaleSet> ListAsync(string resourceGroupName, CancellationToken cance |
| | 200 | | { |
| 24 | 201 | | if (resourceGroupName == null) |
| | 202 | | { |
| 0 | 203 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 204 | | } |
| | 205 | |
|
| | 206 | | async Task<Page<VirtualMachineScaleSet>> FirstPageFunc(int? pageSizeHint) |
| | 207 | | { |
| 24 | 208 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.List"); |
| 24 | 209 | | scope.Start(); |
| | 210 | | try |
| | 211 | | { |
| 24 | 212 | | var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false |
| 24 | 213 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 214 | | } |
| 0 | 215 | | catch (Exception e) |
| | 216 | | { |
| 0 | 217 | | scope.Failed(e); |
| 0 | 218 | | throw; |
| | 219 | | } |
| 24 | 220 | | } |
| | 221 | | async Task<Page<VirtualMachineScaleSet>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 222 | | { |
| 0 | 223 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.List"); |
| 0 | 224 | | scope.Start(); |
| | 225 | | try |
| | 226 | | { |
| 0 | 227 | | var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co |
| 0 | 228 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 229 | | } |
| 0 | 230 | | catch (Exception e) |
| | 231 | | { |
| 0 | 232 | | scope.Failed(e); |
| 0 | 233 | | throw; |
| | 234 | | } |
| 0 | 235 | | } |
| 24 | 236 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 237 | | } |
| | 238 | |
|
| | 239 | | /// <summary> Gets a list of all VM scale sets under a resource group. </summary> |
| | 240 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 241 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 242 | | public virtual Pageable<VirtualMachineScaleSet> List(string resourceGroupName, CancellationToken cancellationTok |
| | 243 | | { |
| 24 | 244 | | if (resourceGroupName == null) |
| | 245 | | { |
| 0 | 246 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 247 | | } |
| | 248 | |
|
| | 249 | | Page<VirtualMachineScaleSet> FirstPageFunc(int? pageSizeHint) |
| | 250 | | { |
| 24 | 251 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.List"); |
| 24 | 252 | | scope.Start(); |
| | 253 | | try |
| | 254 | | { |
| 24 | 255 | | var response = RestClient.List(resourceGroupName, cancellationToken); |
| 24 | 256 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 257 | | } |
| 0 | 258 | | catch (Exception e) |
| | 259 | | { |
| 0 | 260 | | scope.Failed(e); |
| 0 | 261 | | throw; |
| | 262 | | } |
| 24 | 263 | | } |
| | 264 | | Page<VirtualMachineScaleSet> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 265 | | { |
| 0 | 266 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.List"); |
| 0 | 267 | | scope.Start(); |
| | 268 | | try |
| | 269 | | { |
| 0 | 270 | | var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken); |
| 0 | 271 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 272 | | } |
| 0 | 273 | | catch (Exception e) |
| | 274 | | { |
| 0 | 275 | | scope.Failed(e); |
| 0 | 276 | | throw; |
| | 277 | | } |
| 0 | 278 | | } |
| 24 | 279 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 280 | | } |
| | 281 | |
|
| | 282 | | /// <summary> Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. |
| | 283 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 284 | | public virtual AsyncPageable<VirtualMachineScaleSet> ListAllAsync(CancellationToken cancellationToken = default) |
| | 285 | | { |
| | 286 | | async Task<Page<VirtualMachineScaleSet>> FirstPageFunc(int? pageSizeHint) |
| | 287 | | { |
| 0 | 288 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ListAll"); |
| 0 | 289 | | scope.Start(); |
| | 290 | | try |
| | 291 | | { |
| 0 | 292 | | var response = await RestClient.ListAllAsync(cancellationToken).ConfigureAwait(false); |
| 0 | 293 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 294 | | } |
| 0 | 295 | | catch (Exception e) |
| | 296 | | { |
| 0 | 297 | | scope.Failed(e); |
| 0 | 298 | | throw; |
| | 299 | | } |
| 0 | 300 | | } |
| | 301 | | async Task<Page<VirtualMachineScaleSet>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 302 | | { |
| 0 | 303 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ListAll"); |
| 0 | 304 | | scope.Start(); |
| | 305 | | try |
| | 306 | | { |
| 0 | 307 | | var response = await RestClient.ListAllNextPageAsync(nextLink, cancellationToken).ConfigureAwait(fal |
| 0 | 308 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 309 | | } |
| 0 | 310 | | catch (Exception e) |
| | 311 | | { |
| 0 | 312 | | scope.Failed(e); |
| 0 | 313 | | throw; |
| | 314 | | } |
| 0 | 315 | | } |
| 0 | 316 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 317 | | } |
| | 318 | |
|
| | 319 | | /// <summary> Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. |
| | 320 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 321 | | public virtual Pageable<VirtualMachineScaleSet> ListAll(CancellationToken cancellationToken = default) |
| | 322 | | { |
| | 323 | | Page<VirtualMachineScaleSet> FirstPageFunc(int? pageSizeHint) |
| | 324 | | { |
| 0 | 325 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ListAll"); |
| 0 | 326 | | scope.Start(); |
| | 327 | | try |
| | 328 | | { |
| 0 | 329 | | var response = RestClient.ListAll(cancellationToken); |
| 0 | 330 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 331 | | } |
| 0 | 332 | | catch (Exception e) |
| | 333 | | { |
| 0 | 334 | | scope.Failed(e); |
| 0 | 335 | | throw; |
| | 336 | | } |
| 0 | 337 | | } |
| | 338 | | Page<VirtualMachineScaleSet> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 339 | | { |
| 0 | 340 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ListAll"); |
| 0 | 341 | | scope.Start(); |
| | 342 | | try |
| | 343 | | { |
| 0 | 344 | | var response = RestClient.ListAllNextPage(nextLink, cancellationToken); |
| 0 | 345 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 346 | | } |
| 0 | 347 | | catch (Exception e) |
| | 348 | | { |
| 0 | 349 | | scope.Failed(e); |
| 0 | 350 | | throw; |
| | 351 | | } |
| 0 | 352 | | } |
| 0 | 353 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 354 | | } |
| | 355 | |
|
| | 356 | | /// <summary> Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instance |
| | 357 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 358 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 359 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 360 | | public virtual AsyncPageable<VirtualMachineScaleSetSku> ListSkusAsync(string resourceGroupName, string vmScaleSe |
| | 361 | | { |
| 24 | 362 | | if (resourceGroupName == null) |
| | 363 | | { |
| 0 | 364 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 365 | | } |
| 24 | 366 | | if (vmScaleSetName == null) |
| | 367 | | { |
| 0 | 368 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 369 | | } |
| | 370 | |
|
| | 371 | | async Task<Page<VirtualMachineScaleSetSku>> FirstPageFunc(int? pageSizeHint) |
| | 372 | | { |
| 24 | 373 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ListSkus"); |
| 24 | 374 | | scope.Start(); |
| | 375 | | try |
| | 376 | | { |
| 24 | 377 | | var response = await RestClient.ListSkusAsync(resourceGroupName, vmScaleSetName, cancellationToken). |
| 24 | 378 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 379 | | } |
| 0 | 380 | | catch (Exception e) |
| | 381 | | { |
| 0 | 382 | | scope.Failed(e); |
| 0 | 383 | | throw; |
| | 384 | | } |
| 24 | 385 | | } |
| | 386 | | async Task<Page<VirtualMachineScaleSetSku>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 387 | | { |
| 0 | 388 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ListSkus"); |
| 0 | 389 | | scope.Start(); |
| | 390 | | try |
| | 391 | | { |
| 0 | 392 | | var response = await RestClient.ListSkusNextPageAsync(nextLink, resourceGroupName, vmScaleSetName, c |
| 0 | 393 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 394 | | } |
| 0 | 395 | | catch (Exception e) |
| | 396 | | { |
| 0 | 397 | | scope.Failed(e); |
| 0 | 398 | | throw; |
| | 399 | | } |
| 0 | 400 | | } |
| 24 | 401 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 402 | | } |
| | 403 | |
|
| | 404 | | /// <summary> Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instance |
| | 405 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 406 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 407 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 408 | | public virtual Pageable<VirtualMachineScaleSetSku> ListSkus(string resourceGroupName, string vmScaleSetName, Can |
| | 409 | | { |
| 24 | 410 | | if (resourceGroupName == null) |
| | 411 | | { |
| 0 | 412 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 413 | | } |
| 24 | 414 | | if (vmScaleSetName == null) |
| | 415 | | { |
| 0 | 416 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 417 | | } |
| | 418 | |
|
| | 419 | | Page<VirtualMachineScaleSetSku> FirstPageFunc(int? pageSizeHint) |
| | 420 | | { |
| 24 | 421 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ListSkus"); |
| 24 | 422 | | scope.Start(); |
| | 423 | | try |
| | 424 | | { |
| 24 | 425 | | var response = RestClient.ListSkus(resourceGroupName, vmScaleSetName, cancellationToken); |
| 24 | 426 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 427 | | } |
| 0 | 428 | | catch (Exception e) |
| | 429 | | { |
| 0 | 430 | | scope.Failed(e); |
| 0 | 431 | | throw; |
| | 432 | | } |
| 24 | 433 | | } |
| | 434 | | Page<VirtualMachineScaleSetSku> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 435 | | { |
| 0 | 436 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.ListSkus"); |
| 0 | 437 | | scope.Start(); |
| | 438 | | try |
| | 439 | | { |
| 0 | 440 | | var response = RestClient.ListSkusNextPage(nextLink, resourceGroupName, vmScaleSetName, cancellation |
| 0 | 441 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 442 | | } |
| 0 | 443 | | catch (Exception e) |
| | 444 | | { |
| 0 | 445 | | scope.Failed(e); |
| 0 | 446 | | throw; |
| | 447 | | } |
| 0 | 448 | | } |
| 24 | 449 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 450 | | } |
| | 451 | |
|
| | 452 | | /// <summary> Gets list of OS upgrades on a VM scale set instance. </summary> |
| | 453 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 454 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 455 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 456 | | public virtual AsyncPageable<UpgradeOperationHistoricalStatusInfo> GetOSUpgradeHistoryAsync(string resourceGroup |
| | 457 | | { |
| 0 | 458 | | if (resourceGroupName == null) |
| | 459 | | { |
| 0 | 460 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 461 | | } |
| 0 | 462 | | if (vmScaleSetName == null) |
| | 463 | | { |
| 0 | 464 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 465 | | } |
| | 466 | |
|
| | 467 | | async Task<Page<UpgradeOperationHistoricalStatusInfo>> FirstPageFunc(int? pageSizeHint) |
| | 468 | | { |
| 0 | 469 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.GetOSUpgradeHistory" |
| 0 | 470 | | scope.Start(); |
| | 471 | | try |
| | 472 | | { |
| 0 | 473 | | var response = await RestClient.GetOSUpgradeHistoryAsync(resourceGroupName, vmScaleSetName, cancella |
| 0 | 474 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 475 | | } |
| 0 | 476 | | catch (Exception e) |
| | 477 | | { |
| 0 | 478 | | scope.Failed(e); |
| 0 | 479 | | throw; |
| | 480 | | } |
| 0 | 481 | | } |
| | 482 | | async Task<Page<UpgradeOperationHistoricalStatusInfo>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 483 | | { |
| 0 | 484 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.GetOSUpgradeHistory" |
| 0 | 485 | | scope.Start(); |
| | 486 | | try |
| | 487 | | { |
| 0 | 488 | | var response = await RestClient.GetOSUpgradeHistoryNextPageAsync(nextLink, resourceGroupName, vmScal |
| 0 | 489 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 490 | | } |
| 0 | 491 | | catch (Exception e) |
| | 492 | | { |
| 0 | 493 | | scope.Failed(e); |
| 0 | 494 | | throw; |
| | 495 | | } |
| 0 | 496 | | } |
| 0 | 497 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 498 | | } |
| | 499 | |
|
| | 500 | | /// <summary> Gets list of OS upgrades on a VM scale set instance. </summary> |
| | 501 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 502 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 503 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 504 | | public virtual Pageable<UpgradeOperationHistoricalStatusInfo> GetOSUpgradeHistory(string resourceGroupName, stri |
| | 505 | | { |
| 0 | 506 | | if (resourceGroupName == null) |
| | 507 | | { |
| 0 | 508 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 509 | | } |
| 0 | 510 | | if (vmScaleSetName == null) |
| | 511 | | { |
| 0 | 512 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 513 | | } |
| | 514 | |
|
| | 515 | | Page<UpgradeOperationHistoricalStatusInfo> FirstPageFunc(int? pageSizeHint) |
| | 516 | | { |
| 0 | 517 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.GetOSUpgradeHistory" |
| 0 | 518 | | scope.Start(); |
| | 519 | | try |
| | 520 | | { |
| 0 | 521 | | var response = RestClient.GetOSUpgradeHistory(resourceGroupName, vmScaleSetName, cancellationToken); |
| 0 | 522 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 523 | | } |
| 0 | 524 | | catch (Exception e) |
| | 525 | | { |
| 0 | 526 | | scope.Failed(e); |
| 0 | 527 | | throw; |
| | 528 | | } |
| 0 | 529 | | } |
| | 530 | | Page<UpgradeOperationHistoricalStatusInfo> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 531 | | { |
| 0 | 532 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.GetOSUpgradeHistory" |
| 0 | 533 | | scope.Start(); |
| | 534 | | try |
| | 535 | | { |
| 0 | 536 | | var response = RestClient.GetOSUpgradeHistoryNextPage(nextLink, resourceGroupName, vmScaleSetName, c |
| 0 | 537 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 538 | | } |
| 0 | 539 | | catch (Exception e) |
| | 540 | | { |
| 0 | 541 | | scope.Failed(e); |
| 0 | 542 | | throw; |
| | 543 | | } |
| 0 | 544 | | } |
| 0 | 545 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 546 | | } |
| | 547 | |
|
| | 548 | | /// <summary> Create or update a VM scale set. </summary> |
| | 549 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 550 | | /// <param name="vmScaleSetName"> The name of the VM scale set to create or update. </param> |
| | 551 | | /// <param name="parameters"> The scale set object. </param> |
| | 552 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 553 | | public virtual async Task<VirtualMachineScaleSetsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resour |
| | 554 | | { |
| 92 | 555 | | if (resourceGroupName == null) |
| | 556 | | { |
| 0 | 557 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 558 | | } |
| 92 | 559 | | if (vmScaleSetName == null) |
| | 560 | | { |
| 0 | 561 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 562 | | } |
| 92 | 563 | | if (parameters == null) |
| | 564 | | { |
| 0 | 565 | | throw new ArgumentNullException(nameof(parameters)); |
| | 566 | | } |
| | 567 | |
|
| 92 | 568 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartCreateOrUpdate"); |
| 92 | 569 | | scope.Start(); |
| | 570 | | try |
| | 571 | | { |
| 92 | 572 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameter |
| 90 | 573 | | return new VirtualMachineScaleSetsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Crea |
| | 574 | | } |
| 2 | 575 | | catch (Exception e) |
| | 576 | | { |
| 2 | 577 | | scope.Failed(e); |
| 2 | 578 | | throw; |
| | 579 | | } |
| 90 | 580 | | } |
| | 581 | |
|
| | 582 | | /// <summary> Create or update a VM scale set. </summary> |
| | 583 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 584 | | /// <param name="vmScaleSetName"> The name of the VM scale set to create or update. </param> |
| | 585 | | /// <param name="parameters"> The scale set object. </param> |
| | 586 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 587 | | public virtual VirtualMachineScaleSetsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, stri |
| | 588 | | { |
| 92 | 589 | | if (resourceGroupName == null) |
| | 590 | | { |
| 0 | 591 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 592 | | } |
| 92 | 593 | | if (vmScaleSetName == null) |
| | 594 | | { |
| 0 | 595 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 596 | | } |
| 92 | 597 | | if (parameters == null) |
| | 598 | | { |
| 0 | 599 | | throw new ArgumentNullException(nameof(parameters)); |
| | 600 | | } |
| | 601 | |
|
| 92 | 602 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartCreateOrUpdate"); |
| 92 | 603 | | scope.Start(); |
| | 604 | | try |
| | 605 | | { |
| 92 | 606 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, vmScaleSetName, parameters, cancella |
| 90 | 607 | | return new VirtualMachineScaleSetsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Crea |
| | 608 | | } |
| 2 | 609 | | catch (Exception e) |
| | 610 | | { |
| 2 | 611 | | scope.Failed(e); |
| 2 | 612 | | throw; |
| | 613 | | } |
| 90 | 614 | | } |
| | 615 | |
|
| | 616 | | /// <summary> Update a VM scale set. </summary> |
| | 617 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 618 | | /// <param name="vmScaleSetName"> The name of the VM scale set to create or update. </param> |
| | 619 | | /// <param name="parameters"> The scale set object. </param> |
| | 620 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 621 | | public virtual async Task<VirtualMachineScaleSetsUpdateOperation> StartUpdateAsync(string resourceGroupName, str |
| | 622 | | { |
| 0 | 623 | | if (resourceGroupName == null) |
| | 624 | | { |
| 0 | 625 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 626 | | } |
| 0 | 627 | | if (vmScaleSetName == null) |
| | 628 | | { |
| 0 | 629 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 630 | | } |
| 0 | 631 | | if (parameters == null) |
| | 632 | | { |
| 0 | 633 | | throw new ArgumentNullException(nameof(parameters)); |
| | 634 | | } |
| | 635 | |
|
| 0 | 636 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartUpdate"); |
| 0 | 637 | | scope.Start(); |
| | 638 | | try |
| | 639 | | { |
| 0 | 640 | | var originalResponse = await RestClient.UpdateAsync(resourceGroupName, vmScaleSetName, parameters, cance |
| 0 | 641 | | return new VirtualMachineScaleSetsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdate |
| | 642 | | } |
| 0 | 643 | | catch (Exception e) |
| | 644 | | { |
| 0 | 645 | | scope.Failed(e); |
| 0 | 646 | | throw; |
| | 647 | | } |
| 0 | 648 | | } |
| | 649 | |
|
| | 650 | | /// <summary> Update a VM scale set. </summary> |
| | 651 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 652 | | /// <param name="vmScaleSetName"> The name of the VM scale set to create or update. </param> |
| | 653 | | /// <param name="parameters"> The scale set object. </param> |
| | 654 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 655 | | public virtual VirtualMachineScaleSetsUpdateOperation StartUpdate(string resourceGroupName, string vmScaleSetNam |
| | 656 | | { |
| 0 | 657 | | if (resourceGroupName == null) |
| | 658 | | { |
| 0 | 659 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 660 | | } |
| 0 | 661 | | if (vmScaleSetName == null) |
| | 662 | | { |
| 0 | 663 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 664 | | } |
| 0 | 665 | | if (parameters == null) |
| | 666 | | { |
| 0 | 667 | | throw new ArgumentNullException(nameof(parameters)); |
| | 668 | | } |
| | 669 | |
|
| 0 | 670 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartUpdate"); |
| 0 | 671 | | scope.Start(); |
| | 672 | | try |
| | 673 | | { |
| 0 | 674 | | var originalResponse = RestClient.Update(resourceGroupName, vmScaleSetName, parameters, cancellationToke |
| 0 | 675 | | return new VirtualMachineScaleSetsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdate |
| | 676 | | } |
| 0 | 677 | | catch (Exception e) |
| | 678 | | { |
| 0 | 679 | | scope.Failed(e); |
| 0 | 680 | | throw; |
| | 681 | | } |
| 0 | 682 | | } |
| | 683 | |
|
| | 684 | | /// <summary> Deletes a VM scale set. </summary> |
| | 685 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 686 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 687 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 688 | | public virtual async Task<VirtualMachineScaleSetsDeleteOperation> StartDeleteAsync(string resourceGroupName, str |
| | 689 | | { |
| 62 | 690 | | if (resourceGroupName == null) |
| | 691 | | { |
| 0 | 692 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 693 | | } |
| 62 | 694 | | if (vmScaleSetName == null) |
| | 695 | | { |
| 0 | 696 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 697 | | } |
| | 698 | |
|
| 62 | 699 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartDelete"); |
| 62 | 700 | | scope.Start(); |
| | 701 | | try |
| | 702 | | { |
| 62 | 703 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, vmScaleSetName, cancellationToken |
| 62 | 704 | | return new VirtualMachineScaleSetsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelete |
| | 705 | | } |
| 0 | 706 | | catch (Exception e) |
| | 707 | | { |
| 0 | 708 | | scope.Failed(e); |
| 0 | 709 | | throw; |
| | 710 | | } |
| 62 | 711 | | } |
| | 712 | |
|
| | 713 | | /// <summary> Deletes a VM scale set. </summary> |
| | 714 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 715 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 716 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 717 | | public virtual VirtualMachineScaleSetsDeleteOperation StartDelete(string resourceGroupName, string vmScaleSetNam |
| | 718 | | { |
| 62 | 719 | | if (resourceGroupName == null) |
| | 720 | | { |
| 0 | 721 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 722 | | } |
| 62 | 723 | | if (vmScaleSetName == null) |
| | 724 | | { |
| 0 | 725 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 726 | | } |
| | 727 | |
|
| 62 | 728 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartDelete"); |
| 62 | 729 | | scope.Start(); |
| | 730 | | try |
| | 731 | | { |
| 62 | 732 | | var originalResponse = RestClient.Delete(resourceGroupName, vmScaleSetName, cancellationToken); |
| 62 | 733 | | return new VirtualMachineScaleSetsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelete |
| | 734 | | } |
| 0 | 735 | | catch (Exception e) |
| | 736 | | { |
| 0 | 737 | | scope.Failed(e); |
| 0 | 738 | | throw; |
| | 739 | | } |
| 62 | 740 | | } |
| | 741 | |
|
| | 742 | | /// <summary> Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and relea |
| | 743 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 744 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 745 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 746 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 747 | | public virtual async Task<VirtualMachineScaleSetsDeallocateOperation> StartDeallocateAsync(string resourceGroupN |
| | 748 | | { |
| 6 | 749 | | if (resourceGroupName == null) |
| | 750 | | { |
| 0 | 751 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 752 | | } |
| 6 | 753 | | if (vmScaleSetName == null) |
| | 754 | | { |
| 0 | 755 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 756 | | } |
| | 757 | |
|
| 6 | 758 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartDeallocate"); |
| 6 | 759 | | scope.Start(); |
| | 760 | | try |
| | 761 | | { |
| 6 | 762 | | var originalResponse = await RestClient.DeallocateAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs |
| 6 | 763 | | return new VirtualMachineScaleSetsDeallocateOperation(_clientDiagnostics, _pipeline, RestClient.CreateDe |
| | 764 | | } |
| 0 | 765 | | catch (Exception e) |
| | 766 | | { |
| 0 | 767 | | scope.Failed(e); |
| 0 | 768 | | throw; |
| | 769 | | } |
| 6 | 770 | | } |
| | 771 | |
|
| | 772 | | /// <summary> Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and relea |
| | 773 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 774 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 775 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 776 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 777 | | public virtual VirtualMachineScaleSetsDeallocateOperation StartDeallocate(string resourceGroupName, string vmSca |
| | 778 | | { |
| 6 | 779 | | if (resourceGroupName == null) |
| | 780 | | { |
| 0 | 781 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 782 | | } |
| 6 | 783 | | if (vmScaleSetName == null) |
| | 784 | | { |
| 0 | 785 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 786 | | } |
| | 787 | |
|
| 6 | 788 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartDeallocate"); |
| 6 | 789 | | scope.Start(); |
| | 790 | | try |
| | 791 | | { |
| 6 | 792 | | var originalResponse = RestClient.Deallocate(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancellat |
| 6 | 793 | | return new VirtualMachineScaleSetsDeallocateOperation(_clientDiagnostics, _pipeline, RestClient.CreateDe |
| | 794 | | } |
| 0 | 795 | | catch (Exception e) |
| | 796 | | { |
| 0 | 797 | | scope.Failed(e); |
| 0 | 798 | | throw; |
| | 799 | | } |
| 6 | 800 | | } |
| | 801 | |
|
| | 802 | | /// <summary> Deletes virtual machines in a VM scale set. </summary> |
| | 803 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 804 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 805 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 806 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 807 | | public virtual async Task<VirtualMachineScaleSetsDeleteInstancesOperation> StartDeleteInstancesAsync(string reso |
| | 808 | | { |
| 2 | 809 | | if (resourceGroupName == null) |
| | 810 | | { |
| 0 | 811 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 812 | | } |
| 2 | 813 | | if (vmScaleSetName == null) |
| | 814 | | { |
| 0 | 815 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 816 | | } |
| 2 | 817 | | if (vmInstanceIDs == null) |
| | 818 | | { |
| 0 | 819 | | throw new ArgumentNullException(nameof(vmInstanceIDs)); |
| | 820 | | } |
| | 821 | |
|
| 2 | 822 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartDeleteInstances"); |
| 2 | 823 | | scope.Start(); |
| | 824 | | try |
| | 825 | | { |
| 2 | 826 | | var originalResponse = await RestClient.DeleteInstancesAsync(resourceGroupName, vmScaleSetName, vmInstan |
| 2 | 827 | | return new VirtualMachineScaleSetsDeleteInstancesOperation(_clientDiagnostics, _pipeline, RestClient.Cre |
| | 828 | | } |
| 0 | 829 | | catch (Exception e) |
| | 830 | | { |
| 0 | 831 | | scope.Failed(e); |
| 0 | 832 | | throw; |
| | 833 | | } |
| 2 | 834 | | } |
| | 835 | |
|
| | 836 | | /// <summary> Deletes virtual machines in a VM scale set. </summary> |
| | 837 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 838 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 839 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 840 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 841 | | public virtual VirtualMachineScaleSetsDeleteInstancesOperation StartDeleteInstances(string resourceGroupName, st |
| | 842 | | { |
| 2 | 843 | | if (resourceGroupName == null) |
| | 844 | | { |
| 0 | 845 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 846 | | } |
| 2 | 847 | | if (vmScaleSetName == null) |
| | 848 | | { |
| 0 | 849 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 850 | | } |
| 2 | 851 | | if (vmInstanceIDs == null) |
| | 852 | | { |
| 0 | 853 | | throw new ArgumentNullException(nameof(vmInstanceIDs)); |
| | 854 | | } |
| | 855 | |
|
| 2 | 856 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartDeleteInstances"); |
| 2 | 857 | | scope.Start(); |
| | 858 | | try |
| | 859 | | { |
| 2 | 860 | | var originalResponse = RestClient.DeleteInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, canc |
| 2 | 861 | | return new VirtualMachineScaleSetsDeleteInstancesOperation(_clientDiagnostics, _pipeline, RestClient.Cre |
| | 862 | | } |
| 0 | 863 | | catch (Exception e) |
| | 864 | | { |
| 0 | 865 | | scope.Failed(e); |
| 0 | 866 | | throw; |
| | 867 | | } |
| 2 | 868 | | } |
| | 869 | |
|
| | 870 | | /// <summary> Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still att |
| | 871 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 872 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 873 | | /// <param name="skipShutdown"> The parameter to request non-graceful VM shutdown. True value for this flag indi |
| | 874 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 875 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 876 | | public virtual async Task<VirtualMachineScaleSetsPowerOffOperation> StartPowerOffAsync(string resourceGroupName, |
| | 877 | | { |
| 8 | 878 | | if (resourceGroupName == null) |
| | 879 | | { |
| 0 | 880 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 881 | | } |
| 8 | 882 | | if (vmScaleSetName == null) |
| | 883 | | { |
| 0 | 884 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 885 | | } |
| | 886 | |
|
| 8 | 887 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartPowerOff"); |
| 8 | 888 | | scope.Start(); |
| | 889 | | try |
| | 890 | | { |
| 8 | 891 | | var originalResponse = await RestClient.PowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, v |
| 8 | 892 | | return new VirtualMachineScaleSetsPowerOffOperation(_clientDiagnostics, _pipeline, RestClient.CreatePowe |
| | 893 | | } |
| 0 | 894 | | catch (Exception e) |
| | 895 | | { |
| 0 | 896 | | scope.Failed(e); |
| 0 | 897 | | throw; |
| | 898 | | } |
| 8 | 899 | | } |
| | 900 | |
|
| | 901 | | /// <summary> Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still att |
| | 902 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 903 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 904 | | /// <param name="skipShutdown"> The parameter to request non-graceful VM shutdown. True value for this flag indi |
| | 905 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 906 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 907 | | public virtual VirtualMachineScaleSetsPowerOffOperation StartPowerOff(string resourceGroupName, string vmScaleSe |
| | 908 | | { |
| 8 | 909 | | if (resourceGroupName == null) |
| | 910 | | { |
| 0 | 911 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 912 | | } |
| 8 | 913 | | if (vmScaleSetName == null) |
| | 914 | | { |
| 0 | 915 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 916 | | } |
| | 917 | |
|
| 8 | 918 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartPowerOff"); |
| 8 | 919 | | scope.Start(); |
| | 920 | | try |
| | 921 | | { |
| 8 | 922 | | var originalResponse = RestClient.PowerOff(resourceGroupName, vmScaleSetName, skipShutdown, vmInstanceID |
| 8 | 923 | | return new VirtualMachineScaleSetsPowerOffOperation(_clientDiagnostics, _pipeline, RestClient.CreatePowe |
| | 924 | | } |
| 0 | 925 | | catch (Exception e) |
| | 926 | | { |
| 0 | 927 | | scope.Failed(e); |
| 0 | 928 | | throw; |
| | 929 | | } |
| 8 | 930 | | } |
| | 931 | |
|
| | 932 | | /// <summary> Restarts one or more virtual machines in a VM scale set. </summary> |
| | 933 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 934 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 935 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 936 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 937 | | public virtual async Task<VirtualMachineScaleSetsRestartOperation> StartRestartAsync(string resourceGroupName, s |
| | 938 | | { |
| 6 | 939 | | if (resourceGroupName == null) |
| | 940 | | { |
| 0 | 941 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 942 | | } |
| 6 | 943 | | if (vmScaleSetName == null) |
| | 944 | | { |
| 0 | 945 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 946 | | } |
| | 947 | |
|
| 6 | 948 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartRestart"); |
| 6 | 949 | | scope.Start(); |
| | 950 | | try |
| | 951 | | { |
| 6 | 952 | | var originalResponse = await RestClient.RestartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, c |
| 6 | 953 | | return new VirtualMachineScaleSetsRestartOperation(_clientDiagnostics, _pipeline, RestClient.CreateResta |
| | 954 | | } |
| 0 | 955 | | catch (Exception e) |
| | 956 | | { |
| 0 | 957 | | scope.Failed(e); |
| 0 | 958 | | throw; |
| | 959 | | } |
| 6 | 960 | | } |
| | 961 | |
|
| | 962 | | /// <summary> Restarts one or more virtual machines in a VM scale set. </summary> |
| | 963 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 964 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 965 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 966 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 967 | | public virtual VirtualMachineScaleSetsRestartOperation StartRestart(string resourceGroupName, string vmScaleSetN |
| | 968 | | { |
| 6 | 969 | | if (resourceGroupName == null) |
| | 970 | | { |
| 0 | 971 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 972 | | } |
| 6 | 973 | | if (vmScaleSetName == null) |
| | 974 | | { |
| 0 | 975 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 976 | | } |
| | 977 | |
|
| 6 | 978 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartRestart"); |
| 6 | 979 | | scope.Start(); |
| | 980 | | try |
| | 981 | | { |
| 6 | 982 | | var originalResponse = RestClient.Restart(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancellation |
| 6 | 983 | | return new VirtualMachineScaleSetsRestartOperation(_clientDiagnostics, _pipeline, RestClient.CreateResta |
| | 984 | | } |
| 0 | 985 | | catch (Exception e) |
| | 986 | | { |
| 0 | 987 | | scope.Failed(e); |
| 0 | 988 | | throw; |
| | 989 | | } |
| 6 | 990 | | } |
| | 991 | |
|
| | 992 | | /// <summary> Starts one or more virtual machines in a VM scale set. </summary> |
| | 993 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 994 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 995 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 996 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 997 | | public virtual async Task<VirtualMachineScaleSetsStartOperation> StartStartAsync(string resourceGroupName, strin |
| | 998 | | { |
| 8 | 999 | | if (resourceGroupName == null) |
| | 1000 | | { |
| 0 | 1001 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1002 | | } |
| 8 | 1003 | | if (vmScaleSetName == null) |
| | 1004 | | { |
| 0 | 1005 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1006 | | } |
| | 1007 | |
|
| 8 | 1008 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartStart"); |
| 8 | 1009 | | scope.Start(); |
| | 1010 | | try |
| | 1011 | | { |
| 8 | 1012 | | var originalResponse = await RestClient.StartAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, can |
| 8 | 1013 | | return new VirtualMachineScaleSetsStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartRe |
| | 1014 | | } |
| 0 | 1015 | | catch (Exception e) |
| | 1016 | | { |
| 0 | 1017 | | scope.Failed(e); |
| 0 | 1018 | | throw; |
| | 1019 | | } |
| 8 | 1020 | | } |
| | 1021 | |
|
| | 1022 | | /// <summary> Starts one or more virtual machines in a VM scale set. </summary> |
| | 1023 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1024 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1025 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 1026 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1027 | | public virtual VirtualMachineScaleSetsStartOperation StartStart(string resourceGroupName, string vmScaleSetName, |
| | 1028 | | { |
| 8 | 1029 | | if (resourceGroupName == null) |
| | 1030 | | { |
| 0 | 1031 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1032 | | } |
| 8 | 1033 | | if (vmScaleSetName == null) |
| | 1034 | | { |
| 0 | 1035 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1036 | | } |
| | 1037 | |
|
| 8 | 1038 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartStart"); |
| 8 | 1039 | | scope.Start(); |
| | 1040 | | try |
| | 1041 | | { |
| 8 | 1042 | | var originalResponse = RestClient.Start(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancellationTo |
| 8 | 1043 | | return new VirtualMachineScaleSetsStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartRe |
| | 1044 | | } |
| 0 | 1045 | | catch (Exception e) |
| | 1046 | | { |
| 0 | 1047 | | scope.Failed(e); |
| 0 | 1048 | | throw; |
| | 1049 | | } |
| 8 | 1050 | | } |
| | 1051 | |
|
| | 1052 | | /// <summary> Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, an |
| | 1053 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1054 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1055 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 1056 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1057 | | public virtual async Task<VirtualMachineScaleSetsRedeployOperation> StartRedeployAsync(string resourceGroupName, |
| | 1058 | | { |
| 4 | 1059 | | if (resourceGroupName == null) |
| | 1060 | | { |
| 0 | 1061 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1062 | | } |
| 4 | 1063 | | if (vmScaleSetName == null) |
| | 1064 | | { |
| 0 | 1065 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1066 | | } |
| | 1067 | |
|
| 4 | 1068 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartRedeploy"); |
| 4 | 1069 | | scope.Start(); |
| | 1070 | | try |
| | 1071 | | { |
| 4 | 1072 | | var originalResponse = await RestClient.RedeployAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs, |
| 4 | 1073 | | return new VirtualMachineScaleSetsRedeployOperation(_clientDiagnostics, _pipeline, RestClient.CreateRede |
| | 1074 | | } |
| 0 | 1075 | | catch (Exception e) |
| | 1076 | | { |
| 0 | 1077 | | scope.Failed(e); |
| 0 | 1078 | | throw; |
| | 1079 | | } |
| 4 | 1080 | | } |
| | 1081 | |
|
| | 1082 | | /// <summary> Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, an |
| | 1083 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1084 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1085 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 1086 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1087 | | public virtual VirtualMachineScaleSetsRedeployOperation StartRedeploy(string resourceGroupName, string vmScaleSe |
| | 1088 | | { |
| 4 | 1089 | | if (resourceGroupName == null) |
| | 1090 | | { |
| 0 | 1091 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1092 | | } |
| 4 | 1093 | | if (vmScaleSetName == null) |
| | 1094 | | { |
| 0 | 1095 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1096 | | } |
| | 1097 | |
|
| 4 | 1098 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartRedeploy"); |
| 4 | 1099 | | scope.Start(); |
| | 1100 | | try |
| | 1101 | | { |
| 4 | 1102 | | var originalResponse = RestClient.Redeploy(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancellatio |
| 4 | 1103 | | return new VirtualMachineScaleSetsRedeployOperation(_clientDiagnostics, _pipeline, RestClient.CreateRede |
| | 1104 | | } |
| 0 | 1105 | | catch (Exception e) |
| | 1106 | | { |
| 0 | 1107 | | scope.Failed(e); |
| 0 | 1108 | | throw; |
| | 1109 | | } |
| 4 | 1110 | | } |
| | 1111 | |
|
| | 1112 | | /// <summary> Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances whic |
| | 1113 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1114 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1115 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 1116 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1117 | | public virtual async Task<VirtualMachineScaleSetsPerformMaintenanceOperation> StartPerformMaintenanceAsync(strin |
| | 1118 | | { |
| 4 | 1119 | | if (resourceGroupName == null) |
| | 1120 | | { |
| 0 | 1121 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1122 | | } |
| 4 | 1123 | | if (vmScaleSetName == null) |
| | 1124 | | { |
| 0 | 1125 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1126 | | } |
| | 1127 | |
|
| 4 | 1128 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartPerformMaintenance" |
| 4 | 1129 | | scope.Start(); |
| | 1130 | | try |
| | 1131 | | { |
| 4 | 1132 | | var originalResponse = await RestClient.PerformMaintenanceAsync(resourceGroupName, vmScaleSetName, vmIns |
| 0 | 1133 | | return new VirtualMachineScaleSetsPerformMaintenanceOperation(_clientDiagnostics, _pipeline, RestClient. |
| | 1134 | | } |
| 4 | 1135 | | catch (Exception e) |
| | 1136 | | { |
| 4 | 1137 | | scope.Failed(e); |
| 4 | 1138 | | throw; |
| | 1139 | | } |
| 0 | 1140 | | } |
| | 1141 | |
|
| | 1142 | | /// <summary> Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances whic |
| | 1143 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1144 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1145 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 1146 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1147 | | public virtual VirtualMachineScaleSetsPerformMaintenanceOperation StartPerformMaintenance(string resourceGroupNa |
| | 1148 | | { |
| 4 | 1149 | | if (resourceGroupName == null) |
| | 1150 | | { |
| 0 | 1151 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1152 | | } |
| 4 | 1153 | | if (vmScaleSetName == null) |
| | 1154 | | { |
| 0 | 1155 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1156 | | } |
| | 1157 | |
|
| 4 | 1158 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartPerformMaintenance" |
| 4 | 1159 | | scope.Start(); |
| | 1160 | | try |
| | 1161 | | { |
| 4 | 1162 | | var originalResponse = RestClient.PerformMaintenance(resourceGroupName, vmScaleSetName, vmInstanceIDs, c |
| 0 | 1163 | | return new VirtualMachineScaleSetsPerformMaintenanceOperation(_clientDiagnostics, _pipeline, RestClient. |
| | 1164 | | } |
| 4 | 1165 | | catch (Exception e) |
| | 1166 | | { |
| 4 | 1167 | | scope.Failed(e); |
| 4 | 1168 | | throw; |
| | 1169 | | } |
| 0 | 1170 | | } |
| | 1171 | |
|
| | 1172 | | /// <summary> Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. </summary> |
| | 1173 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1174 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1175 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 1176 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1177 | | public virtual async Task<VirtualMachineScaleSetsUpdateInstancesOperation> StartUpdateInstancesAsync(string reso |
| | 1178 | | { |
| 2 | 1179 | | if (resourceGroupName == null) |
| | 1180 | | { |
| 0 | 1181 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1182 | | } |
| 2 | 1183 | | if (vmScaleSetName == null) |
| | 1184 | | { |
| 0 | 1185 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1186 | | } |
| 2 | 1187 | | if (vmInstanceIDs == null) |
| | 1188 | | { |
| 0 | 1189 | | throw new ArgumentNullException(nameof(vmInstanceIDs)); |
| | 1190 | | } |
| | 1191 | |
|
| 2 | 1192 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartUpdateInstances"); |
| 2 | 1193 | | scope.Start(); |
| | 1194 | | try |
| | 1195 | | { |
| 2 | 1196 | | var originalResponse = await RestClient.UpdateInstancesAsync(resourceGroupName, vmScaleSetName, vmInstan |
| 2 | 1197 | | return new VirtualMachineScaleSetsUpdateInstancesOperation(_clientDiagnostics, _pipeline, RestClient.Cre |
| | 1198 | | } |
| 0 | 1199 | | catch (Exception e) |
| | 1200 | | { |
| 0 | 1201 | | scope.Failed(e); |
| 0 | 1202 | | throw; |
| | 1203 | | } |
| 2 | 1204 | | } |
| | 1205 | |
|
| | 1206 | | /// <summary> Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. </summary> |
| | 1207 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1208 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1209 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 1210 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1211 | | public virtual VirtualMachineScaleSetsUpdateInstancesOperation StartUpdateInstances(string resourceGroupName, st |
| | 1212 | | { |
| 2 | 1213 | | if (resourceGroupName == null) |
| | 1214 | | { |
| 0 | 1215 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1216 | | } |
| 2 | 1217 | | if (vmScaleSetName == null) |
| | 1218 | | { |
| 0 | 1219 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1220 | | } |
| 2 | 1221 | | if (vmInstanceIDs == null) |
| | 1222 | | { |
| 0 | 1223 | | throw new ArgumentNullException(nameof(vmInstanceIDs)); |
| | 1224 | | } |
| | 1225 | |
|
| 2 | 1226 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartUpdateInstances"); |
| 2 | 1227 | | scope.Start(); |
| | 1228 | | try |
| | 1229 | | { |
| 2 | 1230 | | var originalResponse = RestClient.UpdateInstances(resourceGroupName, vmScaleSetName, vmInstanceIDs, canc |
| 2 | 1231 | | return new VirtualMachineScaleSetsUpdateInstancesOperation(_clientDiagnostics, _pipeline, RestClient.Cre |
| | 1232 | | } |
| 0 | 1233 | | catch (Exception e) |
| | 1234 | | { |
| 0 | 1235 | | scope.Failed(e); |
| 0 | 1236 | | throw; |
| | 1237 | | } |
| 2 | 1238 | | } |
| | 1239 | |
|
| | 1240 | | /// <summary> Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don&a |
| | 1241 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1242 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1243 | | /// <param name="vmScaleSetReimageInput"> Parameters for Reimaging VM ScaleSet. </param> |
| | 1244 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1245 | | public virtual async Task<VirtualMachineScaleSetsReimageOperation> StartReimageAsync(string resourceGroupName, s |
| | 1246 | | { |
| 6 | 1247 | | if (resourceGroupName == null) |
| | 1248 | | { |
| 0 | 1249 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1250 | | } |
| 6 | 1251 | | if (vmScaleSetName == null) |
| | 1252 | | { |
| 0 | 1253 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1254 | | } |
| | 1255 | |
|
| 6 | 1256 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartReimage"); |
| 6 | 1257 | | scope.Start(); |
| | 1258 | | try |
| | 1259 | | { |
| 6 | 1260 | | var originalResponse = await RestClient.ReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimag |
| 6 | 1261 | | return new VirtualMachineScaleSetsReimageOperation(_clientDiagnostics, _pipeline, RestClient.CreateReima |
| | 1262 | | } |
| 0 | 1263 | | catch (Exception e) |
| | 1264 | | { |
| 0 | 1265 | | scope.Failed(e); |
| 0 | 1266 | | throw; |
| | 1267 | | } |
| 6 | 1268 | | } |
| | 1269 | |
|
| | 1270 | | /// <summary> Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don&a |
| | 1271 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1272 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1273 | | /// <param name="vmScaleSetReimageInput"> Parameters for Reimaging VM ScaleSet. </param> |
| | 1274 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1275 | | public virtual VirtualMachineScaleSetsReimageOperation StartReimage(string resourceGroupName, string vmScaleSetN |
| | 1276 | | { |
| 6 | 1277 | | if (resourceGroupName == null) |
| | 1278 | | { |
| 0 | 1279 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1280 | | } |
| 6 | 1281 | | if (vmScaleSetName == null) |
| | 1282 | | { |
| 0 | 1283 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1284 | | } |
| | 1285 | |
|
| 6 | 1286 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartReimage"); |
| 6 | 1287 | | scope.Start(); |
| | 1288 | | try |
| | 1289 | | { |
| 6 | 1290 | | var originalResponse = RestClient.Reimage(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, can |
| 6 | 1291 | | return new VirtualMachineScaleSetsReimageOperation(_clientDiagnostics, _pipeline, RestClient.CreateReima |
| | 1292 | | } |
| 0 | 1293 | | catch (Exception e) |
| | 1294 | | { |
| 0 | 1295 | | scope.Failed(e); |
| 0 | 1296 | | throw; |
| | 1297 | | } |
| 6 | 1298 | | } |
| | 1299 | |
|
| | 1300 | | /// <summary> Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This op |
| | 1301 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1302 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1303 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 1304 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1305 | | public virtual async Task<VirtualMachineScaleSetsReimageAllOperation> StartReimageAllAsync(string resourceGroupN |
| | 1306 | | { |
| 4 | 1307 | | if (resourceGroupName == null) |
| | 1308 | | { |
| 0 | 1309 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1310 | | } |
| 4 | 1311 | | if (vmScaleSetName == null) |
| | 1312 | | { |
| 0 | 1313 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1314 | | } |
| | 1315 | |
|
| 4 | 1316 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartReimageAll"); |
| 4 | 1317 | | scope.Start(); |
| | 1318 | | try |
| | 1319 | | { |
| 4 | 1320 | | var originalResponse = await RestClient.ReimageAllAsync(resourceGroupName, vmScaleSetName, vmInstanceIDs |
| 4 | 1321 | | return new VirtualMachineScaleSetsReimageAllOperation(_clientDiagnostics, _pipeline, RestClient.CreateRe |
| | 1322 | | } |
| 0 | 1323 | | catch (Exception e) |
| | 1324 | | { |
| 0 | 1325 | | scope.Failed(e); |
| 0 | 1326 | | throw; |
| | 1327 | | } |
| 4 | 1328 | | } |
| | 1329 | |
|
| | 1330 | | /// <summary> Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This op |
| | 1331 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1332 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | 1333 | | /// <param name="vmInstanceIDs"> A list of virtual machine instance IDs from the VM scale set. </param> |
| | 1334 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1335 | | public virtual VirtualMachineScaleSetsReimageAllOperation StartReimageAll(string resourceGroupName, string vmSca |
| | 1336 | | { |
| 4 | 1337 | | if (resourceGroupName == null) |
| | 1338 | | { |
| 0 | 1339 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1340 | | } |
| 4 | 1341 | | if (vmScaleSetName == null) |
| | 1342 | | { |
| 0 | 1343 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1344 | | } |
| | 1345 | |
|
| 4 | 1346 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartReimageAll"); |
| 4 | 1347 | | scope.Start(); |
| | 1348 | | try |
| | 1349 | | { |
| 4 | 1350 | | var originalResponse = RestClient.ReimageAll(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancellat |
| 4 | 1351 | | return new VirtualMachineScaleSetsReimageAllOperation(_clientDiagnostics, _pipeline, RestClient.CreateRe |
| | 1352 | | } |
| 0 | 1353 | | catch (Exception e) |
| | 1354 | | { |
| 0 | 1355 | | scope.Failed(e); |
| 0 | 1356 | | throw; |
| | 1357 | | } |
| 4 | 1358 | | } |
| | 1359 | |
|
| | 1360 | | /// <summary> Changes ServiceState property for a given service. </summary> |
| | 1361 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1362 | | /// <param name="vmScaleSetName"> The name of the virtual machine scale set to create or update. </param> |
| | 1363 | | /// <param name="parameters"> The input object for SetOrchestrationServiceState API. </param> |
| | 1364 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1365 | | public virtual async Task<VirtualMachineScaleSetsSetOrchestrationServiceStateOperation> StartSetOrchestrationSer |
| | 1366 | | { |
| 4 | 1367 | | if (resourceGroupName == null) |
| | 1368 | | { |
| 0 | 1369 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1370 | | } |
| 4 | 1371 | | if (vmScaleSetName == null) |
| | 1372 | | { |
| 0 | 1373 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1374 | | } |
| 4 | 1375 | | if (parameters == null) |
| | 1376 | | { |
| 0 | 1377 | | throw new ArgumentNullException(nameof(parameters)); |
| | 1378 | | } |
| | 1379 | |
|
| 4 | 1380 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartSetOrchestrationSer |
| 4 | 1381 | | scope.Start(); |
| | 1382 | | try |
| | 1383 | | { |
| 4 | 1384 | | var originalResponse = await RestClient.SetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetN |
| 4 | 1385 | | return new VirtualMachineScaleSetsSetOrchestrationServiceStateOperation(_clientDiagnostics, _pipeline, R |
| | 1386 | | } |
| 0 | 1387 | | catch (Exception e) |
| | 1388 | | { |
| 0 | 1389 | | scope.Failed(e); |
| 0 | 1390 | | throw; |
| | 1391 | | } |
| 4 | 1392 | | } |
| | 1393 | |
|
| | 1394 | | /// <summary> Changes ServiceState property for a given service. </summary> |
| | 1395 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1396 | | /// <param name="vmScaleSetName"> The name of the virtual machine scale set to create or update. </param> |
| | 1397 | | /// <param name="parameters"> The input object for SetOrchestrationServiceState API. </param> |
| | 1398 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1399 | | public virtual VirtualMachineScaleSetsSetOrchestrationServiceStateOperation StartSetOrchestrationServiceState(st |
| | 1400 | | { |
| 4 | 1401 | | if (resourceGroupName == null) |
| | 1402 | | { |
| 0 | 1403 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1404 | | } |
| 4 | 1405 | | if (vmScaleSetName == null) |
| | 1406 | | { |
| 0 | 1407 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 1408 | | } |
| 4 | 1409 | | if (parameters == null) |
| | 1410 | | { |
| 0 | 1411 | | throw new ArgumentNullException(nameof(parameters)); |
| | 1412 | | } |
| | 1413 | |
|
| 4 | 1414 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetsOperations.StartSetOrchestrationSer |
| 4 | 1415 | | scope.Start(); |
| | 1416 | | try |
| | 1417 | | { |
| 4 | 1418 | | var originalResponse = RestClient.SetOrchestrationServiceState(resourceGroupName, vmScaleSetName, parame |
| 4 | 1419 | | return new VirtualMachineScaleSetsSetOrchestrationServiceStateOperation(_clientDiagnostics, _pipeline, R |
| | 1420 | | } |
| 0 | 1421 | | catch (Exception e) |
| | 1422 | | { |
| 0 | 1423 | | scope.Failed(e); |
| 0 | 1424 | | throw; |
| | 1425 | | } |
| 4 | 1426 | | } |
| | 1427 | | } |
| | 1428 | | } |