| | 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.Text.Json; |
| | 10 | | using System.Threading; |
| | 11 | | using System.Threading.Tasks; |
| | 12 | | using Azure; |
| | 13 | | using Azure.Core; |
| | 14 | | using Azure.Core.Pipeline; |
| | 15 | | using Azure.ResourceManager.Network.Models; |
| | 16 | |
|
| | 17 | | namespace Azure.ResourceManager.Network |
| | 18 | | { |
| | 19 | | internal partial class NetworkInterfacesRestOperations |
| | 20 | | { |
| | 21 | | private string subscriptionId; |
| | 22 | | private Uri endpoint; |
| | 23 | | private ClientDiagnostics _clientDiagnostics; |
| | 24 | | private HttpPipeline _pipeline; |
| | 25 | |
|
| | 26 | | /// <summary> Initializes a new instance of NetworkInterfacesRestOperations. </summary> |
| | 27 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | 28 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | 29 | | /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc |
| | 30 | | /// <param name="endpoint"> server parameter. </param> |
| | 31 | | /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception |
| 524 | 32 | | public NetworkInterfacesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscr |
| | 33 | | { |
| 524 | 34 | | if (subscriptionId == null) |
| | 35 | | { |
| 0 | 36 | | throw new ArgumentNullException(nameof(subscriptionId)); |
| | 37 | | } |
| 524 | 38 | | endpoint ??= new Uri("https://management.azure.com"); |
| | 39 | |
|
| 524 | 40 | | this.subscriptionId = subscriptionId; |
| 524 | 41 | | this.endpoint = endpoint; |
| 524 | 42 | | _clientDiagnostics = clientDiagnostics; |
| 524 | 43 | | _pipeline = pipeline; |
| 524 | 44 | | } |
| | 45 | |
|
| | 46 | | internal HttpMessage CreateDeleteRequest(string resourceGroupName, string networkInterfaceName) |
| | 47 | | { |
| 128 | 48 | | var message = _pipeline.CreateMessage(); |
| 128 | 49 | | var request = message.Request; |
| 128 | 50 | | request.Method = RequestMethod.Delete; |
| 128 | 51 | | var uri = new RawRequestUriBuilder(); |
| 128 | 52 | | uri.Reset(endpoint); |
| 128 | 53 | | uri.AppendPath("/subscriptions/", false); |
| 128 | 54 | | uri.AppendPath(subscriptionId, true); |
| 128 | 55 | | uri.AppendPath("/resourceGroups/", false); |
| 128 | 56 | | uri.AppendPath(resourceGroupName, true); |
| 128 | 57 | | uri.AppendPath("/providers/Microsoft.Network/networkInterfaces/", false); |
| 128 | 58 | | uri.AppendPath(networkInterfaceName, true); |
| 128 | 59 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 128 | 60 | | request.Uri = uri; |
| 128 | 61 | | return message; |
| | 62 | | } |
| | 63 | |
|
| | 64 | | /// <summary> Deletes the specified network interface. </summary> |
| | 65 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 66 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 67 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 68 | | public async Task<Response> DeleteAsync(string resourceGroupName, string networkInterfaceName, CancellationToken |
| | 69 | | { |
| 32 | 70 | | if (resourceGroupName == null) |
| | 71 | | { |
| 0 | 72 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 73 | | } |
| 32 | 74 | | if (networkInterfaceName == null) |
| | 75 | | { |
| 0 | 76 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 77 | | } |
| | 78 | |
|
| 32 | 79 | | using var message = CreateDeleteRequest(resourceGroupName, networkInterfaceName); |
| 32 | 80 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 32 | 81 | | switch (message.Response.Status) |
| | 82 | | { |
| | 83 | | case 200: |
| | 84 | | case 202: |
| | 85 | | case 204: |
| 32 | 86 | | return message.Response; |
| | 87 | | default: |
| 0 | 88 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 89 | | } |
| 32 | 90 | | } |
| | 91 | |
|
| | 92 | | /// <summary> Deletes the specified network interface. </summary> |
| | 93 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 94 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 95 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 96 | | public Response Delete(string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToke |
| | 97 | | { |
| 32 | 98 | | if (resourceGroupName == null) |
| | 99 | | { |
| 0 | 100 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 101 | | } |
| 32 | 102 | | if (networkInterfaceName == null) |
| | 103 | | { |
| 0 | 104 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 105 | | } |
| | 106 | |
|
| 32 | 107 | | using var message = CreateDeleteRequest(resourceGroupName, networkInterfaceName); |
| 32 | 108 | | _pipeline.Send(message, cancellationToken); |
| 32 | 109 | | switch (message.Response.Status) |
| | 110 | | { |
| | 111 | | case 200: |
| | 112 | | case 202: |
| | 113 | | case 204: |
| 32 | 114 | | return message.Response; |
| | 115 | | default: |
| 0 | 116 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 117 | | } |
| 32 | 118 | | } |
| | 119 | |
|
| | 120 | | internal HttpMessage CreateGetRequest(string resourceGroupName, string networkInterfaceName, string expand) |
| | 121 | | { |
| 92 | 122 | | var message = _pipeline.CreateMessage(); |
| 92 | 123 | | var request = message.Request; |
| 92 | 124 | | request.Method = RequestMethod.Get; |
| 92 | 125 | | var uri = new RawRequestUriBuilder(); |
| 92 | 126 | | uri.Reset(endpoint); |
| 92 | 127 | | uri.AppendPath("/subscriptions/", false); |
| 92 | 128 | | uri.AppendPath(subscriptionId, true); |
| 92 | 129 | | uri.AppendPath("/resourceGroups/", false); |
| 92 | 130 | | uri.AppendPath(resourceGroupName, true); |
| 92 | 131 | | uri.AppendPath("/providers/Microsoft.Network/networkInterfaces/", false); |
| 92 | 132 | | uri.AppendPath(networkInterfaceName, true); |
| 92 | 133 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 92 | 134 | | if (expand != null) |
| | 135 | | { |
| 4 | 136 | | uri.AppendQuery("$expand", expand, true); |
| | 137 | | } |
| 92 | 138 | | request.Uri = uri; |
| 92 | 139 | | return message; |
| | 140 | | } |
| | 141 | |
|
| | 142 | | /// <summary> Gets information about the specified network interface. </summary> |
| | 143 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 144 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 145 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 146 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 147 | | public async Task<Response<NetworkInterface>> GetAsync(string resourceGroupName, string networkInterfaceName, st |
| | 148 | | { |
| 46 | 149 | | if (resourceGroupName == null) |
| | 150 | | { |
| 0 | 151 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 152 | | } |
| 46 | 153 | | if (networkInterfaceName == null) |
| | 154 | | { |
| 0 | 155 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 156 | | } |
| | 157 | |
|
| 46 | 158 | | using var message = CreateGetRequest(resourceGroupName, networkInterfaceName, expand); |
| 46 | 159 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 46 | 160 | | switch (message.Response.Status) |
| | 161 | | { |
| | 162 | | case 200: |
| | 163 | | { |
| 46 | 164 | | NetworkInterface value = default; |
| 46 | 165 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 46 | 166 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 167 | | { |
| 0 | 168 | | value = null; |
| | 169 | | } |
| | 170 | | else |
| | 171 | | { |
| 46 | 172 | | value = NetworkInterface.DeserializeNetworkInterface(document.RootElement); |
| | 173 | | } |
| 46 | 174 | | return Response.FromValue(value, message.Response); |
| | 175 | | } |
| | 176 | | default: |
| 0 | 177 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 178 | | } |
| 46 | 179 | | } |
| | 180 | |
|
| | 181 | | /// <summary> Gets information about the specified network interface. </summary> |
| | 182 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 183 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 184 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 185 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 186 | | public Response<NetworkInterface> Get(string resourceGroupName, string networkInterfaceName, string expand = nul |
| | 187 | | { |
| 46 | 188 | | if (resourceGroupName == null) |
| | 189 | | { |
| 0 | 190 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 191 | | } |
| 46 | 192 | | if (networkInterfaceName == null) |
| | 193 | | { |
| 0 | 194 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 195 | | } |
| | 196 | |
|
| 46 | 197 | | using var message = CreateGetRequest(resourceGroupName, networkInterfaceName, expand); |
| 46 | 198 | | _pipeline.Send(message, cancellationToken); |
| 46 | 199 | | switch (message.Response.Status) |
| | 200 | | { |
| | 201 | | case 200: |
| | 202 | | { |
| 46 | 203 | | NetworkInterface value = default; |
| 46 | 204 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 46 | 205 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 206 | | { |
| 0 | 207 | | value = null; |
| | 208 | | } |
| | 209 | | else |
| | 210 | | { |
| 46 | 211 | | value = NetworkInterface.DeserializeNetworkInterface(document.RootElement); |
| | 212 | | } |
| 46 | 213 | | return Response.FromValue(value, message.Response); |
| | 214 | | } |
| | 215 | | default: |
| 0 | 216 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 217 | | } |
| 46 | 218 | | } |
| | 219 | |
|
| | 220 | | internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string networkInterfaceName, NetworkI |
| | 221 | | { |
| 188 | 222 | | var message = _pipeline.CreateMessage(); |
| 188 | 223 | | var request = message.Request; |
| 188 | 224 | | request.Method = RequestMethod.Put; |
| 188 | 225 | | var uri = new RawRequestUriBuilder(); |
| 188 | 226 | | uri.Reset(endpoint); |
| 188 | 227 | | uri.AppendPath("/subscriptions/", false); |
| 188 | 228 | | uri.AppendPath(subscriptionId, true); |
| 188 | 229 | | uri.AppendPath("/resourceGroups/", false); |
| 188 | 230 | | uri.AppendPath(resourceGroupName, true); |
| 188 | 231 | | uri.AppendPath("/providers/Microsoft.Network/networkInterfaces/", false); |
| 188 | 232 | | uri.AppendPath(networkInterfaceName, true); |
| 188 | 233 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 188 | 234 | | request.Uri = uri; |
| 188 | 235 | | request.Headers.Add("Content-Type", "application/json"); |
| 188 | 236 | | var content = new Utf8JsonRequestContent(); |
| 188 | 237 | | content.JsonWriter.WriteObjectValue(parameters); |
| 188 | 238 | | request.Content = content; |
| 188 | 239 | | return message; |
| | 240 | | } |
| | 241 | |
|
| | 242 | | /// <summary> Creates or updates a network interface. </summary> |
| | 243 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 244 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 245 | | /// <param name="parameters"> Parameters supplied to the create or update network interface operation. </param> |
| | 246 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 247 | | public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string networkInterfaceName, NetworkIn |
| | 248 | | { |
| 48 | 249 | | if (resourceGroupName == null) |
| | 250 | | { |
| 0 | 251 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 252 | | } |
| 48 | 253 | | if (networkInterfaceName == null) |
| | 254 | | { |
| 0 | 255 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 256 | | } |
| 48 | 257 | | if (parameters == null) |
| | 258 | | { |
| 0 | 259 | | throw new ArgumentNullException(nameof(parameters)); |
| | 260 | | } |
| | 261 | |
|
| 48 | 262 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, networkInterfaceName, parameters); |
| 48 | 263 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 48 | 264 | | switch (message.Response.Status) |
| | 265 | | { |
| | 266 | | case 200: |
| | 267 | | case 201: |
| 46 | 268 | | return message.Response; |
| | 269 | | default: |
| 2 | 270 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 271 | | } |
| 46 | 272 | | } |
| | 273 | |
|
| | 274 | | /// <summary> Creates or updates a network interface. </summary> |
| | 275 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 276 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 277 | | /// <param name="parameters"> Parameters supplied to the create or update network interface operation. </param> |
| | 278 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 279 | | public Response CreateOrUpdate(string resourceGroupName, string networkInterfaceName, NetworkInterface parameter |
| | 280 | | { |
| 48 | 281 | | if (resourceGroupName == null) |
| | 282 | | { |
| 0 | 283 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 284 | | } |
| 48 | 285 | | if (networkInterfaceName == null) |
| | 286 | | { |
| 0 | 287 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 288 | | } |
| 48 | 289 | | if (parameters == null) |
| | 290 | | { |
| 0 | 291 | | throw new ArgumentNullException(nameof(parameters)); |
| | 292 | | } |
| | 293 | |
|
| 48 | 294 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, networkInterfaceName, parameters); |
| 48 | 295 | | _pipeline.Send(message, cancellationToken); |
| 48 | 296 | | switch (message.Response.Status) |
| | 297 | | { |
| | 298 | | case 200: |
| | 299 | | case 201: |
| 46 | 300 | | return message.Response; |
| | 301 | | default: |
| 2 | 302 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 303 | | } |
| 46 | 304 | | } |
| | 305 | |
|
| | 306 | | internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string networkInterfaceName, TagsObject p |
| | 307 | | { |
| 0 | 308 | | var message = _pipeline.CreateMessage(); |
| 0 | 309 | | var request = message.Request; |
| 0 | 310 | | request.Method = RequestMethod.Patch; |
| 0 | 311 | | var uri = new RawRequestUriBuilder(); |
| 0 | 312 | | uri.Reset(endpoint); |
| 0 | 313 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 314 | | uri.AppendPath(subscriptionId, true); |
| 0 | 315 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 316 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 317 | | uri.AppendPath("/providers/Microsoft.Network/networkInterfaces/", false); |
| 0 | 318 | | uri.AppendPath(networkInterfaceName, true); |
| 0 | 319 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 320 | | request.Uri = uri; |
| 0 | 321 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 322 | | var content = new Utf8JsonRequestContent(); |
| 0 | 323 | | content.JsonWriter.WriteObjectValue(parameters); |
| 0 | 324 | | request.Content = content; |
| 0 | 325 | | return message; |
| | 326 | | } |
| | 327 | |
|
| | 328 | | /// <summary> Updates a network interface tags. </summary> |
| | 329 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 330 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 331 | | /// <param name="parameters"> Parameters supplied to update network interface tags. </param> |
| | 332 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 333 | | public async Task<Response<NetworkInterface>> UpdateTagsAsync(string resourceGroupName, string networkInterfaceN |
| | 334 | | { |
| 0 | 335 | | if (resourceGroupName == null) |
| | 336 | | { |
| 0 | 337 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 338 | | } |
| 0 | 339 | | if (networkInterfaceName == null) |
| | 340 | | { |
| 0 | 341 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 342 | | } |
| 0 | 343 | | if (parameters == null) |
| | 344 | | { |
| 0 | 345 | | throw new ArgumentNullException(nameof(parameters)); |
| | 346 | | } |
| | 347 | |
|
| 0 | 348 | | using var message = CreateUpdateTagsRequest(resourceGroupName, networkInterfaceName, parameters); |
| 0 | 349 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 350 | | switch (message.Response.Status) |
| | 351 | | { |
| | 352 | | case 200: |
| | 353 | | { |
| 0 | 354 | | NetworkInterface value = default; |
| 0 | 355 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 356 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 357 | | { |
| 0 | 358 | | value = null; |
| | 359 | | } |
| | 360 | | else |
| | 361 | | { |
| 0 | 362 | | value = NetworkInterface.DeserializeNetworkInterface(document.RootElement); |
| | 363 | | } |
| 0 | 364 | | return Response.FromValue(value, message.Response); |
| | 365 | | } |
| | 366 | | default: |
| 0 | 367 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 368 | | } |
| 0 | 369 | | } |
| | 370 | |
|
| | 371 | | /// <summary> Updates a network interface tags. </summary> |
| | 372 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 373 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 374 | | /// <param name="parameters"> Parameters supplied to update network interface tags. </param> |
| | 375 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 376 | | public Response<NetworkInterface> UpdateTags(string resourceGroupName, string networkInterfaceName, TagsObject p |
| | 377 | | { |
| 0 | 378 | | if (resourceGroupName == null) |
| | 379 | | { |
| 0 | 380 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 381 | | } |
| 0 | 382 | | if (networkInterfaceName == null) |
| | 383 | | { |
| 0 | 384 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 385 | | } |
| 0 | 386 | | if (parameters == null) |
| | 387 | | { |
| 0 | 388 | | throw new ArgumentNullException(nameof(parameters)); |
| | 389 | | } |
| | 390 | |
|
| 0 | 391 | | using var message = CreateUpdateTagsRequest(resourceGroupName, networkInterfaceName, parameters); |
| 0 | 392 | | _pipeline.Send(message, cancellationToken); |
| 0 | 393 | | switch (message.Response.Status) |
| | 394 | | { |
| | 395 | | case 200: |
| | 396 | | { |
| 0 | 397 | | NetworkInterface value = default; |
| 0 | 398 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 399 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 400 | | { |
| 0 | 401 | | value = null; |
| | 402 | | } |
| | 403 | | else |
| | 404 | | { |
| 0 | 405 | | value = NetworkInterface.DeserializeNetworkInterface(document.RootElement); |
| | 406 | | } |
| 0 | 407 | | return Response.FromValue(value, message.Response); |
| | 408 | | } |
| | 409 | | default: |
| 0 | 410 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 411 | | } |
| 0 | 412 | | } |
| | 413 | |
|
| | 414 | | internal HttpMessage CreateListAllRequest() |
| | 415 | | { |
| 12 | 416 | | var message = _pipeline.CreateMessage(); |
| 12 | 417 | | var request = message.Request; |
| 12 | 418 | | request.Method = RequestMethod.Get; |
| 12 | 419 | | var uri = new RawRequestUriBuilder(); |
| 12 | 420 | | uri.Reset(endpoint); |
| 12 | 421 | | uri.AppendPath("/subscriptions/", false); |
| 12 | 422 | | uri.AppendPath(subscriptionId, true); |
| 12 | 423 | | uri.AppendPath("/providers/Microsoft.Network/networkInterfaces", false); |
| 12 | 424 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 12 | 425 | | request.Uri = uri; |
| 12 | 426 | | return message; |
| | 427 | | } |
| | 428 | |
|
| | 429 | | /// <summary> Gets all network interfaces in a subscription. </summary> |
| | 430 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 431 | | public async Task<Response<NetworkInterfaceListResult>> ListAllAsync(CancellationToken cancellationToken = defau |
| | 432 | | { |
| 6 | 433 | | using var message = CreateListAllRequest(); |
| 6 | 434 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 6 | 435 | | switch (message.Response.Status) |
| | 436 | | { |
| | 437 | | case 200: |
| | 438 | | { |
| 6 | 439 | | NetworkInterfaceListResult value = default; |
| 6 | 440 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 6 | 441 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 442 | | { |
| 0 | 443 | | value = null; |
| | 444 | | } |
| | 445 | | else |
| | 446 | | { |
| 6 | 447 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 448 | | } |
| 6 | 449 | | return Response.FromValue(value, message.Response); |
| | 450 | | } |
| | 451 | | default: |
| 0 | 452 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 453 | | } |
| 6 | 454 | | } |
| | 455 | |
|
| | 456 | | /// <summary> Gets all network interfaces in a subscription. </summary> |
| | 457 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 458 | | public Response<NetworkInterfaceListResult> ListAll(CancellationToken cancellationToken = default) |
| | 459 | | { |
| 6 | 460 | | using var message = CreateListAllRequest(); |
| 6 | 461 | | _pipeline.Send(message, cancellationToken); |
| 6 | 462 | | switch (message.Response.Status) |
| | 463 | | { |
| | 464 | | case 200: |
| | 465 | | { |
| 6 | 466 | | NetworkInterfaceListResult value = default; |
| 6 | 467 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 6 | 468 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 469 | | { |
| 0 | 470 | | value = null; |
| | 471 | | } |
| | 472 | | else |
| | 473 | | { |
| 6 | 474 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 475 | | } |
| 6 | 476 | | return Response.FromValue(value, message.Response); |
| | 477 | | } |
| | 478 | | default: |
| 0 | 479 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 480 | | } |
| 6 | 481 | | } |
| | 482 | |
|
| | 483 | | internal HttpMessage CreateListRequest(string resourceGroupName) |
| | 484 | | { |
| 44 | 485 | | var message = _pipeline.CreateMessage(); |
| 44 | 486 | | var request = message.Request; |
| 44 | 487 | | request.Method = RequestMethod.Get; |
| 44 | 488 | | var uri = new RawRequestUriBuilder(); |
| 44 | 489 | | uri.Reset(endpoint); |
| 44 | 490 | | uri.AppendPath("/subscriptions/", false); |
| 44 | 491 | | uri.AppendPath(subscriptionId, true); |
| 44 | 492 | | uri.AppendPath("/resourceGroups/", false); |
| 44 | 493 | | uri.AppendPath(resourceGroupName, true); |
| 44 | 494 | | uri.AppendPath("/providers/Microsoft.Network/networkInterfaces", false); |
| 44 | 495 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 44 | 496 | | request.Uri = uri; |
| 44 | 497 | | return message; |
| | 498 | | } |
| | 499 | |
|
| | 500 | | /// <summary> Gets all network interfaces in a resource group. </summary> |
| | 501 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 502 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 503 | | public async Task<Response<NetworkInterfaceListResult>> ListAsync(string resourceGroupName, CancellationToken ca |
| | 504 | | { |
| 22 | 505 | | if (resourceGroupName == null) |
| | 506 | | { |
| 0 | 507 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 508 | | } |
| | 509 | |
|
| 22 | 510 | | using var message = CreateListRequest(resourceGroupName); |
| 22 | 511 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 22 | 512 | | switch (message.Response.Status) |
| | 513 | | { |
| | 514 | | case 200: |
| | 515 | | { |
| 22 | 516 | | NetworkInterfaceListResult value = default; |
| 22 | 517 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 22 | 518 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 519 | | { |
| 0 | 520 | | value = null; |
| | 521 | | } |
| | 522 | | else |
| | 523 | | { |
| 22 | 524 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 525 | | } |
| 22 | 526 | | return Response.FromValue(value, message.Response); |
| | 527 | | } |
| | 528 | | default: |
| 0 | 529 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 530 | | } |
| 22 | 531 | | } |
| | 532 | |
|
| | 533 | | /// <summary> Gets all network interfaces in a resource group. </summary> |
| | 534 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 535 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 536 | | public Response<NetworkInterfaceListResult> List(string resourceGroupName, CancellationToken cancellationToken = |
| | 537 | | { |
| 22 | 538 | | if (resourceGroupName == null) |
| | 539 | | { |
| 0 | 540 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 541 | | } |
| | 542 | |
|
| 22 | 543 | | using var message = CreateListRequest(resourceGroupName); |
| 22 | 544 | | _pipeline.Send(message, cancellationToken); |
| 22 | 545 | | switch (message.Response.Status) |
| | 546 | | { |
| | 547 | | case 200: |
| | 548 | | { |
| 22 | 549 | | NetworkInterfaceListResult value = default; |
| 22 | 550 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 22 | 551 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 552 | | { |
| 0 | 553 | | value = null; |
| | 554 | | } |
| | 555 | | else |
| | 556 | | { |
| 22 | 557 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 558 | | } |
| 22 | 559 | | return Response.FromValue(value, message.Response); |
| | 560 | | } |
| | 561 | | default: |
| 0 | 562 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 563 | | } |
| 22 | 564 | | } |
| | 565 | |
|
| | 566 | | internal HttpMessage CreateGetEffectiveRouteTableRequest(string resourceGroupName, string networkInterfaceName) |
| | 567 | | { |
| 0 | 568 | | var message = _pipeline.CreateMessage(); |
| 0 | 569 | | var request = message.Request; |
| 0 | 570 | | request.Method = RequestMethod.Post; |
| 0 | 571 | | var uri = new RawRequestUriBuilder(); |
| 0 | 572 | | uri.Reset(endpoint); |
| 0 | 573 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 574 | | uri.AppendPath(subscriptionId, true); |
| 0 | 575 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 576 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 577 | | uri.AppendPath("/providers/Microsoft.Network/networkInterfaces/", false); |
| 0 | 578 | | uri.AppendPath(networkInterfaceName, true); |
| 0 | 579 | | uri.AppendPath("/effectiveRouteTable", false); |
| 0 | 580 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 581 | | request.Uri = uri; |
| 0 | 582 | | return message; |
| | 583 | | } |
| | 584 | |
|
| | 585 | | /// <summary> Gets all route tables applied to a network interface. </summary> |
| | 586 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 587 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 588 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 589 | | public async Task<Response> GetEffectiveRouteTableAsync(string resourceGroupName, string networkInterfaceName, C |
| | 590 | | { |
| 0 | 591 | | if (resourceGroupName == null) |
| | 592 | | { |
| 0 | 593 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 594 | | } |
| 0 | 595 | | if (networkInterfaceName == null) |
| | 596 | | { |
| 0 | 597 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 598 | | } |
| | 599 | |
|
| 0 | 600 | | using var message = CreateGetEffectiveRouteTableRequest(resourceGroupName, networkInterfaceName); |
| 0 | 601 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 602 | | switch (message.Response.Status) |
| | 603 | | { |
| | 604 | | case 200: |
| | 605 | | case 202: |
| 0 | 606 | | return message.Response; |
| | 607 | | default: |
| 0 | 608 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 609 | | } |
| 0 | 610 | | } |
| | 611 | |
|
| | 612 | | /// <summary> Gets all route tables applied to a network interface. </summary> |
| | 613 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 614 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 615 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 616 | | public Response GetEffectiveRouteTable(string resourceGroupName, string networkInterfaceName, CancellationToken |
| | 617 | | { |
| 0 | 618 | | if (resourceGroupName == null) |
| | 619 | | { |
| 0 | 620 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 621 | | } |
| 0 | 622 | | if (networkInterfaceName == null) |
| | 623 | | { |
| 0 | 624 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 625 | | } |
| | 626 | |
|
| 0 | 627 | | using var message = CreateGetEffectiveRouteTableRequest(resourceGroupName, networkInterfaceName); |
| 0 | 628 | | _pipeline.Send(message, cancellationToken); |
| 0 | 629 | | switch (message.Response.Status) |
| | 630 | | { |
| | 631 | | case 200: |
| | 632 | | case 202: |
| 0 | 633 | | return message.Response; |
| | 634 | | default: |
| 0 | 635 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 636 | | } |
| 0 | 637 | | } |
| | 638 | |
|
| | 639 | | internal HttpMessage CreateListEffectiveNetworkSecurityGroupsRequest(string resourceGroupName, string networkInt |
| | 640 | | { |
| 0 | 641 | | var message = _pipeline.CreateMessage(); |
| 0 | 642 | | var request = message.Request; |
| 0 | 643 | | request.Method = RequestMethod.Post; |
| 0 | 644 | | var uri = new RawRequestUriBuilder(); |
| 0 | 645 | | uri.Reset(endpoint); |
| 0 | 646 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 647 | | uri.AppendPath(subscriptionId, true); |
| 0 | 648 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 649 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 650 | | uri.AppendPath("/providers/Microsoft.Network/networkInterfaces/", false); |
| 0 | 651 | | uri.AppendPath(networkInterfaceName, true); |
| 0 | 652 | | uri.AppendPath("/effectiveNetworkSecurityGroups", false); |
| 0 | 653 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 654 | | request.Uri = uri; |
| 0 | 655 | | return message; |
| | 656 | | } |
| | 657 | |
|
| | 658 | | /// <summary> Gets all network security groups applied to a network interface. </summary> |
| | 659 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 660 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 661 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 662 | | public async Task<Response> ListEffectiveNetworkSecurityGroupsAsync(string resourceGroupName, string networkInte |
| | 663 | | { |
| 0 | 664 | | if (resourceGroupName == null) |
| | 665 | | { |
| 0 | 666 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 667 | | } |
| 0 | 668 | | if (networkInterfaceName == null) |
| | 669 | | { |
| 0 | 670 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 671 | | } |
| | 672 | |
|
| 0 | 673 | | using var message = CreateListEffectiveNetworkSecurityGroupsRequest(resourceGroupName, networkInterfaceName) |
| 0 | 674 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 675 | | switch (message.Response.Status) |
| | 676 | | { |
| | 677 | | case 200: |
| | 678 | | case 202: |
| 0 | 679 | | return message.Response; |
| | 680 | | default: |
| 0 | 681 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 682 | | } |
| 0 | 683 | | } |
| | 684 | |
|
| | 685 | | /// <summary> Gets all network security groups applied to a network interface. </summary> |
| | 686 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 687 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 688 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 689 | | public Response ListEffectiveNetworkSecurityGroups(string resourceGroupName, string networkInterfaceName, Cancel |
| | 690 | | { |
| 0 | 691 | | if (resourceGroupName == null) |
| | 692 | | { |
| 0 | 693 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 694 | | } |
| 0 | 695 | | if (networkInterfaceName == null) |
| | 696 | | { |
| 0 | 697 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 698 | | } |
| | 699 | |
|
| 0 | 700 | | using var message = CreateListEffectiveNetworkSecurityGroupsRequest(resourceGroupName, networkInterfaceName) |
| 0 | 701 | | _pipeline.Send(message, cancellationToken); |
| 0 | 702 | | switch (message.Response.Status) |
| | 703 | | { |
| | 704 | | case 200: |
| | 705 | | case 202: |
| 0 | 706 | | return message.Response; |
| | 707 | | default: |
| 0 | 708 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 709 | | } |
| 0 | 710 | | } |
| | 711 | |
|
| | 712 | | internal HttpMessage CreateListVirtualMachineScaleSetVMNetworkInterfacesRequest(string resourceGroupName, string |
| | 713 | | { |
| 4 | 714 | | var message = _pipeline.CreateMessage(); |
| 4 | 715 | | var request = message.Request; |
| 4 | 716 | | request.Method = RequestMethod.Get; |
| 4 | 717 | | var uri = new RawRequestUriBuilder(); |
| 4 | 718 | | uri.Reset(endpoint); |
| 4 | 719 | | uri.AppendPath("/subscriptions/", false); |
| 4 | 720 | | uri.AppendPath(subscriptionId, true); |
| 4 | 721 | | uri.AppendPath("/resourceGroups/", false); |
| 4 | 722 | | uri.AppendPath(resourceGroupName, true); |
| 4 | 723 | | uri.AppendPath("/providers/microsoft.Compute/virtualMachineScaleSets/", false); |
| 4 | 724 | | uri.AppendPath(virtualMachineScaleSetName, true); |
| 4 | 725 | | uri.AppendPath("/virtualMachines/", false); |
| 4 | 726 | | uri.AppendPath(virtualmachineIndex, true); |
| 4 | 727 | | uri.AppendPath("/networkInterfaces", false); |
| 4 | 728 | | uri.AppendQuery("api-version", "2018-10-01", true); |
| 4 | 729 | | request.Uri = uri; |
| 4 | 730 | | return message; |
| | 731 | | } |
| | 732 | |
|
| | 733 | | /// <summary> Gets information about all network interfaces in a virtual machine in a virtual machine scale set. |
| | 734 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 735 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 736 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 737 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 738 | | public async Task<Response<NetworkInterfaceListResult>> ListVirtualMachineScaleSetVMNetworkInterfacesAsync(strin |
| | 739 | | { |
| 2 | 740 | | if (resourceGroupName == null) |
| | 741 | | { |
| 0 | 742 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 743 | | } |
| 2 | 744 | | if (virtualMachineScaleSetName == null) |
| | 745 | | { |
| 0 | 746 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 747 | | } |
| 2 | 748 | | if (virtualmachineIndex == null) |
| | 749 | | { |
| 0 | 750 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 751 | | } |
| | 752 | |
|
| 2 | 753 | | using var message = CreateListVirtualMachineScaleSetVMNetworkInterfacesRequest(resourceGroupName, virtualMac |
| 2 | 754 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 755 | | switch (message.Response.Status) |
| | 756 | | { |
| | 757 | | case 200: |
| | 758 | | { |
| 2 | 759 | | NetworkInterfaceListResult value = default; |
| 2 | 760 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 2 | 761 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 762 | | { |
| 0 | 763 | | value = null; |
| | 764 | | } |
| | 765 | | else |
| | 766 | | { |
| 2 | 767 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 768 | | } |
| 2 | 769 | | return Response.FromValue(value, message.Response); |
| | 770 | | } |
| | 771 | | default: |
| 0 | 772 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 773 | | } |
| 2 | 774 | | } |
| | 775 | |
|
| | 776 | | /// <summary> Gets information about all network interfaces in a virtual machine in a virtual machine scale set. |
| | 777 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 778 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 779 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 780 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 781 | | public Response<NetworkInterfaceListResult> ListVirtualMachineScaleSetVMNetworkInterfaces(string resourceGroupNa |
| | 782 | | { |
| 2 | 783 | | if (resourceGroupName == null) |
| | 784 | | { |
| 0 | 785 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 786 | | } |
| 2 | 787 | | if (virtualMachineScaleSetName == null) |
| | 788 | | { |
| 0 | 789 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 790 | | } |
| 2 | 791 | | if (virtualmachineIndex == null) |
| | 792 | | { |
| 0 | 793 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 794 | | } |
| | 795 | |
|
| 2 | 796 | | using var message = CreateListVirtualMachineScaleSetVMNetworkInterfacesRequest(resourceGroupName, virtualMac |
| 2 | 797 | | _pipeline.Send(message, cancellationToken); |
| 2 | 798 | | switch (message.Response.Status) |
| | 799 | | { |
| | 800 | | case 200: |
| | 801 | | { |
| 2 | 802 | | NetworkInterfaceListResult value = default; |
| 2 | 803 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 2 | 804 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 805 | | { |
| 0 | 806 | | value = null; |
| | 807 | | } |
| | 808 | | else |
| | 809 | | { |
| 2 | 810 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 811 | | } |
| 2 | 812 | | return Response.FromValue(value, message.Response); |
| | 813 | | } |
| | 814 | | default: |
| 0 | 815 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 816 | | } |
| 2 | 817 | | } |
| | 818 | |
|
| | 819 | | internal HttpMessage CreateListVirtualMachineScaleSetNetworkInterfacesRequest(string resourceGroupName, string v |
| | 820 | | { |
| 4 | 821 | | var message = _pipeline.CreateMessage(); |
| 4 | 822 | | var request = message.Request; |
| 4 | 823 | | request.Method = RequestMethod.Get; |
| 4 | 824 | | var uri = new RawRequestUriBuilder(); |
| 4 | 825 | | uri.Reset(endpoint); |
| 4 | 826 | | uri.AppendPath("/subscriptions/", false); |
| 4 | 827 | | uri.AppendPath(subscriptionId, true); |
| 4 | 828 | | uri.AppendPath("/resourceGroups/", false); |
| 4 | 829 | | uri.AppendPath(resourceGroupName, true); |
| 4 | 830 | | uri.AppendPath("/providers/microsoft.Compute/virtualMachineScaleSets/", false); |
| 4 | 831 | | uri.AppendPath(virtualMachineScaleSetName, true); |
| 4 | 832 | | uri.AppendPath("/networkInterfaces", false); |
| 4 | 833 | | uri.AppendQuery("api-version", "2018-10-01", true); |
| 4 | 834 | | request.Uri = uri; |
| 4 | 835 | | return message; |
| | 836 | | } |
| | 837 | |
|
| | 838 | | /// <summary> Gets all network interfaces in a virtual machine scale set. </summary> |
| | 839 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 840 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 841 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 842 | | public async Task<Response<NetworkInterfaceListResult>> ListVirtualMachineScaleSetNetworkInterfacesAsync(string |
| | 843 | | { |
| 2 | 844 | | if (resourceGroupName == null) |
| | 845 | | { |
| 0 | 846 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 847 | | } |
| 2 | 848 | | if (virtualMachineScaleSetName == null) |
| | 849 | | { |
| 0 | 850 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 851 | | } |
| | 852 | |
|
| 2 | 853 | | using var message = CreateListVirtualMachineScaleSetNetworkInterfacesRequest(resourceGroupName, virtualMachi |
| 2 | 854 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 855 | | switch (message.Response.Status) |
| | 856 | | { |
| | 857 | | case 200: |
| | 858 | | { |
| 2 | 859 | | NetworkInterfaceListResult value = default; |
| 2 | 860 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 2 | 861 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 862 | | { |
| 0 | 863 | | value = null; |
| | 864 | | } |
| | 865 | | else |
| | 866 | | { |
| 2 | 867 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 868 | | } |
| 2 | 869 | | return Response.FromValue(value, message.Response); |
| | 870 | | } |
| | 871 | | default: |
| 0 | 872 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 873 | | } |
| 2 | 874 | | } |
| | 875 | |
|
| | 876 | | /// <summary> Gets all network interfaces in a virtual machine scale set. </summary> |
| | 877 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 878 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 879 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 880 | | public Response<NetworkInterfaceListResult> ListVirtualMachineScaleSetNetworkInterfaces(string resourceGroupName |
| | 881 | | { |
| 2 | 882 | | if (resourceGroupName == null) |
| | 883 | | { |
| 0 | 884 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 885 | | } |
| 2 | 886 | | if (virtualMachineScaleSetName == null) |
| | 887 | | { |
| 0 | 888 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 889 | | } |
| | 890 | |
|
| 2 | 891 | | using var message = CreateListVirtualMachineScaleSetNetworkInterfacesRequest(resourceGroupName, virtualMachi |
| 2 | 892 | | _pipeline.Send(message, cancellationToken); |
| 2 | 893 | | switch (message.Response.Status) |
| | 894 | | { |
| | 895 | | case 200: |
| | 896 | | { |
| 2 | 897 | | NetworkInterfaceListResult value = default; |
| 2 | 898 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 2 | 899 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 900 | | { |
| 0 | 901 | | value = null; |
| | 902 | | } |
| | 903 | | else |
| | 904 | | { |
| 2 | 905 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 906 | | } |
| 2 | 907 | | return Response.FromValue(value, message.Response); |
| | 908 | | } |
| | 909 | | default: |
| 0 | 910 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 911 | | } |
| 2 | 912 | | } |
| | 913 | |
|
| | 914 | | internal HttpMessage CreateGetVirtualMachineScaleSetNetworkInterfaceRequest(string resourceGroupName, string vir |
| | 915 | | { |
| 4 | 916 | | var message = _pipeline.CreateMessage(); |
| 4 | 917 | | var request = message.Request; |
| 4 | 918 | | request.Method = RequestMethod.Get; |
| 4 | 919 | | var uri = new RawRequestUriBuilder(); |
| 4 | 920 | | uri.Reset(endpoint); |
| 4 | 921 | | uri.AppendPath("/subscriptions/", false); |
| 4 | 922 | | uri.AppendPath(subscriptionId, true); |
| 4 | 923 | | uri.AppendPath("/resourceGroups/", false); |
| 4 | 924 | | uri.AppendPath(resourceGroupName, true); |
| 4 | 925 | | uri.AppendPath("/providers/microsoft.Compute/virtualMachineScaleSets/", false); |
| 4 | 926 | | uri.AppendPath(virtualMachineScaleSetName, true); |
| 4 | 927 | | uri.AppendPath("/virtualMachines/", false); |
| 4 | 928 | | uri.AppendPath(virtualmachineIndex, true); |
| 4 | 929 | | uri.AppendPath("/networkInterfaces/", false); |
| 4 | 930 | | uri.AppendPath(networkInterfaceName, true); |
| 4 | 931 | | uri.AppendQuery("api-version", "2018-10-01", true); |
| 4 | 932 | | if (expand != null) |
| | 933 | | { |
| 0 | 934 | | uri.AppendQuery("$expand", expand, true); |
| | 935 | | } |
| 4 | 936 | | request.Uri = uri; |
| 4 | 937 | | return message; |
| | 938 | | } |
| | 939 | |
|
| | 940 | | /// <summary> Get the specified network interface in a virtual machine scale set. </summary> |
| | 941 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 942 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 943 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 944 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 945 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 946 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 947 | | public async Task<Response<NetworkInterface>> GetVirtualMachineScaleSetNetworkInterfaceAsync(string resourceGrou |
| | 948 | | { |
| 2 | 949 | | if (resourceGroupName == null) |
| | 950 | | { |
| 0 | 951 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 952 | | } |
| 2 | 953 | | if (virtualMachineScaleSetName == null) |
| | 954 | | { |
| 0 | 955 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 956 | | } |
| 2 | 957 | | if (virtualmachineIndex == null) |
| | 958 | | { |
| 0 | 959 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 960 | | } |
| 2 | 961 | | if (networkInterfaceName == null) |
| | 962 | | { |
| 0 | 963 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 964 | | } |
| | 965 | |
|
| 2 | 966 | | using var message = CreateGetVirtualMachineScaleSetNetworkInterfaceRequest(resourceGroupName, virtualMachine |
| 2 | 967 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 2 | 968 | | switch (message.Response.Status) |
| | 969 | | { |
| | 970 | | case 200: |
| | 971 | | { |
| 2 | 972 | | NetworkInterface value = default; |
| 2 | 973 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 2 | 974 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 975 | | { |
| 0 | 976 | | value = null; |
| | 977 | | } |
| | 978 | | else |
| | 979 | | { |
| 2 | 980 | | value = NetworkInterface.DeserializeNetworkInterface(document.RootElement); |
| | 981 | | } |
| 2 | 982 | | return Response.FromValue(value, message.Response); |
| | 983 | | } |
| | 984 | | default: |
| 0 | 985 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 986 | | } |
| 2 | 987 | | } |
| | 988 | |
|
| | 989 | | /// <summary> Get the specified network interface in a virtual machine scale set. </summary> |
| | 990 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 991 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 992 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 993 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 994 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 995 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 996 | | public Response<NetworkInterface> GetVirtualMachineScaleSetNetworkInterface(string resourceGroupName, string vir |
| | 997 | | { |
| 2 | 998 | | if (resourceGroupName == null) |
| | 999 | | { |
| 0 | 1000 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1001 | | } |
| 2 | 1002 | | if (virtualMachineScaleSetName == null) |
| | 1003 | | { |
| 0 | 1004 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1005 | | } |
| 2 | 1006 | | if (virtualmachineIndex == null) |
| | 1007 | | { |
| 0 | 1008 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1009 | | } |
| 2 | 1010 | | if (networkInterfaceName == null) |
| | 1011 | | { |
| 0 | 1012 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 1013 | | } |
| | 1014 | |
|
| 2 | 1015 | | using var message = CreateGetVirtualMachineScaleSetNetworkInterfaceRequest(resourceGroupName, virtualMachine |
| 2 | 1016 | | _pipeline.Send(message, cancellationToken); |
| 2 | 1017 | | switch (message.Response.Status) |
| | 1018 | | { |
| | 1019 | | case 200: |
| | 1020 | | { |
| 2 | 1021 | | NetworkInterface value = default; |
| 2 | 1022 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 2 | 1023 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1024 | | { |
| 0 | 1025 | | value = null; |
| | 1026 | | } |
| | 1027 | | else |
| | 1028 | | { |
| 2 | 1029 | | value = NetworkInterface.DeserializeNetworkInterface(document.RootElement); |
| | 1030 | | } |
| 2 | 1031 | | return Response.FromValue(value, message.Response); |
| | 1032 | | } |
| | 1033 | | default: |
| 0 | 1034 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1035 | | } |
| 2 | 1036 | | } |
| | 1037 | |
|
| | 1038 | | internal HttpMessage CreateListVirtualMachineScaleSetIpConfigurationsRequest(string resourceGroupName, string vi |
| | 1039 | | { |
| 0 | 1040 | | var message = _pipeline.CreateMessage(); |
| 0 | 1041 | | var request = message.Request; |
| 0 | 1042 | | request.Method = RequestMethod.Get; |
| 0 | 1043 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1044 | | uri.Reset(endpoint); |
| 0 | 1045 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 1046 | | uri.AppendPath(subscriptionId, true); |
| 0 | 1047 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 1048 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 1049 | | uri.AppendPath("/providers/microsoft.Compute/virtualMachineScaleSets/", false); |
| 0 | 1050 | | uri.AppendPath(virtualMachineScaleSetName, true); |
| 0 | 1051 | | uri.AppendPath("/virtualMachines/", false); |
| 0 | 1052 | | uri.AppendPath(virtualmachineIndex, true); |
| 0 | 1053 | | uri.AppendPath("/networkInterfaces/", false); |
| 0 | 1054 | | uri.AppendPath(networkInterfaceName, true); |
| 0 | 1055 | | uri.AppendPath("/ipConfigurations", false); |
| 0 | 1056 | | uri.AppendQuery("api-version", "2018-10-01", true); |
| 0 | 1057 | | if (expand != null) |
| | 1058 | | { |
| 0 | 1059 | | uri.AppendQuery("$expand", expand, true); |
| | 1060 | | } |
| 0 | 1061 | | request.Uri = uri; |
| 0 | 1062 | | return message; |
| | 1063 | | } |
| | 1064 | |
|
| | 1065 | | /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary> |
| | 1066 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1067 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1068 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1069 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 1070 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 1071 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1072 | | public async Task<Response<NetworkInterfaceIPConfigurationListResult>> ListVirtualMachineScaleSetIpConfiguration |
| | 1073 | | { |
| 0 | 1074 | | if (resourceGroupName == null) |
| | 1075 | | { |
| 0 | 1076 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1077 | | } |
| 0 | 1078 | | if (virtualMachineScaleSetName == null) |
| | 1079 | | { |
| 0 | 1080 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1081 | | } |
| 0 | 1082 | | if (virtualmachineIndex == null) |
| | 1083 | | { |
| 0 | 1084 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1085 | | } |
| 0 | 1086 | | if (networkInterfaceName == null) |
| | 1087 | | { |
| 0 | 1088 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 1089 | | } |
| | 1090 | |
|
| 0 | 1091 | | using var message = CreateListVirtualMachineScaleSetIpConfigurationsRequest(resourceGroupName, virtualMachin |
| 0 | 1092 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1093 | | switch (message.Response.Status) |
| | 1094 | | { |
| | 1095 | | case 200: |
| | 1096 | | { |
| 0 | 1097 | | NetworkInterfaceIPConfigurationListResult value = default; |
| 0 | 1098 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1099 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1100 | | { |
| 0 | 1101 | | value = null; |
| | 1102 | | } |
| | 1103 | | else |
| | 1104 | | { |
| 0 | 1105 | | value = NetworkInterfaceIPConfigurationListResult.DeserializeNetworkInterfaceIPConfiguration |
| | 1106 | | } |
| 0 | 1107 | | return Response.FromValue(value, message.Response); |
| | 1108 | | } |
| | 1109 | | default: |
| 0 | 1110 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1111 | | } |
| 0 | 1112 | | } |
| | 1113 | |
|
| | 1114 | | /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary> |
| | 1115 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1116 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1117 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1118 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 1119 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 1120 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1121 | | public Response<NetworkInterfaceIPConfigurationListResult> ListVirtualMachineScaleSetIpConfigurations(string res |
| | 1122 | | { |
| 0 | 1123 | | if (resourceGroupName == null) |
| | 1124 | | { |
| 0 | 1125 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1126 | | } |
| 0 | 1127 | | if (virtualMachineScaleSetName == null) |
| | 1128 | | { |
| 0 | 1129 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1130 | | } |
| 0 | 1131 | | if (virtualmachineIndex == null) |
| | 1132 | | { |
| 0 | 1133 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1134 | | } |
| 0 | 1135 | | if (networkInterfaceName == null) |
| | 1136 | | { |
| 0 | 1137 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 1138 | | } |
| | 1139 | |
|
| 0 | 1140 | | using var message = CreateListVirtualMachineScaleSetIpConfigurationsRequest(resourceGroupName, virtualMachin |
| 0 | 1141 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1142 | | switch (message.Response.Status) |
| | 1143 | | { |
| | 1144 | | case 200: |
| | 1145 | | { |
| 0 | 1146 | | NetworkInterfaceIPConfigurationListResult value = default; |
| 0 | 1147 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1148 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1149 | | { |
| 0 | 1150 | | value = null; |
| | 1151 | | } |
| | 1152 | | else |
| | 1153 | | { |
| 0 | 1154 | | value = NetworkInterfaceIPConfigurationListResult.DeserializeNetworkInterfaceIPConfiguration |
| | 1155 | | } |
| 0 | 1156 | | return Response.FromValue(value, message.Response); |
| | 1157 | | } |
| | 1158 | | default: |
| 0 | 1159 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1160 | | } |
| 0 | 1161 | | } |
| | 1162 | |
|
| | 1163 | | internal HttpMessage CreateGetVirtualMachineScaleSetIpConfigurationRequest(string resourceGroupName, string virt |
| | 1164 | | { |
| 0 | 1165 | | var message = _pipeline.CreateMessage(); |
| 0 | 1166 | | var request = message.Request; |
| 0 | 1167 | | request.Method = RequestMethod.Get; |
| 0 | 1168 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1169 | | uri.Reset(endpoint); |
| 0 | 1170 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 1171 | | uri.AppendPath(subscriptionId, true); |
| 0 | 1172 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 1173 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 1174 | | uri.AppendPath("/providers/microsoft.Compute/virtualMachineScaleSets/", false); |
| 0 | 1175 | | uri.AppendPath(virtualMachineScaleSetName, true); |
| 0 | 1176 | | uri.AppendPath("/virtualMachines/", false); |
| 0 | 1177 | | uri.AppendPath(virtualmachineIndex, true); |
| 0 | 1178 | | uri.AppendPath("/networkInterfaces/", false); |
| 0 | 1179 | | uri.AppendPath(networkInterfaceName, true); |
| 0 | 1180 | | uri.AppendPath("/ipConfigurations/", false); |
| 0 | 1181 | | uri.AppendPath(ipConfigurationName, true); |
| 0 | 1182 | | uri.AppendQuery("api-version", "2018-10-01", true); |
| 0 | 1183 | | if (expand != null) |
| | 1184 | | { |
| 0 | 1185 | | uri.AppendQuery("$expand", expand, true); |
| | 1186 | | } |
| 0 | 1187 | | request.Uri = uri; |
| 0 | 1188 | | return message; |
| | 1189 | | } |
| | 1190 | |
|
| | 1191 | | /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary> |
| | 1192 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1193 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1194 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1195 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 1196 | | /// <param name="ipConfigurationName"> The name of the ip configuration. </param> |
| | 1197 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 1198 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1199 | | public async Task<Response<NetworkInterfaceIPConfiguration>> GetVirtualMachineScaleSetIpConfigurationAsync(strin |
| | 1200 | | { |
| 0 | 1201 | | if (resourceGroupName == null) |
| | 1202 | | { |
| 0 | 1203 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1204 | | } |
| 0 | 1205 | | if (virtualMachineScaleSetName == null) |
| | 1206 | | { |
| 0 | 1207 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1208 | | } |
| 0 | 1209 | | if (virtualmachineIndex == null) |
| | 1210 | | { |
| 0 | 1211 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1212 | | } |
| 0 | 1213 | | if (networkInterfaceName == null) |
| | 1214 | | { |
| 0 | 1215 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 1216 | | } |
| 0 | 1217 | | if (ipConfigurationName == null) |
| | 1218 | | { |
| 0 | 1219 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | 1220 | | } |
| | 1221 | |
|
| 0 | 1222 | | using var message = CreateGetVirtualMachineScaleSetIpConfigurationRequest(resourceGroupName, virtualMachineS |
| 0 | 1223 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1224 | | switch (message.Response.Status) |
| | 1225 | | { |
| | 1226 | | case 200: |
| | 1227 | | { |
| 0 | 1228 | | NetworkInterfaceIPConfiguration value = default; |
| 0 | 1229 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1230 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1231 | | { |
| 0 | 1232 | | value = null; |
| | 1233 | | } |
| | 1234 | | else |
| | 1235 | | { |
| 0 | 1236 | | value = NetworkInterfaceIPConfiguration.DeserializeNetworkInterfaceIPConfiguration(document. |
| | 1237 | | } |
| 0 | 1238 | | return Response.FromValue(value, message.Response); |
| | 1239 | | } |
| | 1240 | | default: |
| 0 | 1241 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1242 | | } |
| 0 | 1243 | | } |
| | 1244 | |
|
| | 1245 | | /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary> |
| | 1246 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1247 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1248 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1249 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 1250 | | /// <param name="ipConfigurationName"> The name of the ip configuration. </param> |
| | 1251 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 1252 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1253 | | public Response<NetworkInterfaceIPConfiguration> GetVirtualMachineScaleSetIpConfiguration(string resourceGroupNa |
| | 1254 | | { |
| 0 | 1255 | | if (resourceGroupName == null) |
| | 1256 | | { |
| 0 | 1257 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1258 | | } |
| 0 | 1259 | | if (virtualMachineScaleSetName == null) |
| | 1260 | | { |
| 0 | 1261 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1262 | | } |
| 0 | 1263 | | if (virtualmachineIndex == null) |
| | 1264 | | { |
| 0 | 1265 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1266 | | } |
| 0 | 1267 | | if (networkInterfaceName == null) |
| | 1268 | | { |
| 0 | 1269 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 1270 | | } |
| 0 | 1271 | | if (ipConfigurationName == null) |
| | 1272 | | { |
| 0 | 1273 | | throw new ArgumentNullException(nameof(ipConfigurationName)); |
| | 1274 | | } |
| | 1275 | |
|
| 0 | 1276 | | using var message = CreateGetVirtualMachineScaleSetIpConfigurationRequest(resourceGroupName, virtualMachineS |
| 0 | 1277 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1278 | | switch (message.Response.Status) |
| | 1279 | | { |
| | 1280 | | case 200: |
| | 1281 | | { |
| 0 | 1282 | | NetworkInterfaceIPConfiguration value = default; |
| 0 | 1283 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1284 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1285 | | { |
| 0 | 1286 | | value = null; |
| | 1287 | | } |
| | 1288 | | else |
| | 1289 | | { |
| 0 | 1290 | | value = NetworkInterfaceIPConfiguration.DeserializeNetworkInterfaceIPConfiguration(document. |
| | 1291 | | } |
| 0 | 1292 | | return Response.FromValue(value, message.Response); |
| | 1293 | | } |
| | 1294 | | default: |
| 0 | 1295 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1296 | | } |
| 0 | 1297 | | } |
| | 1298 | |
|
| | 1299 | | internal HttpMessage CreateListAllNextPageRequest(string nextLink) |
| | 1300 | | { |
| 0 | 1301 | | var message = _pipeline.CreateMessage(); |
| 0 | 1302 | | var request = message.Request; |
| 0 | 1303 | | request.Method = RequestMethod.Get; |
| 0 | 1304 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1305 | | uri.Reset(endpoint); |
| 0 | 1306 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1307 | | request.Uri = uri; |
| 0 | 1308 | | return message; |
| | 1309 | | } |
| | 1310 | |
|
| | 1311 | | /// <summary> Gets all network interfaces in a subscription. </summary> |
| | 1312 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1313 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1314 | | public async Task<Response<NetworkInterfaceListResult>> ListAllNextPageAsync(string nextLink, CancellationToken |
| | 1315 | | { |
| 0 | 1316 | | if (nextLink == null) |
| | 1317 | | { |
| 0 | 1318 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1319 | | } |
| | 1320 | |
|
| 0 | 1321 | | using var message = CreateListAllNextPageRequest(nextLink); |
| 0 | 1322 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1323 | | switch (message.Response.Status) |
| | 1324 | | { |
| | 1325 | | case 200: |
| | 1326 | | { |
| 0 | 1327 | | NetworkInterfaceListResult value = default; |
| 0 | 1328 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1329 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1330 | | { |
| 0 | 1331 | | value = null; |
| | 1332 | | } |
| | 1333 | | else |
| | 1334 | | { |
| 0 | 1335 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 1336 | | } |
| 0 | 1337 | | return Response.FromValue(value, message.Response); |
| | 1338 | | } |
| | 1339 | | default: |
| 0 | 1340 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1341 | | } |
| 0 | 1342 | | } |
| | 1343 | |
|
| | 1344 | | /// <summary> Gets all network interfaces in a subscription. </summary> |
| | 1345 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1346 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1347 | | public Response<NetworkInterfaceListResult> ListAllNextPage(string nextLink, CancellationToken cancellationToken |
| | 1348 | | { |
| 0 | 1349 | | if (nextLink == null) |
| | 1350 | | { |
| 0 | 1351 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1352 | | } |
| | 1353 | |
|
| 0 | 1354 | | using var message = CreateListAllNextPageRequest(nextLink); |
| 0 | 1355 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1356 | | switch (message.Response.Status) |
| | 1357 | | { |
| | 1358 | | case 200: |
| | 1359 | | { |
| 0 | 1360 | | NetworkInterfaceListResult value = default; |
| 0 | 1361 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1362 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1363 | | { |
| 0 | 1364 | | value = null; |
| | 1365 | | } |
| | 1366 | | else |
| | 1367 | | { |
| 0 | 1368 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 1369 | | } |
| 0 | 1370 | | return Response.FromValue(value, message.Response); |
| | 1371 | | } |
| | 1372 | | default: |
| 0 | 1373 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1374 | | } |
| 0 | 1375 | | } |
| | 1376 | |
|
| | 1377 | | internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName) |
| | 1378 | | { |
| 0 | 1379 | | var message = _pipeline.CreateMessage(); |
| 0 | 1380 | | var request = message.Request; |
| 0 | 1381 | | request.Method = RequestMethod.Get; |
| 0 | 1382 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1383 | | uri.Reset(endpoint); |
| 0 | 1384 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1385 | | request.Uri = uri; |
| 0 | 1386 | | return message; |
| | 1387 | | } |
| | 1388 | |
|
| | 1389 | | /// <summary> Gets all network interfaces in a resource group. </summary> |
| | 1390 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1391 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1392 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1393 | | public async Task<Response<NetworkInterfaceListResult>> ListNextPageAsync(string nextLink, string resourceGroupN |
| | 1394 | | { |
| 0 | 1395 | | if (nextLink == null) |
| | 1396 | | { |
| 0 | 1397 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1398 | | } |
| 0 | 1399 | | if (resourceGroupName == null) |
| | 1400 | | { |
| 0 | 1401 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1402 | | } |
| | 1403 | |
|
| 0 | 1404 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName); |
| 0 | 1405 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1406 | | switch (message.Response.Status) |
| | 1407 | | { |
| | 1408 | | case 200: |
| | 1409 | | { |
| 0 | 1410 | | NetworkInterfaceListResult value = default; |
| 0 | 1411 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1412 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1413 | | { |
| 0 | 1414 | | value = null; |
| | 1415 | | } |
| | 1416 | | else |
| | 1417 | | { |
| 0 | 1418 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 1419 | | } |
| 0 | 1420 | | return Response.FromValue(value, message.Response); |
| | 1421 | | } |
| | 1422 | | default: |
| 0 | 1423 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1424 | | } |
| 0 | 1425 | | } |
| | 1426 | |
|
| | 1427 | | /// <summary> Gets all network interfaces in a resource group. </summary> |
| | 1428 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1429 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1430 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1431 | | public Response<NetworkInterfaceListResult> ListNextPage(string nextLink, string resourceGroupName, Cancellation |
| | 1432 | | { |
| 0 | 1433 | | if (nextLink == null) |
| | 1434 | | { |
| 0 | 1435 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1436 | | } |
| 0 | 1437 | | if (resourceGroupName == null) |
| | 1438 | | { |
| 0 | 1439 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1440 | | } |
| | 1441 | |
|
| 0 | 1442 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName); |
| 0 | 1443 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1444 | | switch (message.Response.Status) |
| | 1445 | | { |
| | 1446 | | case 200: |
| | 1447 | | { |
| 0 | 1448 | | NetworkInterfaceListResult value = default; |
| 0 | 1449 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1450 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1451 | | { |
| 0 | 1452 | | value = null; |
| | 1453 | | } |
| | 1454 | | else |
| | 1455 | | { |
| 0 | 1456 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 1457 | | } |
| 0 | 1458 | | return Response.FromValue(value, message.Response); |
| | 1459 | | } |
| | 1460 | | default: |
| 0 | 1461 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1462 | | } |
| 0 | 1463 | | } |
| | 1464 | |
|
| | 1465 | | internal HttpMessage CreateListVirtualMachineScaleSetVMNetworkInterfacesNextPageRequest(string nextLink, string |
| | 1466 | | { |
| 0 | 1467 | | var message = _pipeline.CreateMessage(); |
| 0 | 1468 | | var request = message.Request; |
| 0 | 1469 | | request.Method = RequestMethod.Get; |
| 0 | 1470 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1471 | | uri.Reset(endpoint); |
| 0 | 1472 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1473 | | request.Uri = uri; |
| 0 | 1474 | | return message; |
| | 1475 | | } |
| | 1476 | |
|
| | 1477 | | /// <summary> Gets information about all network interfaces in a virtual machine in a virtual machine scale set. |
| | 1478 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1479 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1480 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1481 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1482 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1483 | | public async Task<Response<NetworkInterfaceListResult>> ListVirtualMachineScaleSetVMNetworkInterfacesNextPageAsy |
| | 1484 | | { |
| 0 | 1485 | | if (nextLink == null) |
| | 1486 | | { |
| 0 | 1487 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1488 | | } |
| 0 | 1489 | | if (resourceGroupName == null) |
| | 1490 | | { |
| 0 | 1491 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1492 | | } |
| 0 | 1493 | | if (virtualMachineScaleSetName == null) |
| | 1494 | | { |
| 0 | 1495 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1496 | | } |
| 0 | 1497 | | if (virtualmachineIndex == null) |
| | 1498 | | { |
| 0 | 1499 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1500 | | } |
| | 1501 | |
|
| 0 | 1502 | | using var message = CreateListVirtualMachineScaleSetVMNetworkInterfacesNextPageRequest(nextLink, resourceGro |
| 0 | 1503 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1504 | | switch (message.Response.Status) |
| | 1505 | | { |
| | 1506 | | case 200: |
| | 1507 | | { |
| 0 | 1508 | | NetworkInterfaceListResult value = default; |
| 0 | 1509 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1510 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1511 | | { |
| 0 | 1512 | | value = null; |
| | 1513 | | } |
| | 1514 | | else |
| | 1515 | | { |
| 0 | 1516 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 1517 | | } |
| 0 | 1518 | | return Response.FromValue(value, message.Response); |
| | 1519 | | } |
| | 1520 | | default: |
| 0 | 1521 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1522 | | } |
| 0 | 1523 | | } |
| | 1524 | |
|
| | 1525 | | /// <summary> Gets information about all network interfaces in a virtual machine in a virtual machine scale set. |
| | 1526 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1527 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1528 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1529 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1530 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1531 | | public Response<NetworkInterfaceListResult> ListVirtualMachineScaleSetVMNetworkInterfacesNextPage(string nextLin |
| | 1532 | | { |
| 0 | 1533 | | if (nextLink == null) |
| | 1534 | | { |
| 0 | 1535 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1536 | | } |
| 0 | 1537 | | if (resourceGroupName == null) |
| | 1538 | | { |
| 0 | 1539 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1540 | | } |
| 0 | 1541 | | if (virtualMachineScaleSetName == null) |
| | 1542 | | { |
| 0 | 1543 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1544 | | } |
| 0 | 1545 | | if (virtualmachineIndex == null) |
| | 1546 | | { |
| 0 | 1547 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1548 | | } |
| | 1549 | |
|
| 0 | 1550 | | using var message = CreateListVirtualMachineScaleSetVMNetworkInterfacesNextPageRequest(nextLink, resourceGro |
| 0 | 1551 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1552 | | switch (message.Response.Status) |
| | 1553 | | { |
| | 1554 | | case 200: |
| | 1555 | | { |
| 0 | 1556 | | NetworkInterfaceListResult value = default; |
| 0 | 1557 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1558 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1559 | | { |
| 0 | 1560 | | value = null; |
| | 1561 | | } |
| | 1562 | | else |
| | 1563 | | { |
| 0 | 1564 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 1565 | | } |
| 0 | 1566 | | return Response.FromValue(value, message.Response); |
| | 1567 | | } |
| | 1568 | | default: |
| 0 | 1569 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1570 | | } |
| 0 | 1571 | | } |
| | 1572 | |
|
| | 1573 | | internal HttpMessage CreateListVirtualMachineScaleSetNetworkInterfacesNextPageRequest(string nextLink, string re |
| | 1574 | | { |
| 0 | 1575 | | var message = _pipeline.CreateMessage(); |
| 0 | 1576 | | var request = message.Request; |
| 0 | 1577 | | request.Method = RequestMethod.Get; |
| 0 | 1578 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1579 | | uri.Reset(endpoint); |
| 0 | 1580 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1581 | | request.Uri = uri; |
| 0 | 1582 | | return message; |
| | 1583 | | } |
| | 1584 | |
|
| | 1585 | | /// <summary> Gets all network interfaces in a virtual machine scale set. </summary> |
| | 1586 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1587 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1588 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1589 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1590 | | public async Task<Response<NetworkInterfaceListResult>> ListVirtualMachineScaleSetNetworkInterfacesNextPageAsync |
| | 1591 | | { |
| 0 | 1592 | | if (nextLink == null) |
| | 1593 | | { |
| 0 | 1594 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1595 | | } |
| 0 | 1596 | | if (resourceGroupName == null) |
| | 1597 | | { |
| 0 | 1598 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1599 | | } |
| 0 | 1600 | | if (virtualMachineScaleSetName == null) |
| | 1601 | | { |
| 0 | 1602 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1603 | | } |
| | 1604 | |
|
| 0 | 1605 | | using var message = CreateListVirtualMachineScaleSetNetworkInterfacesNextPageRequest(nextLink, resourceGroup |
| 0 | 1606 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1607 | | switch (message.Response.Status) |
| | 1608 | | { |
| | 1609 | | case 200: |
| | 1610 | | { |
| 0 | 1611 | | NetworkInterfaceListResult value = default; |
| 0 | 1612 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1613 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1614 | | { |
| 0 | 1615 | | value = null; |
| | 1616 | | } |
| | 1617 | | else |
| | 1618 | | { |
| 0 | 1619 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 1620 | | } |
| 0 | 1621 | | return Response.FromValue(value, message.Response); |
| | 1622 | | } |
| | 1623 | | default: |
| 0 | 1624 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1625 | | } |
| 0 | 1626 | | } |
| | 1627 | |
|
| | 1628 | | /// <summary> Gets all network interfaces in a virtual machine scale set. </summary> |
| | 1629 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1630 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1631 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1632 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1633 | | public Response<NetworkInterfaceListResult> ListVirtualMachineScaleSetNetworkInterfacesNextPage(string nextLink, |
| | 1634 | | { |
| 0 | 1635 | | if (nextLink == null) |
| | 1636 | | { |
| 0 | 1637 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1638 | | } |
| 0 | 1639 | | if (resourceGroupName == null) |
| | 1640 | | { |
| 0 | 1641 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1642 | | } |
| 0 | 1643 | | if (virtualMachineScaleSetName == null) |
| | 1644 | | { |
| 0 | 1645 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1646 | | } |
| | 1647 | |
|
| 0 | 1648 | | using var message = CreateListVirtualMachineScaleSetNetworkInterfacesNextPageRequest(nextLink, resourceGroup |
| 0 | 1649 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1650 | | switch (message.Response.Status) |
| | 1651 | | { |
| | 1652 | | case 200: |
| | 1653 | | { |
| 0 | 1654 | | NetworkInterfaceListResult value = default; |
| 0 | 1655 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1656 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1657 | | { |
| 0 | 1658 | | value = null; |
| | 1659 | | } |
| | 1660 | | else |
| | 1661 | | { |
| 0 | 1662 | | value = NetworkInterfaceListResult.DeserializeNetworkInterfaceListResult(document.RootElemen |
| | 1663 | | } |
| 0 | 1664 | | return Response.FromValue(value, message.Response); |
| | 1665 | | } |
| | 1666 | | default: |
| 0 | 1667 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1668 | | } |
| 0 | 1669 | | } |
| | 1670 | |
|
| | 1671 | | internal HttpMessage CreateListVirtualMachineScaleSetIpConfigurationsNextPageRequest(string nextLink, string res |
| | 1672 | | { |
| 0 | 1673 | | var message = _pipeline.CreateMessage(); |
| 0 | 1674 | | var request = message.Request; |
| 0 | 1675 | | request.Method = RequestMethod.Get; |
| 0 | 1676 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1677 | | uri.Reset(endpoint); |
| 0 | 1678 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1679 | | request.Uri = uri; |
| 0 | 1680 | | return message; |
| | 1681 | | } |
| | 1682 | |
|
| | 1683 | | /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary> |
| | 1684 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1685 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1686 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1687 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1688 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 1689 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 1690 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1691 | | public async Task<Response<NetworkInterfaceIPConfigurationListResult>> ListVirtualMachineScaleSetIpConfiguration |
| | 1692 | | { |
| 0 | 1693 | | if (nextLink == null) |
| | 1694 | | { |
| 0 | 1695 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1696 | | } |
| 0 | 1697 | | if (resourceGroupName == null) |
| | 1698 | | { |
| 0 | 1699 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1700 | | } |
| 0 | 1701 | | if (virtualMachineScaleSetName == null) |
| | 1702 | | { |
| 0 | 1703 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1704 | | } |
| 0 | 1705 | | if (virtualmachineIndex == null) |
| | 1706 | | { |
| 0 | 1707 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1708 | | } |
| 0 | 1709 | | if (networkInterfaceName == null) |
| | 1710 | | { |
| 0 | 1711 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 1712 | | } |
| | 1713 | |
|
| 0 | 1714 | | using var message = CreateListVirtualMachineScaleSetIpConfigurationsNextPageRequest(nextLink, resourceGroupN |
| 0 | 1715 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1716 | | switch (message.Response.Status) |
| | 1717 | | { |
| | 1718 | | case 200: |
| | 1719 | | { |
| 0 | 1720 | | NetworkInterfaceIPConfigurationListResult value = default; |
| 0 | 1721 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1722 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1723 | | { |
| 0 | 1724 | | value = null; |
| | 1725 | | } |
| | 1726 | | else |
| | 1727 | | { |
| 0 | 1728 | | value = NetworkInterfaceIPConfigurationListResult.DeserializeNetworkInterfaceIPConfiguration |
| | 1729 | | } |
| 0 | 1730 | | return Response.FromValue(value, message.Response); |
| | 1731 | | } |
| | 1732 | | default: |
| 0 | 1733 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1734 | | } |
| 0 | 1735 | | } |
| | 1736 | |
|
| | 1737 | | /// <summary> Get the specified network interface ip configuration in a virtual machine scale set. </summary> |
| | 1738 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1739 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1740 | | /// <param name="virtualMachineScaleSetName"> The name of the virtual machine scale set. </param> |
| | 1741 | | /// <param name="virtualmachineIndex"> The virtual machine index. </param> |
| | 1742 | | /// <param name="networkInterfaceName"> The name of the network interface. </param> |
| | 1743 | | /// <param name="expand"> Expands referenced resources. </param> |
| | 1744 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1745 | | public Response<NetworkInterfaceIPConfigurationListResult> ListVirtualMachineScaleSetIpConfigurationsNextPage(st |
| | 1746 | | { |
| 0 | 1747 | | if (nextLink == null) |
| | 1748 | | { |
| 0 | 1749 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1750 | | } |
| 0 | 1751 | | if (resourceGroupName == null) |
| | 1752 | | { |
| 0 | 1753 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1754 | | } |
| 0 | 1755 | | if (virtualMachineScaleSetName == null) |
| | 1756 | | { |
| 0 | 1757 | | throw new ArgumentNullException(nameof(virtualMachineScaleSetName)); |
| | 1758 | | } |
| 0 | 1759 | | if (virtualmachineIndex == null) |
| | 1760 | | { |
| 0 | 1761 | | throw new ArgumentNullException(nameof(virtualmachineIndex)); |
| | 1762 | | } |
| 0 | 1763 | | if (networkInterfaceName == null) |
| | 1764 | | { |
| 0 | 1765 | | throw new ArgumentNullException(nameof(networkInterfaceName)); |
| | 1766 | | } |
| | 1767 | |
|
| 0 | 1768 | | using var message = CreateListVirtualMachineScaleSetIpConfigurationsNextPageRequest(nextLink, resourceGroupN |
| 0 | 1769 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1770 | | switch (message.Response.Status) |
| | 1771 | | { |
| | 1772 | | case 200: |
| | 1773 | | { |
| 0 | 1774 | | NetworkInterfaceIPConfigurationListResult value = default; |
| 0 | 1775 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1776 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1777 | | { |
| 0 | 1778 | | value = null; |
| | 1779 | | } |
| | 1780 | | else |
| | 1781 | | { |
| 0 | 1782 | | value = NetworkInterfaceIPConfigurationListResult.DeserializeNetworkInterfaceIPConfiguration |
| | 1783 | | } |
| 0 | 1784 | | return Response.FromValue(value, message.Response); |
| | 1785 | | } |
| | 1786 | | default: |
| 0 | 1787 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1788 | | } |
| 0 | 1789 | | } |
| | 1790 | | } |
| | 1791 | | } |