| | | 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.Network.Models; |
| | | 15 | | |
| | | 16 | | namespace Azure.ResourceManager.Network |
| | | 17 | | { |
| | | 18 | | /// <summary> The PublicIPAddresses service client. </summary> |
| | | 19 | | public partial class PublicIPAddressesOperations |
| | | 20 | | { |
| | | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | | 22 | | private readonly HttpPipeline _pipeline; |
| | 324 | 23 | | internal PublicIPAddressesRestOperations RestClient { get; } |
| | | 24 | | /// <summary> Initializes a new instance of PublicIPAddressesOperations for mocking. </summary> |
| | 220 | 25 | | protected PublicIPAddressesOperations() |
| | | 26 | | { |
| | 220 | 27 | | } |
| | | 28 | | /// <summary> Initializes a new instance of PublicIPAddressesOperations. </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"> The subscription credentials which uniquely identify the Microsoft Azure subsc |
| | | 32 | | /// <param name="endpoint"> server parameter. </param> |
| | 220 | 33 | | internal PublicIPAddressesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscrip |
| | | 34 | | { |
| | 220 | 35 | | RestClient = new PublicIPAddressesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| | 220 | 36 | | _clientDiagnostics = clientDiagnostics; |
| | 220 | 37 | | _pipeline = pipeline; |
| | 220 | 38 | | } |
| | | 39 | | |
| | | 40 | | /// <summary> Gets the specified public IP address in a specified resource group. </summary> |
| | | 41 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 42 | | /// <param name="publicIpAddressName"> The name of the subnet. </param> |
| | | 43 | | /// <param name="expand"> Expands referenced resources. </param> |
| | | 44 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 45 | | public virtual async Task<Response<PublicIPAddress>> GetAsync(string resourceGroupName, string publicIpAddressNa |
| | | 46 | | { |
| | 32 | 47 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.Get"); |
| | 32 | 48 | | scope.Start(); |
| | | 49 | | try |
| | | 50 | | { |
| | 32 | 51 | | return await RestClient.GetAsync(resourceGroupName, publicIpAddressName, expand, cancellationToken).Conf |
| | | 52 | | } |
| | 0 | 53 | | catch (Exception e) |
| | | 54 | | { |
| | 0 | 55 | | scope.Failed(e); |
| | 0 | 56 | | throw; |
| | | 57 | | } |
| | 32 | 58 | | } |
| | | 59 | | |
| | | 60 | | /// <summary> Gets the specified public IP address in a specified resource group. </summary> |
| | | 61 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 62 | | /// <param name="publicIpAddressName"> The name of the subnet. </param> |
| | | 63 | | /// <param name="expand"> Expands referenced resources. </param> |
| | | 64 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 65 | | public virtual Response<PublicIPAddress> Get(string resourceGroupName, string publicIpAddressName, string expand |
| | | 66 | | { |
| | 32 | 67 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.Get"); |
| | 32 | 68 | | scope.Start(); |
| | | 69 | | try |
| | | 70 | | { |
| | 32 | 71 | | return RestClient.Get(resourceGroupName, publicIpAddressName, expand, cancellationToken); |
| | | 72 | | } |
| | 0 | 73 | | catch (Exception e) |
| | | 74 | | { |
| | 0 | 75 | | scope.Failed(e); |
| | 0 | 76 | | throw; |
| | | 77 | | } |
| | 32 | 78 | | } |
| | | 79 | | |
| | | 80 | | /// <summary> Updates public IP address tags. </summary> |
| | | 81 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 82 | | /// <param name="publicIpAddressName"> The name of the public IP address. </param> |
| | | 83 | | /// <param name="parameters"> Parameters supplied to update public IP address tags. </param> |
| | | 84 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 85 | | public virtual async Task<Response<PublicIPAddress>> UpdateTagsAsync(string resourceGroupName, string publicIpAd |
| | | 86 | | { |
| | 0 | 87 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.UpdateTags"); |
| | 0 | 88 | | scope.Start(); |
| | | 89 | | try |
| | | 90 | | { |
| | 0 | 91 | | return await RestClient.UpdateTagsAsync(resourceGroupName, publicIpAddressName, parameters, cancellation |
| | | 92 | | } |
| | 0 | 93 | | catch (Exception e) |
| | | 94 | | { |
| | 0 | 95 | | scope.Failed(e); |
| | 0 | 96 | | throw; |
| | | 97 | | } |
| | 0 | 98 | | } |
| | | 99 | | |
| | | 100 | | /// <summary> Updates public IP address tags. </summary> |
| | | 101 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 102 | | /// <param name="publicIpAddressName"> The name of the public IP address. </param> |
| | | 103 | | /// <param name="parameters"> Parameters supplied to update public IP address tags. </param> |
| | | 104 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 105 | | public virtual Response<PublicIPAddress> UpdateTags(string resourceGroupName, string publicIpAddressName, TagsOb |
| | | 106 | | { |
| | 0 | 107 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.UpdateTags"); |
| | 0 | 108 | | scope.Start(); |
| | | 109 | | try |
| | | 110 | | { |
| | 0 | 111 | | return RestClient.UpdateTags(resourceGroupName, publicIpAddressName, parameters, cancellationToken); |
| | | 112 | | } |
| | 0 | 113 | | catch (Exception e) |
| | | 114 | | { |
| | 0 | 115 | | scope.Failed(e); |
| | 0 | 116 | | throw; |
| | | 117 | | } |
| | 0 | 118 | | } |
| | | 119 | | |
| | | 120 | | /// <summary> Get the specified public IP address in a virtual machine scale set. </summary> |
| | | 121 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 122 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | | 123 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | | 124 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | | 125 | | /// <param name="ipConfigurationName"> The name of the IP configuration. </param> |
| | | 126 | | /// <param name="publicIpAddressName"> The name of the public IP Address. </param> |
| | | 127 | | /// <param name="expand"> Expands referenced resources. </param> |
| | | 128 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 129 | | public virtual async Task<Response<PublicIPAddress>> GetVirtualMachineScaleSetPublicIPAddressAsync(string resour |
| | | 130 | | { |
| | 2 | 131 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.GetVirtualMachineScaleSetPubli |
| | 2 | 132 | | scope.Start(); |
| | | 133 | | try |
| | | 134 | | { |
| | 2 | 135 | | return await RestClient.GetVirtualMachineScaleSetPublicIPAddressAsync(resourceGroupName, virtualMachineS |
| | | 136 | | } |
| | 0 | 137 | | catch (Exception e) |
| | | 138 | | { |
| | 0 | 139 | | scope.Failed(e); |
| | 0 | 140 | | throw; |
| | | 141 | | } |
| | 2 | 142 | | } |
| | | 143 | | |
| | | 144 | | /// <summary> Get the specified public IP address in a virtual machine scale set. </summary> |
| | | 145 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 146 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | | 147 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | | 148 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | | 149 | | /// <param name="ipConfigurationName"> The name of the IP configuration. </param> |
| | | 150 | | /// <param name="publicIpAddressName"> The name of the public IP Address. </param> |
| | | 151 | | /// <param name="expand"> Expands referenced resources. </param> |
| | | 152 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 153 | | public virtual Response<PublicIPAddress> GetVirtualMachineScaleSetPublicIPAddress(string resourceGroupName, stri |
| | | 154 | | { |
| | 2 | 155 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.GetVirtualMachineScaleSetPubli |
| | 2 | 156 | | scope.Start(); |
| | | 157 | | try |
| | | 158 | | { |
| | 2 | 159 | | return RestClient.GetVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName |
| | | 160 | | } |
| | 0 | 161 | | catch (Exception e) |
| | | 162 | | { |
| | 0 | 163 | | scope.Failed(e); |
| | 0 | 164 | | throw; |
| | | 165 | | } |
| | 2 | 166 | | } |
| | | 167 | | |
| | | 168 | | /// <summary> Gets all the public IP addresses in a subscription. </summary> |
| | | 169 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 170 | | public virtual AsyncPageable<PublicIPAddress> ListAllAsync(CancellationToken cancellationToken = default) |
| | | 171 | | { |
| | | 172 | | async Task<Page<PublicIPAddress>> FirstPageFunc(int? pageSizeHint) |
| | | 173 | | { |
| | 6 | 174 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListAll"); |
| | 6 | 175 | | scope.Start(); |
| | | 176 | | try |
| | | 177 | | { |
| | 6 | 178 | | var response = await RestClient.ListAllAsync(cancellationToken).ConfigureAwait(false); |
| | 6 | 179 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 180 | | } |
| | 0 | 181 | | catch (Exception e) |
| | | 182 | | { |
| | 0 | 183 | | scope.Failed(e); |
| | 0 | 184 | | throw; |
| | | 185 | | } |
| | 6 | 186 | | } |
| | | 187 | | async Task<Page<PublicIPAddress>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 188 | | { |
| | 0 | 189 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListAll"); |
| | 0 | 190 | | scope.Start(); |
| | | 191 | | try |
| | | 192 | | { |
| | 0 | 193 | | var response = await RestClient.ListAllNextPageAsync(nextLink, cancellationToken).ConfigureAwait(fal |
| | 0 | 194 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 195 | | } |
| | 0 | 196 | | catch (Exception e) |
| | | 197 | | { |
| | 0 | 198 | | scope.Failed(e); |
| | 0 | 199 | | throw; |
| | | 200 | | } |
| | 0 | 201 | | } |
| | 6 | 202 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | | 203 | | } |
| | | 204 | | |
| | | 205 | | /// <summary> Gets all the public IP addresses in a subscription. </summary> |
| | | 206 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 207 | | public virtual Pageable<PublicIPAddress> ListAll(CancellationToken cancellationToken = default) |
| | | 208 | | { |
| | | 209 | | Page<PublicIPAddress> FirstPageFunc(int? pageSizeHint) |
| | | 210 | | { |
| | 6 | 211 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListAll"); |
| | 6 | 212 | | scope.Start(); |
| | | 213 | | try |
| | | 214 | | { |
| | 6 | 215 | | var response = RestClient.ListAll(cancellationToken); |
| | 6 | 216 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 217 | | } |
| | 0 | 218 | | catch (Exception e) |
| | | 219 | | { |
| | 0 | 220 | | scope.Failed(e); |
| | 0 | 221 | | throw; |
| | | 222 | | } |
| | 6 | 223 | | } |
| | | 224 | | Page<PublicIPAddress> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 225 | | { |
| | 0 | 226 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListAll"); |
| | 0 | 227 | | scope.Start(); |
| | | 228 | | try |
| | | 229 | | { |
| | 0 | 230 | | var response = RestClient.ListAllNextPage(nextLink, cancellationToken); |
| | 0 | 231 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 232 | | } |
| | 0 | 233 | | catch (Exception e) |
| | | 234 | | { |
| | 0 | 235 | | scope.Failed(e); |
| | 0 | 236 | | throw; |
| | | 237 | | } |
| | 0 | 238 | | } |
| | 6 | 239 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | | 240 | | } |
| | | 241 | | |
| | | 242 | | /// <summary> Gets all public IP addresses in a resource group. </summary> |
| | | 243 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 244 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 245 | | public virtual AsyncPageable<PublicIPAddress> ListAsync(string resourceGroupName, CancellationToken cancellation |
| | | 246 | | { |
| | 12 | 247 | | if (resourceGroupName == null) |
| | | 248 | | { |
| | 0 | 249 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 250 | | } |
| | | 251 | | |
| | | 252 | | async Task<Page<PublicIPAddress>> FirstPageFunc(int? pageSizeHint) |
| | | 253 | | { |
| | 12 | 254 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.List"); |
| | 12 | 255 | | scope.Start(); |
| | | 256 | | try |
| | | 257 | | { |
| | 12 | 258 | | var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false |
| | 12 | 259 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 260 | | } |
| | 0 | 261 | | catch (Exception e) |
| | | 262 | | { |
| | 0 | 263 | | scope.Failed(e); |
| | 0 | 264 | | throw; |
| | | 265 | | } |
| | 12 | 266 | | } |
| | | 267 | | async Task<Page<PublicIPAddress>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 268 | | { |
| | 0 | 269 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.List"); |
| | 0 | 270 | | scope.Start(); |
| | | 271 | | try |
| | | 272 | | { |
| | 0 | 273 | | var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, cancellationToken).Co |
| | 0 | 274 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 275 | | } |
| | 0 | 276 | | catch (Exception e) |
| | | 277 | | { |
| | 0 | 278 | | scope.Failed(e); |
| | 0 | 279 | | throw; |
| | | 280 | | } |
| | 0 | 281 | | } |
| | 12 | 282 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | | 283 | | } |
| | | 284 | | |
| | | 285 | | /// <summary> Gets all public IP addresses in a resource group. </summary> |
| | | 286 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 287 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 288 | | public virtual Pageable<PublicIPAddress> List(string resourceGroupName, CancellationToken cancellationToken = de |
| | | 289 | | { |
| | 12 | 290 | | if (resourceGroupName == null) |
| | | 291 | | { |
| | 0 | 292 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 293 | | } |
| | | 294 | | |
| | | 295 | | Page<PublicIPAddress> FirstPageFunc(int? pageSizeHint) |
| | | 296 | | { |
| | 12 | 297 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.List"); |
| | 12 | 298 | | scope.Start(); |
| | | 299 | | try |
| | | 300 | | { |
| | 12 | 301 | | var response = RestClient.List(resourceGroupName, cancellationToken); |
| | 12 | 302 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 303 | | } |
| | 0 | 304 | | catch (Exception e) |
| | | 305 | | { |
| | 0 | 306 | | scope.Failed(e); |
| | 0 | 307 | | throw; |
| | | 308 | | } |
| | 12 | 309 | | } |
| | | 310 | | Page<PublicIPAddress> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 311 | | { |
| | 0 | 312 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.List"); |
| | 0 | 313 | | scope.Start(); |
| | | 314 | | try |
| | | 315 | | { |
| | 0 | 316 | | var response = RestClient.ListNextPage(nextLink, resourceGroupName, cancellationToken); |
| | 0 | 317 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 318 | | } |
| | 0 | 319 | | catch (Exception e) |
| | | 320 | | { |
| | 0 | 321 | | scope.Failed(e); |
| | 0 | 322 | | throw; |
| | | 323 | | } |
| | 0 | 324 | | } |
| | 12 | 325 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | | 326 | | } |
| | | 327 | | |
| | | 328 | | /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary> |
| | | 329 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 330 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | | 331 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 332 | | public virtual AsyncPageable<PublicIPAddress> ListVirtualMachineScaleSetPublicIPAddressesAsync(string resourceGr |
| | | 333 | | { |
| | 4 | 334 | | if (resourceGroupName == null) |
| | | 335 | | { |
| | 0 | 336 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 337 | | } |
| | 4 | 338 | | if (virtualMachineScaleSetName == null) |
| | | 339 | | { |
| | 0 | 340 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | | 341 | | } |
| | | 342 | | |
| | | 343 | | async Task<Page<PublicIPAddress>> FirstPageFunc(int? pageSizeHint) |
| | | 344 | | { |
| | 4 | 345 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet |
| | 4 | 346 | | scope.Start(); |
| | | 347 | | try |
| | | 348 | | { |
| | 4 | 349 | | var response = await RestClient.ListVirtualMachineScaleSetPublicIPAddressesAsync(resourceGroupName, |
| | 4 | 350 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 351 | | } |
| | 0 | 352 | | catch (Exception e) |
| | | 353 | | { |
| | 0 | 354 | | scope.Failed(e); |
| | 0 | 355 | | throw; |
| | | 356 | | } |
| | 4 | 357 | | } |
| | | 358 | | async Task<Page<PublicIPAddress>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 359 | | { |
| | 0 | 360 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet |
| | 0 | 361 | | scope.Start(); |
| | | 362 | | try |
| | | 363 | | { |
| | 0 | 364 | | var response = await RestClient.ListVirtualMachineScaleSetPublicIPAddressesNextPageAsync(nextLink, r |
| | 0 | 365 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 366 | | } |
| | 0 | 367 | | catch (Exception e) |
| | | 368 | | { |
| | 0 | 369 | | scope.Failed(e); |
| | 0 | 370 | | throw; |
| | | 371 | | } |
| | 0 | 372 | | } |
| | 4 | 373 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | | 374 | | } |
| | | 375 | | |
| | | 376 | | /// <summary> Gets information about all public IP addresses on a virtual machine scale set level. </summary> |
| | | 377 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 378 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | | 379 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 380 | | public virtual Pageable<PublicIPAddress> ListVirtualMachineScaleSetPublicIPAddresses(string resourceGroupName, s |
| | | 381 | | { |
| | 4 | 382 | | if (resourceGroupName == null) |
| | | 383 | | { |
| | 0 | 384 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 385 | | } |
| | 4 | 386 | | if (virtualMachineScaleSetName == null) |
| | | 387 | | { |
| | 0 | 388 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | | 389 | | } |
| | | 390 | | |
| | | 391 | | Page<PublicIPAddress> FirstPageFunc(int? pageSizeHint) |
| | | 392 | | { |
| | 4 | 393 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet |
| | 4 | 394 | | scope.Start(); |
| | | 395 | | try |
| | | 396 | | { |
| | 4 | 397 | | var response = RestClient.ListVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMach |
| | 4 | 398 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 399 | | } |
| | 0 | 400 | | catch (Exception e) |
| | | 401 | | { |
| | 0 | 402 | | scope.Failed(e); |
| | 0 | 403 | | throw; |
| | | 404 | | } |
| | 4 | 405 | | } |
| | | 406 | | Page<PublicIPAddress> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 407 | | { |
| | 0 | 408 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet |
| | 0 | 409 | | scope.Start(); |
| | | 410 | | try |
| | | 411 | | { |
| | 0 | 412 | | var response = RestClient.ListVirtualMachineScaleSetPublicIPAddressesNextPage(nextLink, resourceGrou |
| | 0 | 413 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 414 | | } |
| | 0 | 415 | | catch (Exception e) |
| | | 416 | | { |
| | 0 | 417 | | scope.Failed(e); |
| | 0 | 418 | | throw; |
| | | 419 | | } |
| | 0 | 420 | | } |
| | 4 | 421 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | | 422 | | } |
| | | 423 | | |
| | | 424 | | /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual |
| | | 425 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 426 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | | 427 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | | 428 | | /// <param name="networkInterfaceName"> The network interface name. </param> |
| | | 429 | | /// <param name="ipConfigurationName"> The IP configuration name. </param> |
| | | 430 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 431 | | public virtual AsyncPageable<PublicIPAddress> ListVirtualMachineScaleSetVMPublicIPAddressesAsync(string resource |
| | | 432 | | { |
| | 2 | 433 | | if (resourceGroupName == null) |
| | | 434 | | { |
| | 0 | 435 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 436 | | } |
| | 2 | 437 | | if (virtualMachineScaleSetName == null) |
| | | 438 | | { |
| | 0 | 439 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | | 440 | | } |
| | 2 | 441 | | if (virtualmachineIndex == null) |
| | | 442 | | { |
| | 0 | 443 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | | 444 | | } |
| | 2 | 445 | | if (networkInterfaceName == null) |
| | | 446 | | { |
| | 0 | 447 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | | 448 | | } |
| | 2 | 449 | | if (ipConfigurationName == null) |
| | | 450 | | { |
| | 0 | 451 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | | 452 | | } |
| | | 453 | | |
| | | 454 | | async Task<Page<PublicIPAddress>> FirstPageFunc(int? pageSizeHint) |
| | | 455 | | { |
| | 2 | 456 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet |
| | 2 | 457 | | scope.Start(); |
| | | 458 | | try |
| | | 459 | | { |
| | 2 | 460 | | var response = await RestClient.ListVirtualMachineScaleSetVMPublicIPAddressesAsync(resourceGroupName |
| | 2 | 461 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 462 | | } |
| | 0 | 463 | | catch (Exception e) |
| | | 464 | | { |
| | 0 | 465 | | scope.Failed(e); |
| | 0 | 466 | | throw; |
| | | 467 | | } |
| | 2 | 468 | | } |
| | | 469 | | async Task<Page<PublicIPAddress>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 470 | | { |
| | 0 | 471 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet |
| | 0 | 472 | | scope.Start(); |
| | | 473 | | try |
| | | 474 | | { |
| | 0 | 475 | | var response = await RestClient.ListVirtualMachineScaleSetVMPublicIPAddressesNextPageAsync(nextLink, |
| | 0 | 476 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 477 | | } |
| | 0 | 478 | | catch (Exception e) |
| | | 479 | | { |
| | 0 | 480 | | scope.Failed(e); |
| | 0 | 481 | | throw; |
| | | 482 | | } |
| | 0 | 483 | | } |
| | 2 | 484 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | | 485 | | } |
| | | 486 | | |
| | | 487 | | /// <summary> Gets information about all public IP addresses in a virtual machine IP configuration in a virtual |
| | | 488 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 489 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | | 490 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | | 491 | | /// <param name="networkInterfaceName"> The network interface name. </param> |
| | | 492 | | /// <param name="ipConfigurationName"> The IP configuration name. </param> |
| | | 493 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 494 | | public virtual Pageable<PublicIPAddress> ListVirtualMachineScaleSetVMPublicIPAddresses(string resourceGroupName, |
| | | 495 | | { |
| | 2 | 496 | | if (resourceGroupName == null) |
| | | 497 | | { |
| | 0 | 498 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 499 | | } |
| | 2 | 500 | | if (virtualMachineScaleSetName == null) |
| | | 501 | | { |
| | 0 | 502 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | | 503 | | } |
| | 2 | 504 | | if (virtualmachineIndex == null) |
| | | 505 | | { |
| | 0 | 506 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | | 507 | | } |
| | 2 | 508 | | if (networkInterfaceName == null) |
| | | 509 | | { |
| | 0 | 510 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | | 511 | | } |
| | 2 | 512 | | if (ipConfigurationName == null) |
| | | 513 | | { |
| | 0 | 514 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | | 515 | | } |
| | | 516 | | |
| | | 517 | | Page<PublicIPAddress> FirstPageFunc(int? pageSizeHint) |
| | | 518 | | { |
| | 2 | 519 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet |
| | 2 | 520 | | scope.Start(); |
| | | 521 | | try |
| | | 522 | | { |
| | 2 | 523 | | var response = RestClient.ListVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMa |
| | 2 | 524 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 525 | | } |
| | 0 | 526 | | catch (Exception e) |
| | | 527 | | { |
| | 0 | 528 | | scope.Failed(e); |
| | 0 | 529 | | throw; |
| | | 530 | | } |
| | 2 | 531 | | } |
| | | 532 | | Page<PublicIPAddress> NextPageFunc(string nextLink, int? pageSizeHint) |
| | | 533 | | { |
| | 0 | 534 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.ListVirtualMachineScaleSet |
| | 0 | 535 | | scope.Start(); |
| | | 536 | | try |
| | | 537 | | { |
| | 0 | 538 | | var response = RestClient.ListVirtualMachineScaleSetVMPublicIPAddressesNextPage(nextLink, resourceGr |
| | 0 | 539 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | | 540 | | } |
| | 0 | 541 | | catch (Exception e) |
| | | 542 | | { |
| | 0 | 543 | | scope.Failed(e); |
| | 0 | 544 | | throw; |
| | | 545 | | } |
| | 0 | 546 | | } |
| | 2 | 547 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | | 548 | | } |
| | | 549 | | |
| | | 550 | | /// <summary> Deletes the specified public IP address. </summary> |
| | | 551 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 552 | | /// <param name="publicIpAddressName"> The name of the subnet. </param> |
| | | 553 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 554 | | public virtual async Task<PublicIPAddressesDeleteOperation> StartDeleteAsync(string resourceGroupName, string pu |
| | | 555 | | { |
| | 22 | 556 | | if (resourceGroupName == null) |
| | | 557 | | { |
| | 0 | 558 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 559 | | } |
| | 22 | 560 | | if (publicIpAddressName == null) |
| | | 561 | | { |
| | 0 | 562 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | | 563 | | } |
| | | 564 | | |
| | 22 | 565 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.StartDelete"); |
| | 22 | 566 | | scope.Start(); |
| | | 567 | | try |
| | | 568 | | { |
| | 22 | 569 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, publicIpAddressName, cancellation |
| | 22 | 570 | | return new PublicIPAddressesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReques |
| | | 571 | | } |
| | 0 | 572 | | catch (Exception e) |
| | | 573 | | { |
| | 0 | 574 | | scope.Failed(e); |
| | 0 | 575 | | throw; |
| | | 576 | | } |
| | 22 | 577 | | } |
| | | 578 | | |
| | | 579 | | /// <summary> Deletes the specified public IP address. </summary> |
| | | 580 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 581 | | /// <param name="publicIpAddressName"> The name of the subnet. </param> |
| | | 582 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 583 | | public virtual PublicIPAddressesDeleteOperation StartDelete(string resourceGroupName, string publicIpAddressName |
| | | 584 | | { |
| | 22 | 585 | | if (resourceGroupName == null) |
| | | 586 | | { |
| | 0 | 587 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 588 | | } |
| | 22 | 589 | | if (publicIpAddressName == null) |
| | | 590 | | { |
| | 0 | 591 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | | 592 | | } |
| | | 593 | | |
| | 22 | 594 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.StartDelete"); |
| | 22 | 595 | | scope.Start(); |
| | | 596 | | try |
| | | 597 | | { |
| | 22 | 598 | | var originalResponse = RestClient.Delete(resourceGroupName, publicIpAddressName, cancellationToken); |
| | 22 | 599 | | return new PublicIPAddressesDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReques |
| | | 600 | | } |
| | 0 | 601 | | catch (Exception e) |
| | | 602 | | { |
| | 0 | 603 | | scope.Failed(e); |
| | 0 | 604 | | throw; |
| | | 605 | | } |
| | 22 | 606 | | } |
| | | 607 | | |
| | | 608 | | /// <summary> Creates or updates a static or dynamic public IP address. </summary> |
| | | 609 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 610 | | /// <param name="publicIpAddressName"> The name of the public IP address. </param> |
| | | 611 | | /// <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param> |
| | | 612 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 613 | | public virtual async Task<PublicIPAddressesCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGrou |
| | | 614 | | { |
| | 30 | 615 | | if (resourceGroupName == null) |
| | | 616 | | { |
| | 0 | 617 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 618 | | } |
| | 30 | 619 | | if (publicIpAddressName == null) |
| | | 620 | | { |
| | 0 | 621 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | | 622 | | } |
| | 30 | 623 | | if (parameters == null) |
| | | 624 | | { |
| | 0 | 625 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 626 | | } |
| | | 627 | | |
| | 30 | 628 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.StartCreateOrUpdate"); |
| | 30 | 629 | | scope.Start(); |
| | | 630 | | try |
| | | 631 | | { |
| | 30 | 632 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, publicIpAddressName, para |
| | 30 | 633 | | return new PublicIPAddressesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCrea |
| | | 634 | | } |
| | 0 | 635 | | catch (Exception e) |
| | | 636 | | { |
| | 0 | 637 | | scope.Failed(e); |
| | 0 | 638 | | throw; |
| | | 639 | | } |
| | 30 | 640 | | } |
| | | 641 | | |
| | | 642 | | /// <summary> Creates or updates a static or dynamic public IP address. </summary> |
| | | 643 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 644 | | /// <param name="publicIpAddressName"> The name of the public IP address. </param> |
| | | 645 | | /// <param name="parameters"> Parameters supplied to the create or update public IP address operation. </param> |
| | | 646 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 647 | | public virtual PublicIPAddressesCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string pub |
| | | 648 | | { |
| | 30 | 649 | | if (resourceGroupName == null) |
| | | 650 | | { |
| | 0 | 651 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 652 | | } |
| | 30 | 653 | | if (publicIpAddressName == null) |
| | | 654 | | { |
| | 0 | 655 | | throw new ArgumentNullException(nameof(publicIpAddressName)); |
| | | 656 | | } |
| | 30 | 657 | | if (parameters == null) |
| | | 658 | | { |
| | 0 | 659 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 660 | | } |
| | | 661 | | |
| | 30 | 662 | | using var scope = _clientDiagnostics.CreateScope("PublicIPAddressesOperations.StartCreateOrUpdate"); |
| | 30 | 663 | | scope.Start(); |
| | | 664 | | try |
| | | 665 | | { |
| | 30 | 666 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, can |
| | 30 | 667 | | return new PublicIPAddressesCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCrea |
| | | 668 | | } |
| | 0 | 669 | | catch (Exception e) |
| | | 670 | | { |
| | 0 | 671 | | scope.Failed(e); |
| | 0 | 672 | | throw; |
| | | 673 | | } |
| | 30 | 674 | | } |
| | | 675 | | } |
| | | 676 | | } |