| | 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 VirtualMachineExtensions service client. </summary> |
| | 18 | | public partial class VirtualMachineExtensionsOperations |
| | 19 | | { |
| | 20 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 21 | | private readonly HttpPipeline _pipeline; |
| 0 | 22 | | internal VirtualMachineExtensionsRestOperations RestClient { get; } |
| | 23 | | /// <summary> Initializes a new instance of VirtualMachineExtensionsOperations for mocking. </summary> |
| 396 | 24 | | protected VirtualMachineExtensionsOperations() |
| | 25 | | { |
| 396 | 26 | | } |
| | 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> |
| 396 | 32 | | internal VirtualMachineExtensionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string s |
| | 33 | | { |
| 396 | 34 | | RestClient = new VirtualMachineExtensionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoin |
| 396 | 35 | | _clientDiagnostics = clientDiagnostics; |
| 396 | 36 | | _pipeline = pipeline; |
| 396 | 37 | | } |
| | 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 | | { |
| 0 | 47 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.Get"); |
| 0 | 48 | | scope.Start(); |
| | 49 | | try |
| | 50 | | { |
| 0 | 51 | | return await RestClient.GetAsync(resourceGroupName, vmName, vmExtensionName, expand, cancellationToken). |
| | 52 | | } |
| 0 | 53 | | catch (Exception e) |
| | 54 | | { |
| 0 | 55 | | scope.Failed(e); |
| 0 | 56 | | throw; |
| | 57 | | } |
| 0 | 58 | | } |
| | 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 | | { |
| 0 | 68 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.Get"); |
| 0 | 69 | | scope.Start(); |
| | 70 | | try |
| | 71 | | { |
| 0 | 72 | | return RestClient.Get(resourceGroupName, vmName, vmExtensionName, expand, cancellationToken); |
| | 73 | | } |
| 0 | 74 | | catch (Exception e) |
| | 75 | | { |
| 0 | 76 | | scope.Failed(e); |
| 0 | 77 | | throw; |
| | 78 | | } |
| 0 | 79 | | } |
| | 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 | | { |
| 0 | 88 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.List"); |
| 0 | 89 | | scope.Start(); |
| | 90 | | try |
| | 91 | | { |
| 0 | 92 | | return await RestClient.ListAsync(resourceGroupName, vmName, expand, cancellationToken).ConfigureAwait(f |
| | 93 | | } |
| 0 | 94 | | catch (Exception e) |
| | 95 | | { |
| 0 | 96 | | scope.Failed(e); |
| 0 | 97 | | throw; |
| | 98 | | } |
| 0 | 99 | | } |
| | 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 | | { |
| 0 | 108 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.List"); |
| 0 | 109 | | scope.Start(); |
| | 110 | | try |
| | 111 | | { |
| 0 | 112 | | return RestClient.List(resourceGroupName, vmName, expand, cancellationToken); |
| | 113 | | } |
| 0 | 114 | | catch (Exception e) |
| | 115 | | { |
| 0 | 116 | | scope.Failed(e); |
| 0 | 117 | | throw; |
| | 118 | | } |
| 0 | 119 | | } |
| | 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 | | { |
| 0 | 129 | | if (resourceGroupName == null) |
| | 130 | | { |
| 0 | 131 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 132 | | } |
| 0 | 133 | | if (vmName == null) |
| | 134 | | { |
| 0 | 135 | | throw new ArgumentNullException(nameof(vmName)); |
| | 136 | | } |
| 0 | 137 | | if (vmExtensionName == null) |
| | 138 | | { |
| 0 | 139 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 140 | | } |
| 0 | 141 | | if (extensionParameters == null) |
| | 142 | | { |
| 0 | 143 | | throw new ArgumentNullException(nameof(extensionParameters)); |
| | 144 | | } |
| | 145 | |
|
| 0 | 146 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartCreateOrUpdate"); |
| 0 | 147 | | scope.Start(); |
| | 148 | | try |
| | 149 | | { |
| 0 | 150 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, |
| 0 | 151 | | return new VirtualMachineExtensionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Cre |
| | 152 | | } |
| 0 | 153 | | catch (Exception e) |
| | 154 | | { |
| 0 | 155 | | scope.Failed(e); |
| 0 | 156 | | throw; |
| | 157 | | } |
| 0 | 158 | | } |
| | 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 | | { |
| 0 | 168 | | if (resourceGroupName == null) |
| | 169 | | { |
| 0 | 170 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 171 | | } |
| 0 | 172 | | if (vmName == null) |
| | 173 | | { |
| 0 | 174 | | throw new ArgumentNullException(nameof(vmName)); |
| | 175 | | } |
| 0 | 176 | | if (vmExtensionName == null) |
| | 177 | | { |
| 0 | 178 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 179 | | } |
| 0 | 180 | | if (extensionParameters == null) |
| | 181 | | { |
| 0 | 182 | | throw new ArgumentNullException(nameof(extensionParameters)); |
| | 183 | | } |
| | 184 | |
|
| 0 | 185 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartCreateOrUpdate"); |
| 0 | 186 | | scope.Start(); |
| | 187 | | try |
| | 188 | | { |
| 0 | 189 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, vmName, vmExtensionName, extensionPa |
| 0 | 190 | | return new VirtualMachineExtensionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Cre |
| | 191 | | } |
| 0 | 192 | | catch (Exception e) |
| | 193 | | { |
| 0 | 194 | | scope.Failed(e); |
| 0 | 195 | | throw; |
| | 196 | | } |
| 0 | 197 | | } |
| | 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 | | { |
| 0 | 207 | | if (resourceGroupName == null) |
| | 208 | | { |
| 0 | 209 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 210 | | } |
| 0 | 211 | | if (vmName == null) |
| | 212 | | { |
| 0 | 213 | | throw new ArgumentNullException(nameof(vmName)); |
| | 214 | | } |
| 0 | 215 | | if (vmExtensionName == null) |
| | 216 | | { |
| 0 | 217 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 218 | | } |
| 0 | 219 | | if (extensionParameters == null) |
| | 220 | | { |
| 0 | 221 | | throw new ArgumentNullException(nameof(extensionParameters)); |
| | 222 | | } |
| | 223 | |
|
| 0 | 224 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartUpdate"); |
| 0 | 225 | | scope.Start(); |
| | 226 | | try |
| | 227 | | { |
| 0 | 228 | | var originalResponse = await RestClient.UpdateAsync(resourceGroupName, vmName, vmExtensionName, extensio |
| 0 | 229 | | return new VirtualMachineExtensionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdat |
| | 230 | | } |
| 0 | 231 | | catch (Exception e) |
| | 232 | | { |
| 0 | 233 | | scope.Failed(e); |
| 0 | 234 | | throw; |
| | 235 | | } |
| 0 | 236 | | } |
| | 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 | | { |
| 0 | 246 | | if (resourceGroupName == null) |
| | 247 | | { |
| 0 | 248 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 249 | | } |
| 0 | 250 | | if (vmName == null) |
| | 251 | | { |
| 0 | 252 | | throw new ArgumentNullException(nameof(vmName)); |
| | 253 | | } |
| 0 | 254 | | if (vmExtensionName == null) |
| | 255 | | { |
| 0 | 256 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 257 | | } |
| 0 | 258 | | if (extensionParameters == null) |
| | 259 | | { |
| 0 | 260 | | throw new ArgumentNullException(nameof(extensionParameters)); |
| | 261 | | } |
| | 262 | |
|
| 0 | 263 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartUpdate"); |
| 0 | 264 | | scope.Start(); |
| | 265 | | try |
| | 266 | | { |
| 0 | 267 | | var originalResponse = RestClient.Update(resourceGroupName, vmName, vmExtensionName, extensionParameters |
| 0 | 268 | | return new VirtualMachineExtensionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdat |
| | 269 | | } |
| 0 | 270 | | catch (Exception e) |
| | 271 | | { |
| 0 | 272 | | scope.Failed(e); |
| 0 | 273 | | throw; |
| | 274 | | } |
| 0 | 275 | | } |
| | 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 | | { |
| 0 | 284 | | if (resourceGroupName == null) |
| | 285 | | { |
| 0 | 286 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 287 | | } |
| 0 | 288 | | if (vmName == null) |
| | 289 | | { |
| 0 | 290 | | throw new ArgumentNullException(nameof(vmName)); |
| | 291 | | } |
| 0 | 292 | | if (vmExtensionName == null) |
| | 293 | | { |
| 0 | 294 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 295 | | } |
| | 296 | |
|
| 0 | 297 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartDelete"); |
| 0 | 298 | | scope.Start(); |
| | 299 | | try |
| | 300 | | { |
| 0 | 301 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, vmName, vmExtensionName, cancella |
| 0 | 302 | | return new VirtualMachineExtensionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelet |
| | 303 | | } |
| 0 | 304 | | catch (Exception e) |
| | 305 | | { |
| 0 | 306 | | scope.Failed(e); |
| 0 | 307 | | throw; |
| | 308 | | } |
| 0 | 309 | | } |
| | 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 | | { |
| 0 | 318 | | if (resourceGroupName == null) |
| | 319 | | { |
| 0 | 320 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 321 | | } |
| 0 | 322 | | if (vmName == null) |
| | 323 | | { |
| 0 | 324 | | throw new ArgumentNullException(nameof(vmName)); |
| | 325 | | } |
| 0 | 326 | | if (vmExtensionName == null) |
| | 327 | | { |
| 0 | 328 | | throw new ArgumentNullException(nameof(vmExtensionName)); |
| | 329 | | } |
| | 330 | |
|
| 0 | 331 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionsOperations.StartDelete"); |
| 0 | 332 | | scope.Start(); |
| | 333 | | try |
| | 334 | | { |
| 0 | 335 | | var originalResponse = RestClient.Delete(resourceGroupName, vmName, vmExtensionName, cancellationToken); |
| 0 | 336 | | return new VirtualMachineExtensionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDelet |
| | 337 | | } |
| 0 | 338 | | catch (Exception e) |
| | 339 | | { |
| 0 | 340 | | scope.Failed(e); |
| 0 | 341 | | throw; |
| | 342 | | } |
| 0 | 343 | | } |
| | 344 | | } |
| | 345 | | } |