| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | // <auto-generated/> |
| | | 5 | | |
| | | 6 | | #nullable disable |
| | | 7 | | |
| | | 8 | | using System; |
| | | 9 | | using System.Threading; |
| | | 10 | | using System.Threading.Tasks; |
| | | 11 | | using Azure; |
| | | 12 | | using Azure.Core.Pipeline; |
| | | 13 | | using Azure.ResourceManager.Compute.Models; |
| | | 14 | | |
| | | 15 | | namespace Azure.ResourceManager.Compute |
| | | 16 | | { |
| | | 17 | | /// <summary> The VirtualMachineScaleSetRollingUpgrades service client. </summary> |
| | | 18 | | public partial class VirtualMachineScaleSetRollingUpgradesOperations |
| | | 19 | | { |
| | | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | | 21 | | private readonly HttpPipeline _pipeline; |
| | 0 | 22 | | internal VirtualMachineScaleSetRollingUpgradesRestOperations RestClient { get; } |
| | | 23 | | /// <summary> Initializes a new instance of VirtualMachineScaleSetRollingUpgradesOperations for mocking. </summa |
| | 396 | 24 | | protected VirtualMachineScaleSetRollingUpgradesOperations() |
| | | 25 | | { |
| | 396 | 26 | | } |
| | | 27 | | /// <summary> Initializes a new instance of VirtualMachineScaleSetRollingUpgradesOperations. </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> |
| | 396 | 32 | | internal VirtualMachineScaleSetRollingUpgradesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipel |
| | | 33 | | { |
| | 396 | 34 | | RestClient = new VirtualMachineScaleSetRollingUpgradesRestOperations(clientDiagnostics, pipeline, subscripti |
| | 396 | 35 | | _clientDiagnostics = clientDiagnostics; |
| | 396 | 36 | | _pipeline = pipeline; |
| | 396 | 37 | | } |
| | | 38 | | |
| | | 39 | | /// <summary> Gets the status of the latest virtual machine scale set rolling upgrade. </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="cancellationToken"> The cancellation token to use. </param> |
| | | 43 | | public virtual async Task<Response<RollingUpgradeStatusInfo>> GetLatestAsync(string resourceGroupName, string vm |
| | | 44 | | { |
| | 0 | 45 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetRollingUpgradesOperations.GetLatest" |
| | 0 | 46 | | scope.Start(); |
| | | 47 | | try |
| | | 48 | | { |
| | 0 | 49 | | return await RestClient.GetLatestAsync(resourceGroupName, vmScaleSetName, cancellationToken).ConfigureAw |
| | | 50 | | } |
| | 0 | 51 | | catch (Exception e) |
| | | 52 | | { |
| | 0 | 53 | | scope.Failed(e); |
| | 0 | 54 | | throw; |
| | | 55 | | } |
| | 0 | 56 | | } |
| | | 57 | | |
| | | 58 | | /// <summary> Gets the status of the latest virtual machine scale set rolling upgrade. </summary> |
| | | 59 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 60 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | | 61 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 62 | | public virtual Response<RollingUpgradeStatusInfo> GetLatest(string resourceGroupName, string vmScaleSetName, Can |
| | | 63 | | { |
| | 0 | 64 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetRollingUpgradesOperations.GetLatest" |
| | 0 | 65 | | scope.Start(); |
| | | 66 | | try |
| | | 67 | | { |
| | 0 | 68 | | return RestClient.GetLatest(resourceGroupName, vmScaleSetName, cancellationToken); |
| | | 69 | | } |
| | 0 | 70 | | catch (Exception e) |
| | | 71 | | { |
| | 0 | 72 | | scope.Failed(e); |
| | 0 | 73 | | throw; |
| | | 74 | | } |
| | 0 | 75 | | } |
| | | 76 | | |
| | | 77 | | /// <summary> Cancels the current virtual machine scale set rolling upgrade. </summary> |
| | | 78 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 79 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | | 80 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 81 | | public virtual async Task<VirtualMachineScaleSetRollingUpgradesCancelOperation> StartCancelAsync(string resource |
| | | 82 | | { |
| | 0 | 83 | | if (resourceGroupName == null) |
| | | 84 | | { |
| | 0 | 85 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 86 | | } |
| | 0 | 87 | | if (vmScaleSetName == null) |
| | | 88 | | { |
| | 0 | 89 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 90 | | } |
| | | 91 | | |
| | 0 | 92 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetRollingUpgradesOperations.StartCance |
| | 0 | 93 | | scope.Start(); |
| | | 94 | | try |
| | | 95 | | { |
| | 0 | 96 | | var originalResponse = await RestClient.CancelAsync(resourceGroupName, vmScaleSetName, cancellationToken |
| | 0 | 97 | | return new VirtualMachineScaleSetRollingUpgradesCancelOperation(_clientDiagnostics, _pipeline, RestClien |
| | | 98 | | } |
| | 0 | 99 | | catch (Exception e) |
| | | 100 | | { |
| | 0 | 101 | | scope.Failed(e); |
| | 0 | 102 | | throw; |
| | | 103 | | } |
| | 0 | 104 | | } |
| | | 105 | | |
| | | 106 | | /// <summary> Cancels the current virtual machine scale set rolling upgrade. </summary> |
| | | 107 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 108 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | | 109 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 110 | | public virtual VirtualMachineScaleSetRollingUpgradesCancelOperation StartCancel(string resourceGroupName, string |
| | | 111 | | { |
| | 0 | 112 | | if (resourceGroupName == null) |
| | | 113 | | { |
| | 0 | 114 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 115 | | } |
| | 0 | 116 | | if (vmScaleSetName == null) |
| | | 117 | | { |
| | 0 | 118 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 119 | | } |
| | | 120 | | |
| | 0 | 121 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetRollingUpgradesOperations.StartCance |
| | 0 | 122 | | scope.Start(); |
| | | 123 | | try |
| | | 124 | | { |
| | 0 | 125 | | var originalResponse = RestClient.Cancel(resourceGroupName, vmScaleSetName, cancellationToken); |
| | 0 | 126 | | return new VirtualMachineScaleSetRollingUpgradesCancelOperation(_clientDiagnostics, _pipeline, RestClien |
| | | 127 | | } |
| | 0 | 128 | | catch (Exception e) |
| | | 129 | | { |
| | 0 | 130 | | scope.Failed(e); |
| | 0 | 131 | | throw; |
| | | 132 | | } |
| | 0 | 133 | | } |
| | | 134 | | |
| | | 135 | | /// <summary> Starts a rolling upgrade to move all virtual machine scale set instances to the latest available P |
| | | 136 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 137 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | | 138 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 139 | | public virtual async Task<VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOperation> StartStartOSUpgradeAsync |
| | | 140 | | { |
| | 0 | 141 | | if (resourceGroupName == null) |
| | | 142 | | { |
| | 0 | 143 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 144 | | } |
| | 0 | 145 | | if (vmScaleSetName == null) |
| | | 146 | | { |
| | 0 | 147 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 148 | | } |
| | | 149 | | |
| | 0 | 150 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetRollingUpgradesOperations.StartStart |
| | 0 | 151 | | scope.Start(); |
| | | 152 | | try |
| | | 153 | | { |
| | 0 | 154 | | var originalResponse = await RestClient.StartOSUpgradeAsync(resourceGroupName, vmScaleSetName, cancellat |
| | 0 | 155 | | return new VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOperation(_clientDiagnostics, _pipeline, R |
| | | 156 | | } |
| | 0 | 157 | | catch (Exception e) |
| | | 158 | | { |
| | 0 | 159 | | scope.Failed(e); |
| | 0 | 160 | | throw; |
| | | 161 | | } |
| | 0 | 162 | | } |
| | | 163 | | |
| | | 164 | | /// <summary> Starts a rolling upgrade to move all virtual machine scale set instances to the latest available P |
| | | 165 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 166 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | | 167 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 168 | | public virtual VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOperation StartStartOSUpgrade(string resourceG |
| | | 169 | | { |
| | 0 | 170 | | if (resourceGroupName == null) |
| | | 171 | | { |
| | 0 | 172 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 173 | | } |
| | 0 | 174 | | if (vmScaleSetName == null) |
| | | 175 | | { |
| | 0 | 176 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 177 | | } |
| | | 178 | | |
| | 0 | 179 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetRollingUpgradesOperations.StartStart |
| | 0 | 180 | | scope.Start(); |
| | | 181 | | try |
| | | 182 | | { |
| | 0 | 183 | | var originalResponse = RestClient.StartOSUpgrade(resourceGroupName, vmScaleSetName, cancellationToken); |
| | 0 | 184 | | return new VirtualMachineScaleSetRollingUpgradesStartOSUpgradeOperation(_clientDiagnostics, _pipeline, R |
| | | 185 | | } |
| | 0 | 186 | | catch (Exception e) |
| | | 187 | | { |
| | 0 | 188 | | scope.Failed(e); |
| | 0 | 189 | | throw; |
| | | 190 | | } |
| | 0 | 191 | | } |
| | | 192 | | |
| | | 193 | | /// <summary> Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the |
| | | 194 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 195 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | | 196 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 197 | | public virtual async Task<VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOperation> StartStartExtensi |
| | | 198 | | { |
| | 0 | 199 | | if (resourceGroupName == null) |
| | | 200 | | { |
| | 0 | 201 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 202 | | } |
| | 0 | 203 | | if (vmScaleSetName == null) |
| | | 204 | | { |
| | 0 | 205 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 206 | | } |
| | | 207 | | |
| | 0 | 208 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetRollingUpgradesOperations.StartStart |
| | 0 | 209 | | scope.Start(); |
| | | 210 | | try |
| | | 211 | | { |
| | 0 | 212 | | var originalResponse = await RestClient.StartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, ca |
| | 0 | 213 | | return new VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOperation(_clientDiagnostics, _pipe |
| | | 214 | | } |
| | 0 | 215 | | catch (Exception e) |
| | | 216 | | { |
| | 0 | 217 | | scope.Failed(e); |
| | 0 | 218 | | throw; |
| | | 219 | | } |
| | 0 | 220 | | } |
| | | 221 | | |
| | | 222 | | /// <summary> Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the |
| | | 223 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 224 | | /// <param name="vmScaleSetName"> The name of the VM scale set. </param> |
| | | 225 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 226 | | public virtual VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOperation StartStartExtensionUpgrade(st |
| | | 227 | | { |
| | 0 | 228 | | if (resourceGroupName == null) |
| | | 229 | | { |
| | 0 | 230 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 231 | | } |
| | 0 | 232 | | if (vmScaleSetName == null) |
| | | 233 | | { |
| | 0 | 234 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 235 | | } |
| | | 236 | | |
| | 0 | 237 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetRollingUpgradesOperations.StartStart |
| | 0 | 238 | | scope.Start(); |
| | | 239 | | try |
| | | 240 | | { |
| | 0 | 241 | | var originalResponse = RestClient.StartExtensionUpgrade(resourceGroupName, vmScaleSetName, cancellationT |
| | 0 | 242 | | return new VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeOperation(_clientDiagnostics, _pipe |
| | | 243 | | } |
| | 0 | 244 | | catch (Exception e) |
| | | 245 | | { |
| | 0 | 246 | | scope.Failed(e); |
| | 0 | 247 | | throw; |
| | | 248 | | } |
| | 0 | 249 | | } |
| | | 250 | | } |
| | | 251 | | } |