< Summary

Class:Azure.ResourceManager.Compute.VirtualMachineScaleSetVMExtensionsOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\VirtualMachineScaleSetVMExtensionsOperations.cs
Covered lines:0
Uncovered lines:140
Coverable lines:140
Total lines:379
Line coverage:0% (0 of 140)
Covered branches:0
Total branches:56
Branch coverage:0% (0 of 56)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
ListAsync()-0%100%
List(...)-0%100%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%
StartUpdateAsync()-0%0%
StartUpdate(...)-0%0%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\VirtualMachineScaleSetVMExtensionsOperations.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.Pipeline;
 13using Azure.ResourceManager.Compute.Models;
 14
 15namespace Azure.ResourceManager.Compute
 16{
 17    /// <summary> The VirtualMachineScaleSetVMExtensions service client. </summary>
 18    public partial class VirtualMachineScaleSetVMExtensionsOperations
 19    {
 20        private readonly ClientDiagnostics _clientDiagnostics;
 21        private readonly HttpPipeline _pipeline;
 022        internal VirtualMachineScaleSetVMExtensionsRestOperations RestClient { get; }
 23        /// <summary> Initializes a new instance of VirtualMachineScaleSetVMExtensionsOperations for mocking. </summary>
 024        protected VirtualMachineScaleSetVMExtensionsOperations()
 25        {
 026        }
 27        /// <summary> Initializes a new instance of VirtualMachineScaleSetVMExtensionsOperations. </summary>
 28        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 29        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 30        /// <param name="subscriptionId"> Subscription credentials which uniquely identify Microsoft Azure subscription.
 31        /// <param name="endpoint"> server parameter. </param>
 032        internal VirtualMachineScaleSetVMExtensionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline
 33        {
 034            RestClient = new VirtualMachineScaleSetVMExtensionsRestOperations(clientDiagnostics, pipeline, subscriptionI
 035            _clientDiagnostics = clientDiagnostics;
 036            _pipeline = pipeline;
 037        }
 38
 39        /// <summary> The operation to get the VMSS VM extension. </summary>
 40        /// <param name="resourceGroupName"> The name of the resource group. </param>
 41        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 42        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 43        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 44        /// <param name="expand"> The expand expression to apply on the operation. </param>
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<VirtualMachineExtension>> GetAsync(string resourceGroupName, string vmScaleSe
 47        {
 048            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.Get");
 049            scope.Start();
 50            try
 51            {
 052                return await RestClient.GetAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand,
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 059        }
 60
 61        /// <summary> The operation to get the VMSS VM extension. </summary>
 62        /// <param name="resourceGroupName"> The name of the resource group. </param>
 63        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 64        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 65        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 66        /// <param name="expand"> The expand expression to apply on the operation. </param>
 67        /// <param name="cancellationToken"> The cancellation token to use. </param>
 68        public virtual Response<VirtualMachineExtension> Get(string resourceGroupName, string vmScaleSetName, string ins
 69        {
 070            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.Get");
 071            scope.Start();
 72            try
 73            {
 074                return RestClient.Get(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, cancellati
 75            }
 076            catch (Exception e)
 77            {
 078                scope.Failed(e);
 079                throw;
 80            }
 081        }
 82
 83        /// <summary> The operation to get all extensions of an instance in Virtual Machine Scaleset. </summary>
 84        /// <param name="resourceGroupName"> The name of the resource group. </param>
 85        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 86        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 87        /// <param name="expand"> The expand expression to apply on the operation. </param>
 88        /// <param name="cancellationToken"> The cancellation token to use. </param>
 89        public virtual async Task<Response<VirtualMachineExtensionsListResult>> ListAsync(string resourceGroupName, stri
 90        {
 091            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.List");
 092            scope.Start();
 93            try
 94            {
 095                return await RestClient.ListAsync(resourceGroupName, vmScaleSetName, instanceId, expand, cancellationTok
 96            }
 097            catch (Exception e)
 98            {
 099                scope.Failed(e);
 0100                throw;
 101            }
 0102        }
 103
 104        /// <summary> The operation to get all extensions of an instance in Virtual Machine Scaleset. </summary>
 105        /// <param name="resourceGroupName"> The name of the resource group. </param>
 106        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 107        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 108        /// <param name="expand"> The expand expression to apply on the operation. </param>
 109        /// <param name="cancellationToken"> The cancellation token to use. </param>
 110        public virtual Response<VirtualMachineExtensionsListResult> List(string resourceGroupName, string vmScaleSetName
 111        {
 0112            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.List");
 0113            scope.Start();
 114            try
 115            {
 0116                return RestClient.List(resourceGroupName, vmScaleSetName, instanceId, expand, cancellationToken);
 117            }
 0118            catch (Exception e)
 119            {
 0120                scope.Failed(e);
 0121                throw;
 122            }
 0123        }
 124
 125        /// <summary> The operation to create or update the VMSS VM extension. </summary>
 126        /// <param name="resourceGroupName"> The name of the resource group. </param>
 127        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 128        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 129        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 130        /// <param name="extensionParameters"> Parameters supplied to the Create Virtual Machine Extension operation. </
 131        /// <param name="cancellationToken"> The cancellation token to use. </param>
 132        public virtual async Task<VirtualMachineScaleSetVMExtensionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(st
 133        {
 0134            if (resourceGroupName == null)
 135            {
 0136                throw new ArgumentNullException(nameof(resourceGroupName));
 137            }
 0138            if (vmScaleSetName == null)
 139            {
 0140                throw new ArgumentNullException(nameof(vmScaleSetName));
 141            }
 0142            if (instanceId == null)
 143            {
 0144                throw new ArgumentNullException(nameof(instanceId));
 145            }
 0146            if (vmExtensionName == null)
 147            {
 0148                throw new ArgumentNullException(nameof(vmExtensionName));
 149            }
 0150            if (extensionParameters == null)
 151            {
 0152                throw new ArgumentNullException(nameof(extensionParameters));
 153            }
 154
 0155            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartCreateOr
 0156            scope.Start();
 157            try
 158            {
 0159                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceI
 0160                return new VirtualMachineScaleSetVMExtensionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, Rest
 161            }
 0162            catch (Exception e)
 163            {
 0164                scope.Failed(e);
 0165                throw;
 166            }
 0167        }
 168
 169        /// <summary> The operation to create or update the VMSS VM extension. </summary>
 170        /// <param name="resourceGroupName"> The name of the resource group. </param>
 171        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 172        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 173        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 174        /// <param name="extensionParameters"> Parameters supplied to the Create Virtual Machine Extension operation. </
 175        /// <param name="cancellationToken"> The cancellation token to use. </param>
 176        public virtual VirtualMachineScaleSetVMExtensionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGrou
 177        {
 0178            if (resourceGroupName == null)
 179            {
 0180                throw new ArgumentNullException(nameof(resourceGroupName));
 181            }
 0182            if (vmScaleSetName == null)
 183            {
 0184                throw new ArgumentNullException(nameof(vmScaleSetName));
 185            }
 0186            if (instanceId == null)
 187            {
 0188                throw new ArgumentNullException(nameof(instanceId));
 189            }
 0190            if (vmExtensionName == null)
 191            {
 0192                throw new ArgumentNullException(nameof(vmExtensionName));
 193            }
 0194            if (extensionParameters == null)
 195            {
 0196                throw new ArgumentNullException(nameof(extensionParameters));
 197            }
 198
 0199            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartCreateOr
 0200            scope.Start();
 201            try
 202            {
 0203                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, vmScaleSetName, instanceId, vmExtens
 0204                return new VirtualMachineScaleSetVMExtensionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, Rest
 205            }
 0206            catch (Exception e)
 207            {
 0208                scope.Failed(e);
 0209                throw;
 210            }
 0211        }
 212
 213        /// <summary> The operation to update the VMSS VM extension. </summary>
 214        /// <param name="resourceGroupName"> The name of the resource group. </param>
 215        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 216        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 217        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 218        /// <param name="extensionParameters"> Parameters supplied to the Update Virtual Machine Extension operation. </
 219        /// <param name="cancellationToken"> The cancellation token to use. </param>
 220        public virtual async Task<VirtualMachineScaleSetVMExtensionsUpdateOperation> StartUpdateAsync(string resourceGro
 221        {
 0222            if (resourceGroupName == null)
 223            {
 0224                throw new ArgumentNullException(nameof(resourceGroupName));
 225            }
 0226            if (vmScaleSetName == null)
 227            {
 0228                throw new ArgumentNullException(nameof(vmScaleSetName));
 229            }
 0230            if (instanceId == null)
 231            {
 0232                throw new ArgumentNullException(nameof(instanceId));
 233            }
 0234            if (vmExtensionName == null)
 235            {
 0236                throw new ArgumentNullException(nameof(vmExtensionName));
 237            }
 0238            if (extensionParameters == null)
 239            {
 0240                throw new ArgumentNullException(nameof(extensionParameters));
 241            }
 242
 0243            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartUpdate")
 0244            scope.Start();
 245            try
 246            {
 0247                var originalResponse = await RestClient.UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExt
 0248                return new VirtualMachineScaleSetVMExtensionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C
 249            }
 0250            catch (Exception e)
 251            {
 0252                scope.Failed(e);
 0253                throw;
 254            }
 0255        }
 256
 257        /// <summary> The operation to update the VMSS VM extension. </summary>
 258        /// <param name="resourceGroupName"> The name of the resource group. </param>
 259        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 260        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 261        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 262        /// <param name="extensionParameters"> Parameters supplied to the Update Virtual Machine Extension operation. </
 263        /// <param name="cancellationToken"> The cancellation token to use. </param>
 264        public virtual VirtualMachineScaleSetVMExtensionsUpdateOperation StartUpdate(string resourceGroupName, string vm
 265        {
 0266            if (resourceGroupName == null)
 267            {
 0268                throw new ArgumentNullException(nameof(resourceGroupName));
 269            }
 0270            if (vmScaleSetName == null)
 271            {
 0272                throw new ArgumentNullException(nameof(vmScaleSetName));
 273            }
 0274            if (instanceId == null)
 275            {
 0276                throw new ArgumentNullException(nameof(instanceId));
 277            }
 0278            if (vmExtensionName == null)
 279            {
 0280                throw new ArgumentNullException(nameof(vmExtensionName));
 281            }
 0282            if (extensionParameters == null)
 283            {
 0284                throw new ArgumentNullException(nameof(extensionParameters));
 285            }
 286
 0287            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartUpdate")
 0288            scope.Start();
 289            try
 290            {
 0291                var originalResponse = RestClient.Update(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName,
 0292                return new VirtualMachineScaleSetVMExtensionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C
 293            }
 0294            catch (Exception e)
 295            {
 0296                scope.Failed(e);
 0297                throw;
 298            }
 0299        }
 300
 301        /// <summary> The operation to delete the VMSS VM extension. </summary>
 302        /// <param name="resourceGroupName"> The name of the resource group. </param>
 303        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 304        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 305        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 306        /// <param name="cancellationToken"> The cancellation token to use. </param>
 307        public virtual async Task<VirtualMachineScaleSetVMExtensionsDeleteOperation> StartDeleteAsync(string resourceGro
 308        {
 0309            if (resourceGroupName == null)
 310            {
 0311                throw new ArgumentNullException(nameof(resourceGroupName));
 312            }
 0313            if (vmScaleSetName == null)
 314            {
 0315                throw new ArgumentNullException(nameof(vmScaleSetName));
 316            }
 0317            if (instanceId == null)
 318            {
 0319                throw new ArgumentNullException(nameof(instanceId));
 320            }
 0321            if (vmExtensionName == null)
 322            {
 0323                throw new ArgumentNullException(nameof(vmExtensionName));
 324            }
 325
 0326            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartDelete")
 0327            scope.Start();
 328            try
 329            {
 0330                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExt
 0331                return new VirtualMachineScaleSetVMExtensionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.C
 332            }
 0333            catch (Exception e)
 334            {
 0335                scope.Failed(e);
 0336                throw;
 337            }
 0338        }
 339
 340        /// <summary> The operation to delete the VMSS VM extension. </summary>
 341        /// <param name="resourceGroupName"> The name of the resource group. </param>
 342        /// <param name="vmScaleSetName"> The name of the VM scale set. </param>
 343        /// <param name="instanceId"> The instance ID of the virtual machine. </param>
 344        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 345        /// <param name="cancellationToken"> The cancellation token to use. </param>
 346        public virtual VirtualMachineScaleSetVMExtensionsDeleteOperation StartDelete(string resourceGroupName, string vm
 347        {
 0348            if (resourceGroupName == null)
 349            {
 0350                throw new ArgumentNullException(nameof(resourceGroupName));
 351            }
 0352            if (vmScaleSetName == null)
 353            {
 0354                throw new ArgumentNullException(nameof(vmScaleSetName));
 355            }
 0356            if (instanceId == null)
 357            {
 0358                throw new ArgumentNullException(nameof(instanceId));
 359            }
 0360            if (vmExtensionName == null)
 361            {
 0362                throw new ArgumentNullException(nameof(vmExtensionName));
 363            }
 364
 0365            using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartDelete")
 0366            scope.Start();
 367            try
 368            {
 0369                var originalResponse = RestClient.Delete(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName,
 0370                return new VirtualMachineScaleSetVMExtensionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.C
 371            }
 0372            catch (Exception e)
 373            {
 0374                scope.Failed(e);
 0375                throw;
 376            }
 0377        }
 378    }
 379}