< Summary

Class:Azure.ResourceManager.Compute.VirtualMachineScaleSetVMsOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\VirtualMachineScaleSetVMsOperations.cs
Covered lines:204
Uncovered lines:204
Coverable lines:408
Total lines:1034
Line coverage:50% (204 of 408)
Covered branches:66
Total branches:148
Branch coverage:44.5% (66 of 148)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
GetAsync()-57.14%100%
Get(...)-57.14%100%
GetInstanceViewAsync()-57.14%100%
GetInstanceView(...)-57.14%100%
SimulateEvictionAsync()-0%100%
SimulateEviction(...)-0%100%
ListAsync(...)-38.1%50%
<ListAsync()-62.5%100%
<ListAsync()-0%100%
List(...)-38.1%50%
StartReimageAsync()-57.14%50%
StartReimage(...)-57.14%50%
StartReimageAllAsync()-57.14%50%
StartReimageAll(...)-57.14%50%
StartDeallocateAsync()-57.14%50%
StartDeallocate(...)-57.14%50%
StartUpdateAsync()-0%0%
StartUpdate(...)-0%0%
StartDeleteAsync()-57.14%50%
StartDelete(...)-57.14%50%
StartPowerOffAsync()-57.14%50%
StartPowerOff(...)-57.14%50%
StartRestartAsync()-57.14%50%
StartRestart(...)-57.14%50%
StartStartAsync()-57.14%50%
StartStart(...)-57.14%50%
StartRedeployAsync()-57.14%50%
StartRedeploy(...)-57.14%50%
StartPerformMaintenanceAsync()-64.29%50%
StartPerformMaintenance(...)-64.29%50%
StartRunCommandAsync()-56.25%50%
StartRunCommand(...)-56.25%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\VirtualMachineScaleSetVMsOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Compute.Models;
 15
 16namespace Azure.ResourceManager.Compute
 17{
 18    /// <summary> The VirtualMachineScaleSetVMs service client. </summary>
 19    public partial class VirtualMachineScaleSetVMsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 20023        internal VirtualMachineScaleSetVMsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of VirtualMachineScaleSetVMsOperations for mocking. </summary>
 39625        protected VirtualMachineScaleSetVMsOperations()
 26        {
 39627        }
 28        /// <summary> Initializes a new instance of VirtualMachineScaleSetVMsOperations. </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>
 39633        internal VirtualMachineScaleSetVMsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string 
 34        {
 39635            RestClient = new VirtualMachineScaleSetVMsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoi
 39636            _clientDiagnostics = clientDiagnostics;
 39637            _pipeline = pipeline;
 39638        }
 39
 40        /// <summary> Gets a virtual machine from a VM 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="instanceId"> The instance ID of the virtual machine. </param>
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual async Task<Response<VirtualMachineScaleSetVM>> GetAsync(string resourceGroupName, string vmScaleS
 46        {
 1647            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.Get");
 1648            scope.Start();
 49            try
 50            {
 1651                return await RestClient.GetAsync(resourceGroupName, vmScaleSetName, instanceId, cancellationToken).Confi
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 1658        }
 59
 60        /// <summary> Gets a virtual machine from a VM scale set. </summary>
 61        /// <param name="resourceGroupName"> The name of the resource group. </param>
 62        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 63        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 64        /// <param name="cancellationToken"> The cancellation token to use. </param>
 65        public virtual Response<VirtualMachineScaleSetVM> Get(string resourceGroupName, string vmScaleSetName, string in
 66        {
 1667            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.Get");
 1668            scope.Start();
 69            try
 70            {
 1671                return RestClient.Get(resourceGroupName, vmScaleSetName, instanceId, cancellationToken);
 72            }
 073            catch (Exception e)
 74            {
 075                scope.Failed(e);
 076                throw;
 77            }
 1678        }
 79
 80        /// <summary> Gets the status of a virtual machine from a VM scale set. </summary>
 81        /// <param name="resourceGroupName"> The name of the resource group. </param>
 82        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 83        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 84        /// <param name="cancellationToken"> The cancellation token to use. </param>
 85        public virtual async Task<Response<VirtualMachineScaleSetVMInstanceView>> GetInstanceViewAsync(string resourceGr
 86        {
 487            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.GetInstanceView");
 488            scope.Start();
 89            try
 90            {
 491                return await RestClient.GetInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId, cancellation
 92            }
 093            catch (Exception e)
 94            {
 095                scope.Failed(e);
 096                throw;
 97            }
 498        }
 99
 100        /// <summary> Gets the status of a virtual machine from a VM scale set. </summary>
 101        /// <param name="resourceGroupName"> The name of the resource group. </param>
 102        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 103        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 104        /// <param name="cancellationToken"> The cancellation token to use. </param>
 105        public virtual Response<VirtualMachineScaleSetVMInstanceView> GetInstanceView(string resourceGroupName, string v
 106        {
 4107            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.GetInstanceView");
 4108            scope.Start();
 109            try
 110            {
 4111                return RestClient.GetInstanceView(resourceGroupName, vmScaleSetName, instanceId, cancellationToken);
 112            }
 0113            catch (Exception e)
 114            {
 0115                scope.Failed(e);
 0116                throw;
 117            }
 4118        }
 119
 120        /// <summary> The operation to simulate the eviction of spot virtual machine in a VM scale set. The eviction wil
 121        /// <param name="resourceGroupName"> The name of the resource group. </param>
 122        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 123        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 124        /// <param name="cancellationToken"> The cancellation token to use. </param>
 125        public virtual async Task<Response> SimulateEvictionAsync(string resourceGroupName, string vmScaleSetName, strin
 126        {
 0127            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.SimulateEviction");
 0128            scope.Start();
 129            try
 130            {
 0131                return await RestClient.SimulateEvictionAsync(resourceGroupName, vmScaleSetName, instanceId, cancellatio
 132            }
 0133            catch (Exception e)
 134            {
 0135                scope.Failed(e);
 0136                throw;
 137            }
 0138        }
 139
 140        /// <summary> The operation to simulate the eviction of spot virtual machine in a VM scale set. The eviction wil
 141        /// <param name="resourceGroupName"> The name of the resource group. </param>
 142        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 143        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 144        /// <param name="cancellationToken"> The cancellation token to use. </param>
 145        public virtual Response SimulateEviction(string resourceGroupName, string vmScaleSetName, string instanceId, Can
 146        {
 0147            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.SimulateEviction");
 0148            scope.Start();
 149            try
 150            {
 0151                return RestClient.SimulateEviction(resourceGroupName, vmScaleSetName, instanceId, cancellationToken);
 152            }
 0153            catch (Exception e)
 154            {
 0155                scope.Failed(e);
 0156                throw;
 157            }
 0158        }
 159
 160        /// <summary> Gets a list of all virtual machines in a VM scale sets. </summary>
 161        /// <param name="resourceGroupName"> The name of the resource group. </param>
 162        /// <param name="virtualMachineScaleSetName"> The name of the VM scale set. </param>
 163        /// <param name="filter"> The filter to apply to the operation. </param>
 164        /// <param name="select"> The list parameters. </param>
 165        /// <param name="expand"> The expand expression to apply to the operation. </param>
 166        /// <param name="cancellationToken"> The cancellation token to use. </param>
 167        public virtual AsyncPageable<VirtualMachineScaleSetVM> ListAsync(string resourceGroupName, string virtualMachine
 168        {
 14169            if (resourceGroupName == null)
 170            {
 0171                throw new ArgumentNullException(nameof(resourceGroupName));
 172            }
 14173            if (virtualMachineScaleSetName == null)
 174            {
 0175                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 176            }
 177
 178            async Task<Page<VirtualMachineScaleSetVM>> FirstPageFunc(int? pageSizeHint)
 179            {
 14180                using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.List");
 14181                scope.Start();
 182                try
 183                {
 14184                    var response = await RestClient.ListAsync(resourceGroupName, virtualMachineScaleSetName, filter, sel
 14185                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 186                }
 0187                catch (Exception e)
 188                {
 0189                    scope.Failed(e);
 0190                    throw;
 191                }
 14192            }
 193            async Task<Page<VirtualMachineScaleSetVM>> NextPageFunc(string nextLink, int? pageSizeHint)
 194            {
 0195                using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.List");
 0196                scope.Start();
 197                try
 198                {
 0199                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, virtualMachineScaleSe
 0200                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 201                }
 0202                catch (Exception e)
 203                {
 0204                    scope.Failed(e);
 0205                    throw;
 206                }
 0207            }
 14208            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 209        }
 210
 211        /// <summary> Gets a list of all virtual machines in a VM scale sets. </summary>
 212        /// <param name="resourceGroupName"> The name of the resource group. </param>
 213        /// <param name="virtualMachineScaleSetName"> The name of the VM scale set. </param>
 214        /// <param name="filter"> The filter to apply to the operation. </param>
 215        /// <param name="select"> The list parameters. </param>
 216        /// <param name="expand"> The expand expression to apply to the operation. </param>
 217        /// <param name="cancellationToken"> The cancellation token to use. </param>
 218        public virtual Pageable<VirtualMachineScaleSetVM> List(string resourceGroupName, string virtualMachineScaleSetNa
 219        {
 14220            if (resourceGroupName == null)
 221            {
 0222                throw new ArgumentNullException(nameof(resourceGroupName));
 223            }
 14224            if (virtualMachineScaleSetName == null)
 225            {
 0226                throw new ArgumentNullException(nameof(virtualMachineScaleSetName));
 227            }
 228
 229            Page<VirtualMachineScaleSetVM> FirstPageFunc(int? pageSizeHint)
 230            {
 14231                using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.List");
 14232                scope.Start();
 233                try
 234                {
 14235                    var response = RestClient.List(resourceGroupName, virtualMachineScaleSetName, filter, select, expand
 14236                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 237                }
 0238                catch (Exception e)
 239                {
 0240                    scope.Failed(e);
 0241                    throw;
 242                }
 14243            }
 244            Page<VirtualMachineScaleSetVM> NextPageFunc(string nextLink, int? pageSizeHint)
 245            {
 0246                using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.List");
 0247                scope.Start();
 248                try
 249                {
 0250                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, virtualMachineScaleSetName, filt
 0251                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 252                }
 0253                catch (Exception e)
 254                {
 0255                    scope.Failed(e);
 0256                    throw;
 257                }
 0258            }
 14259            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 260        }
 261
 262        /// <summary> Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. </summary>
 263        /// <param name="resourceGroupName"> The name of the resource group. </param>
 264        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 265        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 266        /// <param name="vmScaleSetVMReimageInput"> Parameters for the Reimaging Virtual machine in ScaleSet. </param>
 267        /// <param name="cancellationToken"> The cancellation token to use. </param>
 268        public virtual async Task<VirtualMachineScaleSetVMsReimageOperation> StartReimageAsync(string resourceGroupName,
 269        {
 4270            if (resourceGroupName == null)
 271            {
 0272                throw new ArgumentNullException(nameof(resourceGroupName));
 273            }
 4274            if (vmScaleSetName == null)
 275            {
 0276                throw new ArgumentNullException(nameof(vmScaleSetName));
 277            }
 4278            if (instanceId == null)
 279            {
 0280                throw new ArgumentNullException(nameof(instanceId));
 281            }
 282
 4283            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartReimage");
 4284            scope.Start();
 285            try
 286            {
 4287                var originalResponse = await RestClient.ReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmSc
 4288                return new VirtualMachineScaleSetVMsReimageOperation(_clientDiagnostics, _pipeline, RestClient.CreateRei
 289            }
 0290            catch (Exception e)
 291            {
 0292                scope.Failed(e);
 0293                throw;
 294            }
 4295        }
 296
 297        /// <summary> Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. </summary>
 298        /// <param name="resourceGroupName"> The name of the resource group. </param>
 299        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 300        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 301        /// <param name="vmScaleSetVMReimageInput"> Parameters for the Reimaging Virtual machine in ScaleSet. </param>
 302        /// <param name="cancellationToken"> The cancellation token to use. </param>
 303        public virtual VirtualMachineScaleSetVMsReimageOperation StartReimage(string resourceGroupName, string vmScaleSe
 304        {
 4305            if (resourceGroupName == null)
 306            {
 0307                throw new ArgumentNullException(nameof(resourceGroupName));
 308            }
 4309            if (vmScaleSetName == null)
 310            {
 0311                throw new ArgumentNullException(nameof(vmScaleSetName));
 312            }
 4313            if (instanceId == null)
 314            {
 0315                throw new ArgumentNullException(nameof(instanceId));
 316            }
 317
 4318            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartReimage");
 4319            scope.Start();
 320            try
 321            {
 4322                var originalResponse = RestClient.Reimage(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMRei
 4323                return new VirtualMachineScaleSetVMsReimageOperation(_clientDiagnostics, _pipeline, RestClient.CreateRei
 324            }
 0325            catch (Exception e)
 326            {
 0327                scope.Failed(e);
 0328                throw;
 329            }
 4330        }
 331
 332        /// <summary> Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This
 333        /// <param name="resourceGroupName"> The name of the resource group. </param>
 334        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 335        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 336        /// <param name="cancellationToken"> The cancellation token to use. </param>
 337        public virtual async Task<VirtualMachineScaleSetVMsReimageAllOperation> StartReimageAllAsync(string resourceGrou
 338        {
 2339            if (resourceGroupName == null)
 340            {
 0341                throw new ArgumentNullException(nameof(resourceGroupName));
 342            }
 2343            if (vmScaleSetName == null)
 344            {
 0345                throw new ArgumentNullException(nameof(vmScaleSetName));
 346            }
 2347            if (instanceId == null)
 348            {
 0349                throw new ArgumentNullException(nameof(instanceId));
 350            }
 351
 2352            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartReimageAll");
 2353            scope.Start();
 354            try
 355            {
 2356                var originalResponse = await RestClient.ReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, c
 2357                return new VirtualMachineScaleSetVMsReimageAllOperation(_clientDiagnostics, _pipeline, RestClient.Create
 358            }
 0359            catch (Exception e)
 360            {
 0361                scope.Failed(e);
 0362                throw;
 363            }
 2364        }
 365
 366        /// <summary> Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This
 367        /// <param name="resourceGroupName"> The name of the resource group. </param>
 368        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 369        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 370        /// <param name="cancellationToken"> The cancellation token to use. </param>
 371        public virtual VirtualMachineScaleSetVMsReimageAllOperation StartReimageAll(string resourceGroupName, string vmS
 372        {
 2373            if (resourceGroupName == null)
 374            {
 0375                throw new ArgumentNullException(nameof(resourceGroupName));
 376            }
 2377            if (vmScaleSetName == null)
 378            {
 0379                throw new ArgumentNullException(nameof(vmScaleSetName));
 380            }
 2381            if (instanceId == null)
 382            {
 0383                throw new ArgumentNullException(nameof(instanceId));
 384            }
 385
 2386            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartReimageAll");
 2387            scope.Start();
 388            try
 389            {
 2390                var originalResponse = RestClient.ReimageAll(resourceGroupName, vmScaleSetName, instanceId, cancellation
 2391                return new VirtualMachineScaleSetVMsReimageAllOperation(_clientDiagnostics, _pipeline, RestClient.Create
 392            }
 0393            catch (Exception e)
 394            {
 0395                scope.Failed(e);
 0396                throw;
 397            }
 2398        }
 399
 400        /// <summary> Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and relea
 401        /// <param name="resourceGroupName"> The name of the resource group. </param>
 402        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 403        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 404        /// <param name="cancellationToken"> The cancellation token to use. </param>
 405        public virtual async Task<VirtualMachineScaleSetVMsDeallocateOperation> StartDeallocateAsync(string resourceGrou
 406        {
 4407            if (resourceGroupName == null)
 408            {
 0409                throw new ArgumentNullException(nameof(resourceGroupName));
 410            }
 4411            if (vmScaleSetName == null)
 412            {
 0413                throw new ArgumentNullException(nameof(vmScaleSetName));
 414            }
 4415            if (instanceId == null)
 416            {
 0417                throw new ArgumentNullException(nameof(instanceId));
 418            }
 419
 4420            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartDeallocate");
 4421            scope.Start();
 422            try
 423            {
 4424                var originalResponse = await RestClient.DeallocateAsync(resourceGroupName, vmScaleSetName, instanceId, c
 4425                return new VirtualMachineScaleSetVMsDeallocateOperation(_clientDiagnostics, _pipeline, RestClient.Create
 426            }
 0427            catch (Exception e)
 428            {
 0429                scope.Failed(e);
 0430                throw;
 431            }
 4432        }
 433
 434        /// <summary> Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and relea
 435        /// <param name="resourceGroupName"> The name of the resource group. </param>
 436        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 437        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 438        /// <param name="cancellationToken"> The cancellation token to use. </param>
 439        public virtual VirtualMachineScaleSetVMsDeallocateOperation StartDeallocate(string resourceGroupName, string vmS
 440        {
 4441            if (resourceGroupName == null)
 442            {
 0443                throw new ArgumentNullException(nameof(resourceGroupName));
 444            }
 4445            if (vmScaleSetName == null)
 446            {
 0447                throw new ArgumentNullException(nameof(vmScaleSetName));
 448            }
 4449            if (instanceId == null)
 450            {
 0451                throw new ArgumentNullException(nameof(instanceId));
 452            }
 453
 4454            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartDeallocate");
 4455            scope.Start();
 456            try
 457            {
 4458                var originalResponse = RestClient.Deallocate(resourceGroupName, vmScaleSetName, instanceId, cancellation
 4459                return new VirtualMachineScaleSetVMsDeallocateOperation(_clientDiagnostics, _pipeline, RestClient.Create
 460            }
 0461            catch (Exception e)
 462            {
 0463                scope.Failed(e);
 0464                throw;
 465            }
 4466        }
 467
 468        /// <summary> Updates a virtual machine of a VM scale set. </summary>
 469        /// <param name="resourceGroupName"> The name of the resource group. </param>
 470        /// <param name="vmScaleSetName"> The name of the VM scale set where the extension should be create or updated. 
 471        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 472        /// <param name="parameters"> Parameters supplied to the Update Virtual Machine Scale Sets VM operation. </param
 473        /// <param name="cancellationToken"> The cancellation token to use. </param>
 474        public virtual async Task<VirtualMachineScaleSetVMsUpdateOperation> StartUpdateAsync(string resourceGroupName, s
 475        {
 0476            if (resourceGroupName == null)
 477            {
 0478                throw new ArgumentNullException(nameof(resourceGroupName));
 479            }
 0480            if (vmScaleSetName == null)
 481            {
 0482                throw new ArgumentNullException(nameof(vmScaleSetName));
 483            }
 0484            if (instanceId == null)
 485            {
 0486                throw new ArgumentNullException(nameof(instanceId));
 487            }
 0488            if (parameters == null)
 489            {
 0490                throw new ArgumentNullException(nameof(parameters));
 491            }
 492
 0493            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartUpdate");
 0494            scope.Start();
 495            try
 496            {
 0497                var originalResponse = await RestClient.UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, param
 0498                return new VirtualMachineScaleSetVMsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpda
 499            }
 0500            catch (Exception e)
 501            {
 0502                scope.Failed(e);
 0503                throw;
 504            }
 0505        }
 506
 507        /// <summary> Updates a virtual machine of a VM scale set. </summary>
 508        /// <param name="resourceGroupName"> The name of the resource group. </param>
 509        /// <param name="vmScaleSetName"> The name of the VM scale set where the extension should be create or updated. 
 510        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 511        /// <param name="parameters"> Parameters supplied to the Update Virtual Machine Scale Sets VM operation. </param
 512        /// <param name="cancellationToken"> The cancellation token to use. </param>
 513        public virtual VirtualMachineScaleSetVMsUpdateOperation StartUpdate(string resourceGroupName, string vmScaleSetN
 514        {
 0515            if (resourceGroupName == null)
 516            {
 0517                throw new ArgumentNullException(nameof(resourceGroupName));
 518            }
 0519            if (vmScaleSetName == null)
 520            {
 0521                throw new ArgumentNullException(nameof(vmScaleSetName));
 522            }
 0523            if (instanceId == null)
 524            {
 0525                throw new ArgumentNullException(nameof(instanceId));
 526            }
 0527            if (parameters == null)
 528            {
 0529                throw new ArgumentNullException(nameof(parameters));
 530            }
 531
 0532            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartUpdate");
 0533            scope.Start();
 534            try
 535            {
 0536                var originalResponse = RestClient.Update(resourceGroupName, vmScaleSetName, instanceId, parameters, canc
 0537                return new VirtualMachineScaleSetVMsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpda
 538            }
 0539            catch (Exception e)
 540            {
 0541                scope.Failed(e);
 0542                throw;
 543            }
 0544        }
 545
 546        /// <summary> Deletes a virtual machine from a VM scale set. </summary>
 547        /// <param name="resourceGroupName"> The name of the resource group. </param>
 548        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 549        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 550        /// <param name="cancellationToken"> The cancellation token to use. </param>
 551        public virtual async Task<VirtualMachineScaleSetVMsDeleteOperation> StartDeleteAsync(string resourceGroupName, s
 552        {
 4553            if (resourceGroupName == null)
 554            {
 0555                throw new ArgumentNullException(nameof(resourceGroupName));
 556            }
 4557            if (vmScaleSetName == null)
 558            {
 0559                throw new ArgumentNullException(nameof(vmScaleSetName));
 560            }
 4561            if (instanceId == null)
 562            {
 0563                throw new ArgumentNullException(nameof(instanceId));
 564            }
 565
 4566            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartDelete");
 4567            scope.Start();
 568            try
 569            {
 4570                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, cance
 4571                return new VirtualMachineScaleSetVMsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDele
 572            }
 0573            catch (Exception e)
 574            {
 0575                scope.Failed(e);
 0576                throw;
 577            }
 4578        }
 579
 580        /// <summary> Deletes a virtual machine from a VM scale set. </summary>
 581        /// <param name="resourceGroupName"> The name of the resource group. </param>
 582        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 583        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 584        /// <param name="cancellationToken"> The cancellation token to use. </param>
 585        public virtual VirtualMachineScaleSetVMsDeleteOperation StartDelete(string resourceGroupName, string vmScaleSetN
 586        {
 4587            if (resourceGroupName == null)
 588            {
 0589                throw new ArgumentNullException(nameof(resourceGroupName));
 590            }
 4591            if (vmScaleSetName == null)
 592            {
 0593                throw new ArgumentNullException(nameof(vmScaleSetName));
 594            }
 4595            if (instanceId == null)
 596            {
 0597                throw new ArgumentNullException(nameof(instanceId));
 598            }
 599
 4600            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartDelete");
 4601            scope.Start();
 602            try
 603            {
 4604                var originalResponse = RestClient.Delete(resourceGroupName, vmScaleSetName, instanceId, cancellationToke
 4605                return new VirtualMachineScaleSetVMsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDele
 606            }
 0607            catch (Exception e)
 608            {
 0609                scope.Failed(e);
 0610                throw;
 611            }
 4612        }
 613
 614        /// <summary> Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and y
 615        /// <param name="resourceGroupName"> The name of the resource group. </param>
 616        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 617        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 618        /// <param name="skipShutdown"> The parameter to request non-graceful VM shutdown. True value for this flag indi
 619        /// <param name="cancellationToken"> The cancellation token to use. </param>
 620        public virtual async Task<VirtualMachineScaleSetVMsPowerOffOperation> StartPowerOffAsync(string resourceGroupNam
 621        {
 4622            if (resourceGroupName == null)
 623            {
 0624                throw new ArgumentNullException(nameof(resourceGroupName));
 625            }
 4626            if (vmScaleSetName == null)
 627            {
 0628                throw new ArgumentNullException(nameof(vmScaleSetName));
 629            }
 4630            if (instanceId == null)
 631            {
 0632                throw new ArgumentNullException(nameof(instanceId));
 633            }
 634
 4635            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartPowerOff");
 4636            scope.Start();
 637            try
 638            {
 4639                var originalResponse = await RestClient.PowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, ski
 4640                return new VirtualMachineScaleSetVMsPowerOffOperation(_clientDiagnostics, _pipeline, RestClient.CreatePo
 641            }
 0642            catch (Exception e)
 643            {
 0644                scope.Failed(e);
 0645                throw;
 646            }
 4647        }
 648
 649        /// <summary> Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and y
 650        /// <param name="resourceGroupName"> The name of the resource group. </param>
 651        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 652        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 653        /// <param name="skipShutdown"> The parameter to request non-graceful VM shutdown. True value for this flag indi
 654        /// <param name="cancellationToken"> The cancellation token to use. </param>
 655        public virtual VirtualMachineScaleSetVMsPowerOffOperation StartPowerOff(string resourceGroupName, string vmScale
 656        {
 4657            if (resourceGroupName == null)
 658            {
 0659                throw new ArgumentNullException(nameof(resourceGroupName));
 660            }
 4661            if (vmScaleSetName == null)
 662            {
 0663                throw new ArgumentNullException(nameof(vmScaleSetName));
 664            }
 4665            if (instanceId == null)
 666            {
 0667                throw new ArgumentNullException(nameof(instanceId));
 668            }
 669
 4670            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartPowerOff");
 4671            scope.Start();
 672            try
 673            {
 4674                var originalResponse = RestClient.PowerOff(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, 
 4675                return new VirtualMachineScaleSetVMsPowerOffOperation(_clientDiagnostics, _pipeline, RestClient.CreatePo
 676            }
 0677            catch (Exception e)
 678            {
 0679                scope.Failed(e);
 0680                throw;
 681            }
 4682        }
 683
 684        /// <summary> Restarts a virtual machine in 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="instanceId"> The instance ID of the virtual machine. </param>
 688        /// <param name="cancellationToken"> The cancellation token to use. </param>
 689        public virtual async Task<VirtualMachineScaleSetVMsRestartOperation> StartRestartAsync(string resourceGroupName,
 690        {
 4691            if (resourceGroupName == null)
 692            {
 0693                throw new ArgumentNullException(nameof(resourceGroupName));
 694            }
 4695            if (vmScaleSetName == null)
 696            {
 0697                throw new ArgumentNullException(nameof(vmScaleSetName));
 698            }
 4699            if (instanceId == null)
 700            {
 0701                throw new ArgumentNullException(nameof(instanceId));
 702            }
 703
 4704            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRestart");
 4705            scope.Start();
 706            try
 707            {
 4708                var originalResponse = await RestClient.RestartAsync(resourceGroupName, vmScaleSetName, instanceId, canc
 4709                return new VirtualMachineScaleSetVMsRestartOperation(_clientDiagnostics, _pipeline, RestClient.CreateRes
 710            }
 0711            catch (Exception e)
 712            {
 0713                scope.Failed(e);
 0714                throw;
 715            }
 4716        }
 717
 718        /// <summary> Restarts a virtual machine in a VM scale set. </summary>
 719        /// <param name="resourceGroupName"> The name of the resource group. </param>
 720        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 721        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 722        /// <param name="cancellationToken"> The cancellation token to use. </param>
 723        public virtual VirtualMachineScaleSetVMsRestartOperation StartRestart(string resourceGroupName, string vmScaleSe
 724        {
 4725            if (resourceGroupName == null)
 726            {
 0727                throw new ArgumentNullException(nameof(resourceGroupName));
 728            }
 4729            if (vmScaleSetName == null)
 730            {
 0731                throw new ArgumentNullException(nameof(vmScaleSetName));
 732            }
 4733            if (instanceId == null)
 734            {
 0735                throw new ArgumentNullException(nameof(instanceId));
 736            }
 737
 4738            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRestart");
 4739            scope.Start();
 740            try
 741            {
 4742                var originalResponse = RestClient.Restart(resourceGroupName, vmScaleSetName, instanceId, cancellationTok
 4743                return new VirtualMachineScaleSetVMsRestartOperation(_clientDiagnostics, _pipeline, RestClient.CreateRes
 744            }
 0745            catch (Exception e)
 746            {
 0747                scope.Failed(e);
 0748                throw;
 749            }
 4750        }
 751
 752        /// <summary> Starts a virtual machine in a VM scale set. </summary>
 753        /// <param name="resourceGroupName"> The name of the resource group. </param>
 754        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 755        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 756        /// <param name="cancellationToken"> The cancellation token to use. </param>
 757        public virtual async Task<VirtualMachineScaleSetVMsStartOperation> StartStartAsync(string resourceGroupName, str
 758        {
 6759            if (resourceGroupName == null)
 760            {
 0761                throw new ArgumentNullException(nameof(resourceGroupName));
 762            }
 6763            if (vmScaleSetName == null)
 764            {
 0765                throw new ArgumentNullException(nameof(vmScaleSetName));
 766            }
 6767            if (instanceId == null)
 768            {
 0769                throw new ArgumentNullException(nameof(instanceId));
 770            }
 771
 6772            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartStart");
 6773            scope.Start();
 774            try
 775            {
 6776                var originalResponse = await RestClient.StartAsync(resourceGroupName, vmScaleSetName, instanceId, cancel
 6777                return new VirtualMachineScaleSetVMsStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStart
 778            }
 0779            catch (Exception e)
 780            {
 0781                scope.Failed(e);
 0782                throw;
 783            }
 6784        }
 785
 786        /// <summary> Starts a virtual machine in a VM scale set. </summary>
 787        /// <param name="resourceGroupName"> The name of the resource group. </param>
 788        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 789        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 790        /// <param name="cancellationToken"> The cancellation token to use. </param>
 791        public virtual VirtualMachineScaleSetVMsStartOperation StartStart(string resourceGroupName, string vmScaleSetNam
 792        {
 6793            if (resourceGroupName == null)
 794            {
 0795                throw new ArgumentNullException(nameof(resourceGroupName));
 796            }
 6797            if (vmScaleSetName == null)
 798            {
 0799                throw new ArgumentNullException(nameof(vmScaleSetName));
 800            }
 6801            if (instanceId == null)
 802            {
 0803                throw new ArgumentNullException(nameof(instanceId));
 804            }
 805
 6806            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartStart");
 6807            scope.Start();
 808            try
 809            {
 6810                var originalResponse = RestClient.Start(resourceGroupName, vmScaleSetName, instanceId, cancellationToken
 6811                return new VirtualMachineScaleSetVMsStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStart
 812            }
 0813            catch (Exception e)
 814            {
 0815                scope.Failed(e);
 0816                throw;
 817            }
 6818        }
 819
 820        /// <summary> Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and power
 821        /// <param name="resourceGroupName"> The name of the resource group. </param>
 822        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 823        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 824        /// <param name="cancellationToken"> The cancellation token to use. </param>
 825        public virtual async Task<VirtualMachineScaleSetVMsRedeployOperation> StartRedeployAsync(string resourceGroupNam
 826        {
 2827            if (resourceGroupName == null)
 828            {
 0829                throw new ArgumentNullException(nameof(resourceGroupName));
 830            }
 2831            if (vmScaleSetName == null)
 832            {
 0833                throw new ArgumentNullException(nameof(vmScaleSetName));
 834            }
 2835            if (instanceId == null)
 836            {
 0837                throw new ArgumentNullException(nameof(instanceId));
 838            }
 839
 2840            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRedeploy");
 2841            scope.Start();
 842            try
 843            {
 2844                var originalResponse = await RestClient.RedeployAsync(resourceGroupName, vmScaleSetName, instanceId, can
 2845                return new VirtualMachineScaleSetVMsRedeployOperation(_clientDiagnostics, _pipeline, RestClient.CreateRe
 846            }
 0847            catch (Exception e)
 848            {
 0849                scope.Failed(e);
 0850                throw;
 851            }
 2852        }
 853
 854        /// <summary> Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and power
 855        /// <param name="resourceGroupName"> The name of the resource group. </param>
 856        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 857        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 858        /// <param name="cancellationToken"> The cancellation token to use. </param>
 859        public virtual VirtualMachineScaleSetVMsRedeployOperation StartRedeploy(string resourceGroupName, string vmScale
 860        {
 2861            if (resourceGroupName == null)
 862            {
 0863                throw new ArgumentNullException(nameof(resourceGroupName));
 864            }
 2865            if (vmScaleSetName == null)
 866            {
 0867                throw new ArgumentNullException(nameof(vmScaleSetName));
 868            }
 2869            if (instanceId == null)
 870            {
 0871                throw new ArgumentNullException(nameof(instanceId));
 872            }
 873
 2874            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRedeploy");
 2875            scope.Start();
 876            try
 877            {
 2878                var originalResponse = RestClient.Redeploy(resourceGroupName, vmScaleSetName, instanceId, cancellationTo
 2879                return new VirtualMachineScaleSetVMsRedeployOperation(_clientDiagnostics, _pipeline, RestClient.CreateRe
 880            }
 0881            catch (Exception e)
 882            {
 0883                scope.Failed(e);
 0884                throw;
 885            }
 2886        }
 887
 888        /// <summary> Performs maintenance on a virtual machine in a VM scale set. </summary>
 889        /// <param name="resourceGroupName"> The name of the resource group. </param>
 890        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 891        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 892        /// <param name="cancellationToken"> The cancellation token to use. </param>
 893        public virtual async Task<VirtualMachineScaleSetVMsPerformMaintenanceOperation> StartPerformMaintenanceAsync(str
 894        {
 2895            if (resourceGroupName == null)
 896            {
 0897                throw new ArgumentNullException(nameof(resourceGroupName));
 898            }
 2899            if (vmScaleSetName == null)
 900            {
 0901                throw new ArgumentNullException(nameof(vmScaleSetName));
 902            }
 2903            if (instanceId == null)
 904            {
 0905                throw new ArgumentNullException(nameof(instanceId));
 906            }
 907
 2908            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartPerformMaintenanc
 2909            scope.Start();
 910            try
 911            {
 2912                var originalResponse = await RestClient.PerformMaintenanceAsync(resourceGroupName, vmScaleSetName, insta
 0913                return new VirtualMachineScaleSetVMsPerformMaintenanceOperation(_clientDiagnostics, _pipeline, RestClien
 914            }
 2915            catch (Exception e)
 916            {
 2917                scope.Failed(e);
 2918                throw;
 919            }
 0920        }
 921
 922        /// <summary> Performs maintenance on a virtual machine in a VM scale set. </summary>
 923        /// <param name="resourceGroupName"> The name of the resource group. </param>
 924        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 925        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 926        /// <param name="cancellationToken"> The cancellation token to use. </param>
 927        public virtual VirtualMachineScaleSetVMsPerformMaintenanceOperation StartPerformMaintenance(string resourceGroup
 928        {
 2929            if (resourceGroupName == null)
 930            {
 0931                throw new ArgumentNullException(nameof(resourceGroupName));
 932            }
 2933            if (vmScaleSetName == null)
 934            {
 0935                throw new ArgumentNullException(nameof(vmScaleSetName));
 936            }
 2937            if (instanceId == null)
 938            {
 0939                throw new ArgumentNullException(nameof(instanceId));
 940            }
 941
 2942            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartPerformMaintenanc
 2943            scope.Start();
 944            try
 945            {
 2946                var originalResponse = RestClient.PerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, canc
 0947                return new VirtualMachineScaleSetVMsPerformMaintenanceOperation(_clientDiagnostics, _pipeline, RestClien
 948            }
 2949            catch (Exception e)
 950            {
 2951                scope.Failed(e);
 2952                throw;
 953            }
 0954        }
 955
 956        /// <summary> Run command on a virtual machine in a VM scale set. </summary>
 957        /// <param name="resourceGroupName"> The name of the resource group. </param>
 958        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 959        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 960        /// <param name="parameters"> Parameters supplied to the Run command operation. </param>
 961        /// <param name="cancellationToken"> The cancellation token to use. </param>
 962        public virtual async Task<VirtualMachineScaleSetVMsRunCommandOperation> StartRunCommandAsync(string resourceGrou
 963        {
 2964            if (resourceGroupName == null)
 965            {
 0966                throw new ArgumentNullException(nameof(resourceGroupName));
 967            }
 2968            if (vmScaleSetName == null)
 969            {
 0970                throw new ArgumentNullException(nameof(vmScaleSetName));
 971            }
 2972            if (instanceId == null)
 973            {
 0974                throw new ArgumentNullException(nameof(instanceId));
 975            }
 2976            if (parameters == null)
 977            {
 0978                throw new ArgumentNullException(nameof(parameters));
 979            }
 980
 2981            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRunCommand");
 2982            scope.Start();
 983            try
 984            {
 2985                var originalResponse = await RestClient.RunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, p
 2986                return new VirtualMachineScaleSetVMsRunCommandOperation(_clientDiagnostics, _pipeline, RestClient.Create
 987            }
 0988            catch (Exception e)
 989            {
 0990                scope.Failed(e);
 0991                throw;
 992            }
 2993        }
 994
 995        /// <summary> Run command on a virtual machine in a VM scale set. </summary>
 996        /// <param name="resourceGroupName"> The name of the resource group. </param>
 997        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 998        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 999        /// <param name="parameters"> Parameters supplied to the Run command operation. </param>
 1000        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1001        public virtual VirtualMachineScaleSetVMsRunCommandOperation StartRunCommand(string resourceGroupName, string vmS
 1002        {
 21003            if (resourceGroupName == null)
 1004            {
 01005                throw new ArgumentNullException(nameof(resourceGroupName));
 1006            }
 21007            if (vmScaleSetName == null)
 1008            {
 01009                throw new ArgumentNullException(nameof(vmScaleSetName));
 1010            }
 21011            if (instanceId == null)
 1012            {
 01013                throw new ArgumentNullException(nameof(instanceId));
 1014            }
 21015            if (parameters == null)
 1016            {
 01017                throw new ArgumentNullException(nameof(parameters));
 1018            }
 1019
 21020            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRunCommand");
 21021            scope.Start();
 1022            try
 1023            {
 21024                var originalResponse = RestClient.RunCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, 
 21025                return new VirtualMachineScaleSetVMsRunCommandOperation(_clientDiagnostics, _pipeline, RestClient.Create
 1026            }
 01027            catch (Exception e)
 1028            {
 01029                scope.Failed(e);
 01030                throw;
 1031            }
 21032        }
 1033    }
 1034}