| | 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 VirtualMachineScaleSetVMExtensions service client. </summary> |
| | 18 | | public partial class VirtualMachineScaleSetVMExtensionsOperations |
| | 19 | | { |
| | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 21 | | private readonly HttpPipeline _pipeline; |
| 0 | 22 | | internal VirtualMachineScaleSetVMExtensionsRestOperations RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of VirtualMachineScaleSetVMExtensionsOperations for mocking. </summary> |
| 0 | 24 | | protected VirtualMachineScaleSetVMExtensionsOperations() |
| | 25 | | { |
| 0 | 26 | | } |
| | 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> |
| 0 | 32 | | internal VirtualMachineScaleSetVMExtensionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline |
| | 33 | | { |
| 0 | 34 | | RestClient = new VirtualMachineScaleSetVMExtensionsRestOperations(clientDiagnostics, pipeline, subscriptionI |
| 0 | 35 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 36 | | _pipeline = pipeline; |
| 0 | 37 | | } |
| | 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 | | { |
| 0 | 48 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.Get"); |
| 0 | 49 | | scope.Start(); |
| | 50 | | try |
| | 51 | | { |
| 0 | 52 | | return await RestClient.GetAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, |
| | 53 | | } |
| 0 | 54 | | catch (Exception e) |
| | 55 | | { |
| 0 | 56 | | scope.Failed(e); |
| 0 | 57 | | throw; |
| | 58 | | } |
| 0 | 59 | | } |
| | 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 | | { |
| 0 | 70 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.Get"); |
| 0 | 71 | | scope.Start(); |
| | 72 | | try |
| | 73 | | { |
| 0 | 74 | | return RestClient.Get(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, expand, cancellati |
| | 75 | | } |
| 0 | 76 | | catch (Exception e) |
| | 77 | | { |
| 0 | 78 | | scope.Failed(e); |
| 0 | 79 | | throw; |
| | 80 | | } |
| 0 | 81 | | } |
| | 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 | | { |
| 0 | 91 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.List"); |
| 0 | 92 | | scope.Start(); |
| | 93 | | try |
| | 94 | | { |
| 0 | 95 | | return await RestClient.ListAsync(resourceGroupName, vmScaleSetName, instanceId, expand, cancellationTok |
| | 96 | | } |
| 0 | 97 | | catch (Exception e) |
| | 98 | | { |
| 0 | 99 | | scope.Failed(e); |
| 0 | 100 | | throw; |
| | 101 | | } |
| 0 | 102 | | } |
| | 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 | | { |
| 0 | 112 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.List"); |
| 0 | 113 | | scope.Start(); |
| | 114 | | try |
| | 115 | | { |
| 0 | 116 | | return RestClient.List(resourceGroupName, vmScaleSetName, instanceId, expand, cancellationToken); |
| | 117 | | } |
| 0 | 118 | | catch (Exception e) |
| | 119 | | { |
| 0 | 120 | | scope.Failed(e); |
| 0 | 121 | | throw; |
| | 122 | | } |
| 0 | 123 | | } |
| | 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 | | { |
| 0 | 134 | | if (resourceGroupName == null) |
| | 135 | | { |
| 0 | 136 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 137 | | } |
| 0 | 138 | | if (vmScaleSetName == null) |
| | 139 | | { |
| 0 | 140 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 141 | | } |
| 0 | 142 | | if (instanceId == null) |
| | 143 | | { |
| 0 | 144 | | throw new ArgumentNullException(nameof(instanceId)); |
| | 145 | | } |
| 0 | 146 | | if (vmExtensionName == null) |
| | 147 | | { |
| 0 | 148 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 149 | | } |
| 0 | 150 | | if (extensionParameters == null) |
| | 151 | | { |
| 0 | 152 | | throw new ArgumentNullException(nameof(extensionParameters)); |
| | 153 | | } |
| | 154 | |
|
| 0 | 155 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartCreateOr |
| 0 | 156 | | scope.Start(); |
| | 157 | | try |
| | 158 | | { |
| 0 | 159 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, vmScaleSetName, instanceI |
| 0 | 160 | | return new VirtualMachineScaleSetVMExtensionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, Rest |
| | 161 | | } |
| 0 | 162 | | catch (Exception e) |
| | 163 | | { |
| 0 | 164 | | scope.Failed(e); |
| 0 | 165 | | throw; |
| | 166 | | } |
| 0 | 167 | | } |
| | 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 | | { |
| 0 | 178 | | if (resourceGroupName == null) |
| | 179 | | { |
| 0 | 180 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 181 | | } |
| 0 | 182 | | if (vmScaleSetName == null) |
| | 183 | | { |
| 0 | 184 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 185 | | } |
| 0 | 186 | | if (instanceId == null) |
| | 187 | | { |
| 0 | 188 | | throw new ArgumentNullException(nameof(instanceId)); |
| | 189 | | } |
| 0 | 190 | | if (vmExtensionName == null) |
| | 191 | | { |
| 0 | 192 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 193 | | } |
| 0 | 194 | | if (extensionParameters == null) |
| | 195 | | { |
| 0 | 196 | | throw new ArgumentNullException(nameof(extensionParameters)); |
| | 197 | | } |
| | 198 | |
|
| 0 | 199 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartCreateOr |
| 0 | 200 | | scope.Start(); |
| | 201 | | try |
| | 202 | | { |
| 0 | 203 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, vmScaleSetName, instanceId, vmExtens |
| 0 | 204 | | return new VirtualMachineScaleSetVMExtensionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, Rest |
| | 205 | | } |
| 0 | 206 | | catch (Exception e) |
| | 207 | | { |
| 0 | 208 | | scope.Failed(e); |
| 0 | 209 | | throw; |
| | 210 | | } |
| 0 | 211 | | } |
| | 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 | | { |
| 0 | 222 | | if (resourceGroupName == null) |
| | 223 | | { |
| 0 | 224 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 225 | | } |
| 0 | 226 | | if (vmScaleSetName == null) |
| | 227 | | { |
| 0 | 228 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 229 | | } |
| 0 | 230 | | if (instanceId == null) |
| | 231 | | { |
| 0 | 232 | | throw new ArgumentNullException(nameof(instanceId)); |
| | 233 | | } |
| 0 | 234 | | if (vmExtensionName == null) |
| | 235 | | { |
| 0 | 236 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 237 | | } |
| 0 | 238 | | if (extensionParameters == null) |
| | 239 | | { |
| 0 | 240 | | throw new ArgumentNullException(nameof(extensionParameters)); |
| | 241 | | } |
| | 242 | |
|
| 0 | 243 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartUpdate") |
| 0 | 244 | | scope.Start(); |
| | 245 | | try |
| | 246 | | { |
| 0 | 247 | | var originalResponse = await RestClient.UpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExt |
| 0 | 248 | | return new VirtualMachineScaleSetVMExtensionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C |
| | 249 | | } |
| 0 | 250 | | catch (Exception e) |
| | 251 | | { |
| 0 | 252 | | scope.Failed(e); |
| 0 | 253 | | throw; |
| | 254 | | } |
| 0 | 255 | | } |
| | 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 | | { |
| 0 | 266 | | if (resourceGroupName == null) |
| | 267 | | { |
| 0 | 268 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 269 | | } |
| 0 | 270 | | if (vmScaleSetName == null) |
| | 271 | | { |
| 0 | 272 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 273 | | } |
| 0 | 274 | | if (instanceId == null) |
| | 275 | | { |
| 0 | 276 | | throw new ArgumentNullException(nameof(instanceId)); |
| | 277 | | } |
| 0 | 278 | | if (vmExtensionName == null) |
| | 279 | | { |
| 0 | 280 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 281 | | } |
| 0 | 282 | | if (extensionParameters == null) |
| | 283 | | { |
| 0 | 284 | | throw new ArgumentNullException(nameof(extensionParameters)); |
| | 285 | | } |
| | 286 | |
|
| 0 | 287 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartUpdate") |
| 0 | 288 | | scope.Start(); |
| | 289 | | try |
| | 290 | | { |
| 0 | 291 | | var originalResponse = RestClient.Update(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, |
| 0 | 292 | | return new VirtualMachineScaleSetVMExtensionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C |
| | 293 | | } |
| 0 | 294 | | catch (Exception e) |
| | 295 | | { |
| 0 | 296 | | scope.Failed(e); |
| 0 | 297 | | throw; |
| | 298 | | } |
| 0 | 299 | | } |
| | 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 | | { |
| 0 | 309 | | if (resourceGroupName == null) |
| | 310 | | { |
| 0 | 311 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 312 | | } |
| 0 | 313 | | if (vmScaleSetName == null) |
| | 314 | | { |
| 0 | 315 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 316 | | } |
| 0 | 317 | | if (instanceId == null) |
| | 318 | | { |
| 0 | 319 | | throw new ArgumentNullException(nameof(instanceId)); |
| | 320 | | } |
| 0 | 321 | | if (vmExtensionName == null) |
| | 322 | | { |
| 0 | 323 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 324 | | } |
| | 325 | |
|
| 0 | 326 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartDelete") |
| 0 | 327 | | scope.Start(); |
| | 328 | | try |
| | 329 | | { |
| 0 | 330 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExt |
| 0 | 331 | | return new VirtualMachineScaleSetVMExtensionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.C |
| | 332 | | } |
| 0 | 333 | | catch (Exception e) |
| | 334 | | { |
| 0 | 335 | | scope.Failed(e); |
| 0 | 336 | | throw; |
| | 337 | | } |
| 0 | 338 | | } |
| | 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 | | { |
| 0 | 348 | | if (resourceGroupName == null) |
| | 349 | | { |
| 0 | 350 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 351 | | } |
| 0 | 352 | | if (vmScaleSetName == null) |
| | 353 | | { |
| 0 | 354 | | throw new ArgumentNullException(nameof(vmScaleSetName)); |
| | 355 | | } |
| 0 | 356 | | if (instanceId == null) |
| | 357 | | { |
| 0 | 358 | | throw new ArgumentNullException(nameof(instanceId)); |
| | 359 | | } |
| 0 | 360 | | if (vmExtensionName == null) |
| | 361 | | { |
| 0 | 362 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 363 | | } |
| | 364 | |
|
| 0 | 365 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMExtensionsOperations.StartDelete") |
| 0 | 366 | | scope.Start(); |
| | 367 | | try |
| | 368 | | { |
| 0 | 369 | | var originalResponse = RestClient.Delete(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, |
| 0 | 370 | | return new VirtualMachineScaleSetVMExtensionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.C |
| | 371 | | } |
| 0 | 372 | | catch (Exception e) |
| | 373 | | { |
| 0 | 374 | | scope.Failed(e); |
| 0 | 375 | | throw; |
| | 376 | | } |
| 0 | 377 | | } |
| | 378 | | } |
| | 379 | | } |