| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | // <auto-generated/> |
| | | 5 | | |
| | | 6 | | #nullable disable |
| | | 7 | | |
| | | 8 | | using System; |
| | | 9 | | using System.Threading; |
| | | 10 | | using System.Threading.Tasks; |
| | | 11 | | using Azure; |
| | | 12 | | using Azure.Core; |
| | | 13 | | using Azure.Core.Pipeline; |
| | | 14 | | using Azure.ResourceManager.Compute.Models; |
| | | 15 | | |
| | | 16 | | namespace Azure.ResourceManager.Compute |
| | | 17 | | { |
| | | 18 | | /// <summary> The VirtualMachineScaleSetVMs service client. </summary> |
| | | 19 | | public partial class VirtualMachineScaleSetVMsOperations |
| | | 20 | | { |
| | | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | | 22 | | private readonly HttpPipeline _pipeline; |
| | 200 | 23 | | internal VirtualMachineScaleSetVMsRestOperations RestClient { get; } |
| | | 24 | | /// <summary> Initializes a new instance of VirtualMachineScaleSetVMsOperations for mocking. </summary> |
| | 396 | 25 | | protected VirtualMachineScaleSetVMsOperations() |
| | | 26 | | { |
| | 396 | 27 | | } |
| | | 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> |
| | 396 | 33 | | internal VirtualMachineScaleSetVMsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string |
| | | 34 | | { |
| | 396 | 35 | | RestClient = new VirtualMachineScaleSetVMsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoi |
| | 396 | 36 | | _clientDiagnostics = clientDiagnostics; |
| | 396 | 37 | | _pipeline = pipeline; |
| | 396 | 38 | | } |
| | | 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 | | { |
| | 16 | 47 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.Get"); |
| | 16 | 48 | | scope.Start(); |
| | | 49 | | try |
| | | 50 | | { |
| | 16 | 51 | | return await RestClient.GetAsync(resourceGroupName, vmScaleSetName, instanceId, cancellationToken).Confi |
| | | 52 | | } |
| | 0 | 53 | | catch (Exception e) |
| | | 54 | | { |
| | 0 | 55 | | scope.Failed(e); |
| | 0 | 56 | | throw; |
| | | 57 | | } |
| | 16 | 58 | | } |
| | | 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 | | { |
| | 16 | 67 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.Get"); |
| | 16 | 68 | | scope.Start(); |
| | | 69 | | try |
| | | 70 | | { |
| | 16 | 71 | | return RestClient.Get(resourceGroupName, vmScaleSetName, instanceId, cancellationToken); |
| | | 72 | | } |
| | 0 | 73 | | catch (Exception e) |
| | | 74 | | { |
| | 0 | 75 | | scope.Failed(e); |
| | 0 | 76 | | throw; |
| | | 77 | | } |
| | 16 | 78 | | } |
| | | 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 | | { |
| | 4 | 87 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.GetInstanceView"); |
| | 4 | 88 | | scope.Start(); |
| | | 89 | | try |
| | | 90 | | { |
| | 4 | 91 | | return await RestClient.GetInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId, cancellation |
| | | 92 | | } |
| | 0 | 93 | | catch (Exception e) |
| | | 94 | | { |
| | 0 | 95 | | scope.Failed(e); |
| | 0 | 96 | | throw; |
| | | 97 | | } |
| | 4 | 98 | | } |
| | | 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 | | { |
| | 4 | 107 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.GetInstanceView"); |
| | 4 | 108 | | scope.Start(); |
| | | 109 | | try |
| | | 110 | | { |
| | 4 | 111 | | return RestClient.GetInstanceView(resourceGroupName, vmScaleSetName, instanceId, cancellationToken); |
| | | 112 | | } |
| | 0 | 113 | | catch (Exception e) |
| | | 114 | | { |
| | 0 | 115 | | scope.Failed(e); |
| | 0 | 116 | | throw; |
| | | 117 | | } |
| | 4 | 118 | | } |
| | | 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 | | { |
| | 0 | 127 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.SimulateEviction"); |
| | 0 | 128 | | scope.Start(); |
| | | 129 | | try |
| | | 130 | | { |
| | 0 | 131 | | return await RestClient.SimulateEvictionAsync(resourceGroupName, vmScaleSetName, instanceId, cancellatio |
| | | 132 | | } |
| | 0 | 133 | | catch (Exception e) |
| | | 134 | | { |
| | 0 | 135 | | scope.Failed(e); |
| | 0 | 136 | | throw; |
| | | 137 | | } |
| | 0 | 138 | | } |
| | | 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 | | { |
| | 0 | 147 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.SimulateEviction"); |
| | 0 | 148 | | scope.Start(); |
| | | 149 | | try |
| | | 150 | | { |
| | 0 | 151 | | return RestClient.SimulateEviction(resourceGroupName, vmScaleSetName, instanceId, cancellationToken); |
| | | 152 | | } |
| | 0 | 153 | | catch (Exception e) |
| | | 154 | | { |
| | 0 | 155 | | scope.Failed(e); |
| | 0 | 156 | | throw; |
| | | 157 | | } |
| | 0 | 158 | | } |
| | | 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 | | { |
| | 14 | 169 | | if (resourceGroupName == null) |
| | | 170 | | { |
| | 0 | 171 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 172 | | } |
| | 14 | 173 | | if (virtualMachineScaleSetName == null) |
| | | 174 | | { |
| | 0 | 175 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | | 176 | | } |
| | | 177 | | |
| | | 178 | | async Task<Page<VirtualMachineScaleSetVM>> FirstPageFunc(int? pageSizeHint) |
| | | 179 | | { |
| | 14 | 180 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.List"); |
| | 14 | 181 | | scope.Start(); |
| | | 182 | | try |
| | | 183 | | { |
| | 14 | 184 | | var response = await RestClient.ListAsync(resourceGroupName, virtualMachineScaleSetName, filter, sel |
| | 14 | 185 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 186 | | } |
| | 0 | 187 | | catch (Exception e) |
| | | 188 | | { |
| | 0 | 189 | | scope.Failed(e); |
| | 0 | 190 | | throw; |
| | | 191 | | } |
| | 14 | 192 | | } |
| | | 193 | | async Task<Page<VirtualMachineScaleSetVM>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 194 | | { |
| | 0 | 195 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.List"); |
| | 0 | 196 | | scope.Start(); |
| | | 197 | | try |
| | | 198 | | { |
| | 0 | 199 | | var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, virtualMachineScaleSe |
| | 0 | 200 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 201 | | } |
| | 0 | 202 | | catch (Exception e) |
| | | 203 | | { |
| | 0 | 204 | | scope.Failed(e); |
| | 0 | 205 | | throw; |
| | | 206 | | } |
| | 0 | 207 | | } |
| | 14 | 208 | | 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 | | { |
| | 14 | 220 | | if (resourceGroupName == null) |
| | | 221 | | { |
| | 0 | 222 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 223 | | } |
| | 14 | 224 | | if (virtualMachineScaleSetName == null) |
| | | 225 | | { |
| | 0 | 226 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | | 227 | | } |
| | | 228 | | |
| | | 229 | | Page<VirtualMachineScaleSetVM> FirstPageFunc(int? pageSizeHint) |
| | | 230 | | { |
| | 14 | 231 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.List"); |
| | 14 | 232 | | scope.Start(); |
| | | 233 | | try |
| | | 234 | | { |
| | 14 | 235 | | var response = RestClient.List(resourceGroupName, virtualMachineScaleSetName, filter, select, expand |
| | 14 | 236 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 237 | | } |
| | 0 | 238 | | catch (Exception e) |
| | | 239 | | { |
| | 0 | 240 | | scope.Failed(e); |
| | 0 | 241 | | throw; |
| | | 242 | | } |
| | 14 | 243 | | } |
| | | 244 | | Page<VirtualMachineScaleSetVM> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 245 | | { |
| | 0 | 246 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.List"); |
| | 0 | 247 | | scope.Start(); |
| | | 248 | | try |
| | | 249 | | { |
| | 0 | 250 | | var response = RestClient.ListNextPage(nextLink, resourceGroupName, virtualMachineScaleSetName, filt |
| | 0 | 251 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 252 | | } |
| | 0 | 253 | | catch (Exception e) |
| | | 254 | | { |
| | 0 | 255 | | scope.Failed(e); |
| | 0 | 256 | | throw; |
| | | 257 | | } |
| | 0 | 258 | | } |
| | 14 | 259 | | 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 | | { |
| | 4 | 270 | | if (resourceGroupName == null) |
| | | 271 | | { |
| | 0 | 272 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 273 | | } |
| | 4 | 274 | | if (vmScaleSetName == null) |
| | | 275 | | { |
| | 0 | 276 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 277 | | } |
| | 4 | 278 | | if (instanceId == null) |
| | | 279 | | { |
| | 0 | 280 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 281 | | } |
| | | 282 | | |
| | 4 | 283 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartReimage"); |
| | 4 | 284 | | scope.Start(); |
| | | 285 | | try |
| | | 286 | | { |
| | 4 | 287 | | var originalResponse = await RestClient.ReimageAsync(resourceGroupName, vmScaleSetName, instanceId, vmSc |
| | 4 | 288 | | return new VirtualMachineScaleSetVMsReimageOperation(_clientDiagnostics, _pipeline, RestClient.CreateRei |
| | | 289 | | } |
| | 0 | 290 | | catch (Exception e) |
| | | 291 | | { |
| | 0 | 292 | | scope.Failed(e); |
| | 0 | 293 | | throw; |
| | | 294 | | } |
| | 4 | 295 | | } |
| | | 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 | | { |
| | 4 | 305 | | if (resourceGroupName == null) |
| | | 306 | | { |
| | 0 | 307 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 308 | | } |
| | 4 | 309 | | if (vmScaleSetName == null) |
| | | 310 | | { |
| | 0 | 311 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 312 | | } |
| | 4 | 313 | | if (instanceId == null) |
| | | 314 | | { |
| | 0 | 315 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 316 | | } |
| | | 317 | | |
| | 4 | 318 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartReimage"); |
| | 4 | 319 | | scope.Start(); |
| | | 320 | | try |
| | | 321 | | { |
| | 4 | 322 | | var originalResponse = RestClient.Reimage(resourceGroupName, vmScaleSetName, instanceId, vmScaleSetVMRei |
| | 4 | 323 | | return new VirtualMachineScaleSetVMsReimageOperation(_clientDiagnostics, _pipeline, RestClient.CreateRei |
| | | 324 | | } |
| | 0 | 325 | | catch (Exception e) |
| | | 326 | | { |
| | 0 | 327 | | scope.Failed(e); |
| | 0 | 328 | | throw; |
| | | 329 | | } |
| | 4 | 330 | | } |
| | | 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 | | { |
| | 2 | 339 | | if (resourceGroupName == null) |
| | | 340 | | { |
| | 0 | 341 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 342 | | } |
| | 2 | 343 | | if (vmScaleSetName == null) |
| | | 344 | | { |
| | 0 | 345 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 346 | | } |
| | 2 | 347 | | if (instanceId == null) |
| | | 348 | | { |
| | 0 | 349 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 350 | | } |
| | | 351 | | |
| | 2 | 352 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartReimageAll"); |
| | 2 | 353 | | scope.Start(); |
| | | 354 | | try |
| | | 355 | | { |
| | 2 | 356 | | var originalResponse = await RestClient.ReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, c |
| | 2 | 357 | | return new VirtualMachineScaleSetVMsReimageAllOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | | 358 | | } |
| | 0 | 359 | | catch (Exception e) |
| | | 360 | | { |
| | 0 | 361 | | scope.Failed(e); |
| | 0 | 362 | | throw; |
| | | 363 | | } |
| | 2 | 364 | | } |
| | | 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 | | { |
| | 2 | 373 | | if (resourceGroupName == null) |
| | | 374 | | { |
| | 0 | 375 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 376 | | } |
| | 2 | 377 | | if (vmScaleSetName == null) |
| | | 378 | | { |
| | 0 | 379 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 380 | | } |
| | 2 | 381 | | if (instanceId == null) |
| | | 382 | | { |
| | 0 | 383 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 384 | | } |
| | | 385 | | |
| | 2 | 386 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartReimageAll"); |
| | 2 | 387 | | scope.Start(); |
| | | 388 | | try |
| | | 389 | | { |
| | 2 | 390 | | var originalResponse = RestClient.ReimageAll(resourceGroupName, vmScaleSetName, instanceId, cancellation |
| | 2 | 391 | | return new VirtualMachineScaleSetVMsReimageAllOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | | 392 | | } |
| | 0 | 393 | | catch (Exception e) |
| | | 394 | | { |
| | 0 | 395 | | scope.Failed(e); |
| | 0 | 396 | | throw; |
| | | 397 | | } |
| | 2 | 398 | | } |
| | | 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 | | { |
| | 4 | 407 | | if (resourceGroupName == null) |
| | | 408 | | { |
| | 0 | 409 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 410 | | } |
| | 4 | 411 | | if (vmScaleSetName == null) |
| | | 412 | | { |
| | 0 | 413 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 414 | | } |
| | 4 | 415 | | if (instanceId == null) |
| | | 416 | | { |
| | 0 | 417 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 418 | | } |
| | | 419 | | |
| | 4 | 420 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartDeallocate"); |
| | 4 | 421 | | scope.Start(); |
| | | 422 | | try |
| | | 423 | | { |
| | 4 | 424 | | var originalResponse = await RestClient.DeallocateAsync(resourceGroupName, vmScaleSetName, instanceId, c |
| | 4 | 425 | | return new VirtualMachineScaleSetVMsDeallocateOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | | 426 | | } |
| | 0 | 427 | | catch (Exception e) |
| | | 428 | | { |
| | 0 | 429 | | scope.Failed(e); |
| | 0 | 430 | | throw; |
| | | 431 | | } |
| | 4 | 432 | | } |
| | | 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 | | { |
| | 4 | 441 | | if (resourceGroupName == null) |
| | | 442 | | { |
| | 0 | 443 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 444 | | } |
| | 4 | 445 | | if (vmScaleSetName == null) |
| | | 446 | | { |
| | 0 | 447 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 448 | | } |
| | 4 | 449 | | if (instanceId == null) |
| | | 450 | | { |
| | 0 | 451 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 452 | | } |
| | | 453 | | |
| | 4 | 454 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartDeallocate"); |
| | 4 | 455 | | scope.Start(); |
| | | 456 | | try |
| | | 457 | | { |
| | 4 | 458 | | var originalResponse = RestClient.Deallocate(resourceGroupName, vmScaleSetName, instanceId, cancellation |
| | 4 | 459 | | return new VirtualMachineScaleSetVMsDeallocateOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | | 460 | | } |
| | 0 | 461 | | catch (Exception e) |
| | | 462 | | { |
| | 0 | 463 | | scope.Failed(e); |
| | 0 | 464 | | throw; |
| | | 465 | | } |
| | 4 | 466 | | } |
| | | 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 | | { |
| | 0 | 476 | | if (resourceGroupName == null) |
| | | 477 | | { |
| | 0 | 478 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 479 | | } |
| | 0 | 480 | | if (vmScaleSetName == null) |
| | | 481 | | { |
| | 0 | 482 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 483 | | } |
| | 0 | 484 | | if (instanceId == null) |
| | | 485 | | { |
| | 0 | 486 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 487 | | } |
| | 0 | 488 | | if (parameters == null) |
| | | 489 | | { |
| | 0 | 490 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 491 | | } |
| | | 492 | | |
| | 0 | 493 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartUpdate"); |
| | 0 | 494 | | scope.Start(); |
| | | 495 | | try |
| | | 496 | | { |
| | 0 | 497 | | var originalResponse = await RestClient.UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, param |
| | 0 | 498 | | return new VirtualMachineScaleSetVMsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpda |
| | | 499 | | } |
| | 0 | 500 | | catch (Exception e) |
| | | 501 | | { |
| | 0 | 502 | | scope.Failed(e); |
| | 0 | 503 | | throw; |
| | | 504 | | } |
| | 0 | 505 | | } |
| | | 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 | | { |
| | 0 | 515 | | if (resourceGroupName == null) |
| | | 516 | | { |
| | 0 | 517 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 518 | | } |
| | 0 | 519 | | if (vmScaleSetName == null) |
| | | 520 | | { |
| | 0 | 521 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 522 | | } |
| | 0 | 523 | | if (instanceId == null) |
| | | 524 | | { |
| | 0 | 525 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 526 | | } |
| | 0 | 527 | | if (parameters == null) |
| | | 528 | | { |
| | 0 | 529 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 530 | | } |
| | | 531 | | |
| | 0 | 532 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartUpdate"); |
| | 0 | 533 | | scope.Start(); |
| | | 534 | | try |
| | | 535 | | { |
| | 0 | 536 | | var originalResponse = RestClient.Update(resourceGroupName, vmScaleSetName, instanceId, parameters, canc |
| | 0 | 537 | | return new VirtualMachineScaleSetVMsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpda |
| | | 538 | | } |
| | 0 | 539 | | catch (Exception e) |
| | | 540 | | { |
| | 0 | 541 | | scope.Failed(e); |
| | 0 | 542 | | throw; |
| | | 543 | | } |
| | 0 | 544 | | } |
| | | 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 | | { |
| | 4 | 553 | | if (resourceGroupName == null) |
| | | 554 | | { |
| | 0 | 555 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 556 | | } |
| | 4 | 557 | | if (vmScaleSetName == null) |
| | | 558 | | { |
| | 0 | 559 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 560 | | } |
| | 4 | 561 | | if (instanceId == null) |
| | | 562 | | { |
| | 0 | 563 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 564 | | } |
| | | 565 | | |
| | 4 | 566 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartDelete"); |
| | 4 | 567 | | scope.Start(); |
| | | 568 | | try |
| | | 569 | | { |
| | 4 | 570 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, cance |
| | 4 | 571 | | return new VirtualMachineScaleSetVMsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDele |
| | | 572 | | } |
| | 0 | 573 | | catch (Exception e) |
| | | 574 | | { |
| | 0 | 575 | | scope.Failed(e); |
| | 0 | 576 | | throw; |
| | | 577 | | } |
| | 4 | 578 | | } |
| | | 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 | | { |
| | 4 | 587 | | if (resourceGroupName == null) |
| | | 588 | | { |
| | 0 | 589 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 590 | | } |
| | 4 | 591 | | if (vmScaleSetName == null) |
| | | 592 | | { |
| | 0 | 593 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 594 | | } |
| | 4 | 595 | | if (instanceId == null) |
| | | 596 | | { |
| | 0 | 597 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 598 | | } |
| | | 599 | | |
| | 4 | 600 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartDelete"); |
| | 4 | 601 | | scope.Start(); |
| | | 602 | | try |
| | | 603 | | { |
| | 4 | 604 | | var originalResponse = RestClient.Delete(resourceGroupName, vmScaleSetName, instanceId, cancellationToke |
| | 4 | 605 | | return new VirtualMachineScaleSetVMsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDele |
| | | 606 | | } |
| | 0 | 607 | | catch (Exception e) |
| | | 608 | | { |
| | 0 | 609 | | scope.Failed(e); |
| | 0 | 610 | | throw; |
| | | 611 | | } |
| | 4 | 612 | | } |
| | | 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 | | { |
| | 4 | 622 | | if (resourceGroupName == null) |
| | | 623 | | { |
| | 0 | 624 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 625 | | } |
| | 4 | 626 | | if (vmScaleSetName == null) |
| | | 627 | | { |
| | 0 | 628 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 629 | | } |
| | 4 | 630 | | if (instanceId == null) |
| | | 631 | | { |
| | 0 | 632 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 633 | | } |
| | | 634 | | |
| | 4 | 635 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartPowerOff"); |
| | 4 | 636 | | scope.Start(); |
| | | 637 | | try |
| | | 638 | | { |
| | 4 | 639 | | var originalResponse = await RestClient.PowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, ski |
| | 4 | 640 | | return new VirtualMachineScaleSetVMsPowerOffOperation(_clientDiagnostics, _pipeline, RestClient.CreatePo |
| | | 641 | | } |
| | 0 | 642 | | catch (Exception e) |
| | | 643 | | { |
| | 0 | 644 | | scope.Failed(e); |
| | 0 | 645 | | throw; |
| | | 646 | | } |
| | 4 | 647 | | } |
| | | 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 | | { |
| | 4 | 657 | | if (resourceGroupName == null) |
| | | 658 | | { |
| | 0 | 659 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 660 | | } |
| | 4 | 661 | | if (vmScaleSetName == null) |
| | | 662 | | { |
| | 0 | 663 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 664 | | } |
| | 4 | 665 | | if (instanceId == null) |
| | | 666 | | { |
| | 0 | 667 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 668 | | } |
| | | 669 | | |
| | 4 | 670 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartPowerOff"); |
| | 4 | 671 | | scope.Start(); |
| | | 672 | | try |
| | | 673 | | { |
| | 4 | 674 | | var originalResponse = RestClient.PowerOff(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, |
| | 4 | 675 | | return new VirtualMachineScaleSetVMsPowerOffOperation(_clientDiagnostics, _pipeline, RestClient.CreatePo |
| | | 676 | | } |
| | 0 | 677 | | catch (Exception e) |
| | | 678 | | { |
| | 0 | 679 | | scope.Failed(e); |
| | 0 | 680 | | throw; |
| | | 681 | | } |
| | 4 | 682 | | } |
| | | 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 | | { |
| | 4 | 691 | | if (resourceGroupName == null) |
| | | 692 | | { |
| | 0 | 693 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 694 | | } |
| | 4 | 695 | | if (vmScaleSetName == null) |
| | | 696 | | { |
| | 0 | 697 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 698 | | } |
| | 4 | 699 | | if (instanceId == null) |
| | | 700 | | { |
| | 0 | 701 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 702 | | } |
| | | 703 | | |
| | 4 | 704 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRestart"); |
| | 4 | 705 | | scope.Start(); |
| | | 706 | | try |
| | | 707 | | { |
| | 4 | 708 | | var originalResponse = await RestClient.RestartAsync(resourceGroupName, vmScaleSetName, instanceId, canc |
| | 4 | 709 | | return new VirtualMachineScaleSetVMsRestartOperation(_clientDiagnostics, _pipeline, RestClient.CreateRes |
| | | 710 | | } |
| | 0 | 711 | | catch (Exception e) |
| | | 712 | | { |
| | 0 | 713 | | scope.Failed(e); |
| | 0 | 714 | | throw; |
| | | 715 | | } |
| | 4 | 716 | | } |
| | | 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 | | { |
| | 4 | 725 | | if (resourceGroupName == null) |
| | | 726 | | { |
| | 0 | 727 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 728 | | } |
| | 4 | 729 | | if (vmScaleSetName == null) |
| | | 730 | | { |
| | 0 | 731 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 732 | | } |
| | 4 | 733 | | if (instanceId == null) |
| | | 734 | | { |
| | 0 | 735 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 736 | | } |
| | | 737 | | |
| | 4 | 738 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRestart"); |
| | 4 | 739 | | scope.Start(); |
| | | 740 | | try |
| | | 741 | | { |
| | 4 | 742 | | var originalResponse = RestClient.Restart(resourceGroupName, vmScaleSetName, instanceId, cancellationTok |
| | 4 | 743 | | return new VirtualMachineScaleSetVMsRestartOperation(_clientDiagnostics, _pipeline, RestClient.CreateRes |
| | | 744 | | } |
| | 0 | 745 | | catch (Exception e) |
| | | 746 | | { |
| | 0 | 747 | | scope.Failed(e); |
| | 0 | 748 | | throw; |
| | | 749 | | } |
| | 4 | 750 | | } |
| | | 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 | | { |
| | 6 | 759 | | if (resourceGroupName == null) |
| | | 760 | | { |
| | 0 | 761 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 762 | | } |
| | 6 | 763 | | if (vmScaleSetName == null) |
| | | 764 | | { |
| | 0 | 765 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 766 | | } |
| | 6 | 767 | | if (instanceId == null) |
| | | 768 | | { |
| | 0 | 769 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 770 | | } |
| | | 771 | | |
| | 6 | 772 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartStart"); |
| | 6 | 773 | | scope.Start(); |
| | | 774 | | try |
| | | 775 | | { |
| | 6 | 776 | | var originalResponse = await RestClient.StartAsync(resourceGroupName, vmScaleSetName, instanceId, cancel |
| | 6 | 777 | | return new VirtualMachineScaleSetVMsStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStart |
| | | 778 | | } |
| | 0 | 779 | | catch (Exception e) |
| | | 780 | | { |
| | 0 | 781 | | scope.Failed(e); |
| | 0 | 782 | | throw; |
| | | 783 | | } |
| | 6 | 784 | | } |
| | | 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 | | { |
| | 6 | 793 | | if (resourceGroupName == null) |
| | | 794 | | { |
| | 0 | 795 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 796 | | } |
| | 6 | 797 | | if (vmScaleSetName == null) |
| | | 798 | | { |
| | 0 | 799 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 800 | | } |
| | 6 | 801 | | if (instanceId == null) |
| | | 802 | | { |
| | 0 | 803 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 804 | | } |
| | | 805 | | |
| | 6 | 806 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartStart"); |
| | 6 | 807 | | scope.Start(); |
| | | 808 | | try |
| | | 809 | | { |
| | 6 | 810 | | var originalResponse = RestClient.Start(resourceGroupName, vmScaleSetName, instanceId, cancellationToken |
| | 6 | 811 | | return new VirtualMachineScaleSetVMsStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStart |
| | | 812 | | } |
| | 0 | 813 | | catch (Exception e) |
| | | 814 | | { |
| | 0 | 815 | | scope.Failed(e); |
| | 0 | 816 | | throw; |
| | | 817 | | } |
| | 6 | 818 | | } |
| | | 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 | | { |
| | 2 | 827 | | if (resourceGroupName == null) |
| | | 828 | | { |
| | 0 | 829 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 830 | | } |
| | 2 | 831 | | if (vmScaleSetName == null) |
| | | 832 | | { |
| | 0 | 833 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 834 | | } |
| | 2 | 835 | | if (instanceId == null) |
| | | 836 | | { |
| | 0 | 837 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 838 | | } |
| | | 839 | | |
| | 2 | 840 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRedeploy"); |
| | 2 | 841 | | scope.Start(); |
| | | 842 | | try |
| | | 843 | | { |
| | 2 | 844 | | var originalResponse = await RestClient.RedeployAsync(resourceGroupName, vmScaleSetName, instanceId, can |
| | 2 | 845 | | return new VirtualMachineScaleSetVMsRedeployOperation(_clientDiagnostics, _pipeline, RestClient.CreateRe |
| | | 846 | | } |
| | 0 | 847 | | catch (Exception e) |
| | | 848 | | { |
| | 0 | 849 | | scope.Failed(e); |
| | 0 | 850 | | throw; |
| | | 851 | | } |
| | 2 | 852 | | } |
| | | 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 | | { |
| | 2 | 861 | | if (resourceGroupName == null) |
| | | 862 | | { |
| | 0 | 863 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 864 | | } |
| | 2 | 865 | | if (vmScaleSetName == null) |
| | | 866 | | { |
| | 0 | 867 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 868 | | } |
| | 2 | 869 | | if (instanceId == null) |
| | | 870 | | { |
| | 0 | 871 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 872 | | } |
| | | 873 | | |
| | 2 | 874 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRedeploy"); |
| | 2 | 875 | | scope.Start(); |
| | | 876 | | try |
| | | 877 | | { |
| | 2 | 878 | | var originalResponse = RestClient.Redeploy(resourceGroupName, vmScaleSetName, instanceId, cancellationTo |
| | 2 | 879 | | return new VirtualMachineScaleSetVMsRedeployOperation(_clientDiagnostics, _pipeline, RestClient.CreateRe |
| | | 880 | | } |
| | 0 | 881 | | catch (Exception e) |
| | | 882 | | { |
| | 0 | 883 | | scope.Failed(e); |
| | 0 | 884 | | throw; |
| | | 885 | | } |
| | 2 | 886 | | } |
| | | 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 | | { |
| | 2 | 895 | | if (resourceGroupName == null) |
| | | 896 | | { |
| | 0 | 897 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 898 | | } |
| | 2 | 899 | | if (vmScaleSetName == null) |
| | | 900 | | { |
| | 0 | 901 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 902 | | } |
| | 2 | 903 | | if (instanceId == null) |
| | | 904 | | { |
| | 0 | 905 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 906 | | } |
| | | 907 | | |
| | 2 | 908 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartPerformMaintenanc |
| | 2 | 909 | | scope.Start(); |
| | | 910 | | try |
| | | 911 | | { |
| | 2 | 912 | | var originalResponse = await RestClient.PerformMaintenanceAsync(resourceGroupName, vmScaleSetName, insta |
| | 0 | 913 | | return new VirtualMachineScaleSetVMsPerformMaintenanceOperation(_clientDiagnostics, _pipeline, RestClien |
| | | 914 | | } |
| | 2 | 915 | | catch (Exception e) |
| | | 916 | | { |
| | 2 | 917 | | scope.Failed(e); |
| | 2 | 918 | | throw; |
| | | 919 | | } |
| | 0 | 920 | | } |
| | | 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 | | { |
| | 2 | 929 | | if (resourceGroupName == null) |
| | | 930 | | { |
| | 0 | 931 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 932 | | } |
| | 2 | 933 | | if (vmScaleSetName == null) |
| | | 934 | | { |
| | 0 | 935 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 936 | | } |
| | 2 | 937 | | if (instanceId == null) |
| | | 938 | | { |
| | 0 | 939 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 940 | | } |
| | | 941 | | |
| | 2 | 942 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartPerformMaintenanc |
| | 2 | 943 | | scope.Start(); |
| | | 944 | | try |
| | | 945 | | { |
| | 2 | 946 | | var originalResponse = RestClient.PerformMaintenance(resourceGroupName, vmScaleSetName, instanceId, canc |
| | 0 | 947 | | return new VirtualMachineScaleSetVMsPerformMaintenanceOperation(_clientDiagnostics, _pipeline, RestClien |
| | | 948 | | } |
| | 2 | 949 | | catch (Exception e) |
| | | 950 | | { |
| | 2 | 951 | | scope.Failed(e); |
| | 2 | 952 | | throw; |
| | | 953 | | } |
| | 0 | 954 | | } |
| | | 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 | | { |
| | 2 | 964 | | if (resourceGroupName == null) |
| | | 965 | | { |
| | 0 | 966 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 967 | | } |
| | 2 | 968 | | if (vmScaleSetName == null) |
| | | 969 | | { |
| | 0 | 970 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 971 | | } |
| | 2 | 972 | | if (instanceId == null) |
| | | 973 | | { |
| | 0 | 974 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 975 | | } |
| | 2 | 976 | | if (parameters == null) |
| | | 977 | | { |
| | 0 | 978 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 979 | | } |
| | | 980 | | |
| | 2 | 981 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRunCommand"); |
| | 2 | 982 | | scope.Start(); |
| | | 983 | | try |
| | | 984 | | { |
| | 2 | 985 | | var originalResponse = await RestClient.RunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, p |
| | 2 | 986 | | return new VirtualMachineScaleSetVMsRunCommandOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | | 987 | | } |
| | 0 | 988 | | catch (Exception e) |
| | | 989 | | { |
| | 0 | 990 | | scope.Failed(e); |
| | 0 | 991 | | throw; |
| | | 992 | | } |
| | 2 | 993 | | } |
| | | 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 | | { |
| | 2 | 1003 | | if (resourceGroupName == null) |
| | | 1004 | | { |
| | 0 | 1005 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 1006 | | } |
| | 2 | 1007 | | if (vmScaleSetName == null) |
| | | 1008 | | { |
| | 0 | 1009 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | | 1010 | | } |
| | 2 | 1011 | | if (instanceId == null) |
| | | 1012 | | { |
| | 0 | 1013 | | throw new ArgumentNullException(nameof(instanceId)); |
| | | 1014 | | } |
| | 2 | 1015 | | if (parameters == null) |
| | | 1016 | | { |
| | 0 | 1017 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 1018 | | } |
| | | 1019 | | |
| | 2 | 1020 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMsOperations.StartRunCommand"); |
| | 2 | 1021 | | scope.Start(); |
| | | 1022 | | try |
| | | 1023 | | { |
| | 2 | 1024 | | var originalResponse = RestClient.RunCommand(resourceGroupName, vmScaleSetName, instanceId, parameters, |
| | 2 | 1025 | | return new VirtualMachineScaleSetVMsRunCommandOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | | 1026 | | } |
| | 0 | 1027 | | catch (Exception e) |
| | | 1028 | | { |
| | 0 | 1029 | | scope.Failed(e); |
| | 0 | 1030 | | throw; |
| | | 1031 | | } |
| | 2 | 1032 | | } |
| | | 1033 | | } |
| | | 1034 | | } |