< Summary

Class:Azure.ResourceManager.Compute.VirtualMachineExtensionsOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\VirtualMachineExtensionsOperations.cs
Covered lines:7
Uncovered lines:121
Coverable lines:128
Total lines:345
Line coverage:5.4% (7 of 128)
Covered branches:0
Total branches:44
Branch coverage:0% (0 of 44)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-100%100%
.ctor(...)-100%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\VirtualMachineExtensionsOperations.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 VirtualMachineExtensions service client. </summary>
 18    public partial class VirtualMachineExtensionsOperations
 19    {
 20        private readonly ClientDiagnostics _clientDiagnostics;
 21        private readonly HttpPipeline _pipeline;
 022        internal VirtualMachineExtensionsRestOperations RestClient { get; }
 23        /// <summary> Initializes a new instance of VirtualMachineExtensionsOperations for mocking. </summary>
 39624        protected VirtualMachineExtensionsOperations()
 25        {
 39626        }
 27        /// <summary> Initializes a new instance of VirtualMachineExtensionsOperations. </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>
 39632        internal VirtualMachineExtensionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string s
 33        {
 39634            RestClient = new VirtualMachineExtensionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoin
 39635            _clientDiagnostics = clientDiagnostics;
 39636            _pipeline = pipeline;
 39637        }
 38
 39        /// <summary> The operation to get the extension. </summary>
 40        /// <param name="resourceGroupName"> The name of the resource group. </param>
 41        /// <param name="vmName"> The name of the virtual machine containing the extension. </param>
 42        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 43        /// <param name="expand"> The expand expression to apply on the operation. </param>
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual async Task<Response<VirtualMachineExtension>> GetAsync(string resourceGroupName, string vmName, s
 46        {
 047            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.Get");
 048            scope.Start();
 49            try
 50            {
 051                return await RestClient.GetAsync(resourceGroupName, vmName, vmExtensionName, expand, cancellationToken).
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 058        }
 59
 60        /// <summary> The operation to get the extension. </summary>
 61        /// <param name="resourceGroupName"> The name of the resource group. </param>
 62        /// <param name="vmName"> The name of the virtual machine containing the extension. </param>
 63        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 64        /// <param name="expand"> The expand expression to apply on the operation. </param>
 65        /// <param name="cancellationToken"> The cancellation token to use. </param>
 66        public virtual Response<VirtualMachineExtension> Get(string resourceGroupName, string vmName, string vmExtension
 67        {
 068            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.Get");
 069            scope.Start();
 70            try
 71            {
 072                return RestClient.Get(resourceGroupName, vmName, vmExtensionName, expand, cancellationToken);
 73            }
 074            catch (Exception e)
 75            {
 076                scope.Failed(e);
 077                throw;
 78            }
 079        }
 80
 81        /// <summary> The operation to get all extensions of a Virtual Machine. </summary>
 82        /// <param name="resourceGroupName"> The name of the resource group. </param>
 83        /// <param name="vmName"> The name of the virtual machine containing the extension. </param>
 84        /// <param name="expand"> The expand expression to apply on the operation. </param>
 85        /// <param name="cancellationToken"> The cancellation token to use. </param>
 86        public virtual async Task<Response<VirtualMachineExtensionsListResult>> ListAsync(string resourceGroupName, stri
 87        {
 088            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.List");
 089            scope.Start();
 90            try
 91            {
 092                return await RestClient.ListAsync(resourceGroupName, vmName, expand, cancellationToken).ConfigureAwait(f
 93            }
 094            catch (Exception e)
 95            {
 096                scope.Failed(e);
 097                throw;
 98            }
 099        }
 100
 101        /// <summary> The operation to get all extensions of a Virtual Machine. </summary>
 102        /// <param name="resourceGroupName"> The name of the resource group. </param>
 103        /// <param name="vmName"> The name of the virtual machine containing the extension. </param>
 104        /// <param name="expand"> The expand expression to apply on the operation. </param>
 105        /// <param name="cancellationToken"> The cancellation token to use. </param>
 106        public virtual Response<VirtualMachineExtensionsListResult> List(string resourceGroupName, string vmName, string
 107        {
 0108            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.List");
 0109            scope.Start();
 110            try
 111            {
 0112                return RestClient.List(resourceGroupName, vmName, expand, cancellationToken);
 113            }
 0114            catch (Exception e)
 115            {
 0116                scope.Failed(e);
 0117                throw;
 118            }
 0119        }
 120
 121        /// <summary> The operation to create or update the extension. </summary>
 122        /// <param name="resourceGroupName"> The name of the resource group. </param>
 123        /// <param name="vmName"> The name of the virtual machine where the extension should be created or updated. </pa
 124        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 125        /// <param name="extensionParameters"> Parameters supplied to the Create Virtual Machine Extension operation. </
 126        /// <param name="cancellationToken"> The cancellation token to use. </param>
 127        public virtual async Task<VirtualMachineExtensionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resou
 128        {
 0129            if (resourceGroupName == null)
 130            {
 0131                throw new ArgumentNullException(nameof(resourceGroupName));
 132            }
 0133            if (vmName == null)
 134            {
 0135                throw new ArgumentNullException(nameof(vmName));
 136            }
 0137            if (vmExtensionName == null)
 138            {
 0139                throw new ArgumentNullException(nameof(vmExtensionName));
 140            }
 0141            if (extensionParameters == null)
 142            {
 0143                throw new ArgumentNullException(nameof(extensionParameters));
 144            }
 145
 0146            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartCreateOrUpdate");
 0147            scope.Start();
 148            try
 149            {
 0150                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, 
 0151                return new VirtualMachineExtensionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 152            }
 0153            catch (Exception e)
 154            {
 0155                scope.Failed(e);
 0156                throw;
 157            }
 0158        }
 159
 160        /// <summary> The operation to create or update the extension. </summary>
 161        /// <param name="resourceGroupName"> The name of the resource group. </param>
 162        /// <param name="vmName"> The name of the virtual machine where the extension should be created or updated. </pa
 163        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 164        /// <param name="extensionParameters"> Parameters supplied to the Create Virtual Machine Extension operation. </
 165        /// <param name="cancellationToken"> The cancellation token to use. </param>
 166        public virtual VirtualMachineExtensionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, str
 167        {
 0168            if (resourceGroupName == null)
 169            {
 0170                throw new ArgumentNullException(nameof(resourceGroupName));
 171            }
 0172            if (vmName == null)
 173            {
 0174                throw new ArgumentNullException(nameof(vmName));
 175            }
 0176            if (vmExtensionName == null)
 177            {
 0178                throw new ArgumentNullException(nameof(vmExtensionName));
 179            }
 0180            if (extensionParameters == null)
 181            {
 0182                throw new ArgumentNullException(nameof(extensionParameters));
 183            }
 184
 0185            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartCreateOrUpdate");
 0186            scope.Start();
 187            try
 188            {
 0189                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionPa
 0190                return new VirtualMachineExtensionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Cre
 191            }
 0192            catch (Exception e)
 193            {
 0194                scope.Failed(e);
 0195                throw;
 196            }
 0197        }
 198
 199        /// <summary> The operation to update the extension. </summary>
 200        /// <param name="resourceGroupName"> The name of the resource group. </param>
 201        /// <param name="vmName"> The name of the virtual machine where the extension should be updated. </param>
 202        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 203        /// <param name="extensionParameters"> Parameters supplied to the Update Virtual Machine Extension operation. </
 204        /// <param name="cancellationToken"> The cancellation token to use. </param>
 205        public virtual async Task<VirtualMachineExtensionsUpdateOperation> StartUpdateAsync(string resourceGroupName, st
 206        {
 0207            if (resourceGroupName == null)
 208            {
 0209                throw new ArgumentNullException(nameof(resourceGroupName));
 210            }
 0211            if (vmName == null)
 212            {
 0213                throw new ArgumentNullException(nameof(vmName));
 214            }
 0215            if (vmExtensionName == null)
 216            {
 0217                throw new ArgumentNullException(nameof(vmExtensionName));
 218            }
 0219            if (extensionParameters == null)
 220            {
 0221                throw new ArgumentNullException(nameof(extensionParameters));
 222            }
 223
 0224            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartUpdate");
 0225            scope.Start();
 226            try
 227            {
 0228                var originalResponse = await RestClient.UpdateAsync(resourceGroupName, vmName, vmExtensionName, extensio
 0229                return new VirtualMachineExtensionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdat
 230            }
 0231            catch (Exception e)
 232            {
 0233                scope.Failed(e);
 0234                throw;
 235            }
 0236        }
 237
 238        /// <summary> The operation to update the extension. </summary>
 239        /// <param name="resourceGroupName"> The name of the resource group. </param>
 240        /// <param name="vmName"> The name of the virtual machine where the extension should be updated. </param>
 241        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 242        /// <param name="extensionParameters"> Parameters supplied to the Update Virtual Machine Extension operation. </
 243        /// <param name="cancellationToken"> The cancellation token to use. </param>
 244        public virtual VirtualMachineExtensionsUpdateOperation StartUpdate(string resourceGroupName, string vmName, stri
 245        {
 0246            if (resourceGroupName == null)
 247            {
 0248                throw new ArgumentNullException(nameof(resourceGroupName));
 249            }
 0250            if (vmName == null)
 251            {
 0252                throw new ArgumentNullException(nameof(vmName));
 253            }
 0254            if (vmExtensionName == null)
 255            {
 0256                throw new ArgumentNullException(nameof(vmExtensionName));
 257            }
 0258            if (extensionParameters == null)
 259            {
 0260                throw new ArgumentNullException(nameof(extensionParameters));
 261            }
 262
 0263            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartUpdate");
 0264            scope.Start();
 265            try
 266            {
 0267                var originalResponse = RestClient.Update(resourceGroupName, vmName, vmExtensionName, extensionParameters
 0268                return new VirtualMachineExtensionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdat
 269            }
 0270            catch (Exception e)
 271            {
 0272                scope.Failed(e);
 0273                throw;
 274            }
 0275        }
 276
 277        /// <summary> The operation to delete the extension. </summary>
 278        /// <param name="resourceGroupName"> The name of the resource group. </param>
 279        /// <param name="vmName"> The name of the virtual machine where the extension should be deleted. </param>
 280        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 281        /// <param name="cancellationToken"> The cancellation token to use. </param>
 282        public virtual async Task<VirtualMachineExtensionsDeleteOperation> StartDeleteAsync(string resourceGroupName, st
 283        {
 0284            if (resourceGroupName == null)
 285            {
 0286                throw new ArgumentNullException(nameof(resourceGroupName));
 287            }
 0288            if (vmName == null)
 289            {
 0290                throw new ArgumentNullException(nameof(vmName));
 291            }
 0292            if (vmExtensionName == null)
 293            {
 0294                throw new ArgumentNullException(nameof(vmExtensionName));
 295            }
 296
 0297            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartDelete");
 0298            scope.Start();
 299            try
 300            {
 0301                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, vmName, vmExtensionName, cancella
 0302                return new VirtualMachineExtensionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelet
 303            }
 0304            catch (Exception e)
 305            {
 0306                scope.Failed(e);
 0307                throw;
 308            }
 0309        }
 310
 311        /// <summary> The operation to delete the extension. </summary>
 312        /// <param name="resourceGroupName"> The name of the resource group. </param>
 313        /// <param name="vmName"> The name of the virtual machine where the extension should be deleted. </param>
 314        /// <param name="vmExtensionName"> The name of the virtual machine extension. </param>
 315        /// <param name="cancellationToken"> The cancellation token to use. </param>
 316        public virtual VirtualMachineExtensionsDeleteOperation StartDelete(string resourceGroupName, string vmName, stri
 317        {
 0318            if (resourceGroupName == null)
 319            {
 0320                throw new ArgumentNullException(nameof(resourceGroupName));
 321            }
 0322            if (vmName == null)
 323            {
 0324                throw new ArgumentNullException(nameof(vmName));
 325            }
 0326            if (vmExtensionName == null)
 327            {
 0328                throw new ArgumentNullException(nameof(vmExtensionName));
 329            }
 330
 0331            using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartDelete");
 0332            scope.Start();
 333            try
 334            {
 0335                var originalResponse = RestClient.Delete(resourceGroupName, vmName, vmExtensionName, cancellationToken);
 0336                return new VirtualMachineExtensionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelet
 337            }
 0338            catch (Exception e)
 339            {
 0340                scope.Failed(e);
 0341                throw;
 342            }
 0343        }
 344    }
 345}