| | 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 ExpressRouteCircuitsRestOperations |
| | 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 ExpressRouteCircuitsRestOperations. </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 |
| 0 | 32 | | public ExpressRouteCircuitsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string sub |
| | 33 | | { |
| 0 | 34 | | if (subscriptionId == null) |
| | 35 | | { |
| 0 | 36 | | throw new ArgumentNullException(nameof(subscriptionId)); |
| | 37 | | } |
| 0 | 38 | | endpoint ??= new Uri("https://management.azure.com"); |
| | 39 | |
|
| 0 | 40 | | this.subscriptionId = subscriptionId; |
| 0 | 41 | | this.endpoint = endpoint; |
| 0 | 42 | | _clientDiagnostics = clientDiagnostics; |
| 0 | 43 | | _pipeline = pipeline; |
| 0 | 44 | | } |
| | 45 | |
|
| | 46 | | internal HttpMessage CreateDeleteRequest(string resourceGroupName, string circuitName) |
| | 47 | | { |
| 0 | 48 | | var message = _pipeline.CreateMessage(); |
| 0 | 49 | | var request = message.Request; |
| 0 | 50 | | request.Method = RequestMethod.Delete; |
| 0 | 51 | | var uri = new RawRequestUriBuilder(); |
| 0 | 52 | | uri.Reset(endpoint); |
| 0 | 53 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 54 | | uri.AppendPath(subscriptionId, true); |
| 0 | 55 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 56 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 57 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false); |
| 0 | 58 | | uri.AppendPath(circuitName, true); |
| 0 | 59 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 60 | | request.Uri = uri; |
| 0 | 61 | | return message; |
| | 62 | | } |
| | 63 | |
|
| | 64 | | /// <summary> Deletes the specified express route circuit. </summary> |
| | 65 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 66 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 67 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 68 | | public async Task<Response> DeleteAsync(string resourceGroupName, string circuitName, CancellationToken cancella |
| | 69 | | { |
| 0 | 70 | | if (resourceGroupName == null) |
| | 71 | | { |
| 0 | 72 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 73 | | } |
| 0 | 74 | | if (circuitName == null) |
| | 75 | | { |
| 0 | 76 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 77 | | } |
| | 78 | |
|
| 0 | 79 | | using var message = CreateDeleteRequest(resourceGroupName, circuitName); |
| 0 | 80 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 81 | | switch (message.Response.Status) |
| | 82 | | { |
| | 83 | | case 200: |
| | 84 | | case 202: |
| | 85 | | case 204: |
| 0 | 86 | | return message.Response; |
| | 87 | | default: |
| 0 | 88 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 89 | | } |
| 0 | 90 | | } |
| | 91 | |
|
| | 92 | | /// <summary> Deletes the specified express route circuit. </summary> |
| | 93 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 94 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 95 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 96 | | public Response Delete(string resourceGroupName, string circuitName, CancellationToken cancellationToken = defau |
| | 97 | | { |
| 0 | 98 | | if (resourceGroupName == null) |
| | 99 | | { |
| 0 | 100 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 101 | | } |
| 0 | 102 | | if (circuitName == null) |
| | 103 | | { |
| 0 | 104 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 105 | | } |
| | 106 | |
|
| 0 | 107 | | using var message = CreateDeleteRequest(resourceGroupName, circuitName); |
| 0 | 108 | | _pipeline.Send(message, cancellationToken); |
| 0 | 109 | | switch (message.Response.Status) |
| | 110 | | { |
| | 111 | | case 200: |
| | 112 | | case 202: |
| | 113 | | case 204: |
| 0 | 114 | | return message.Response; |
| | 115 | | default: |
| 0 | 116 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 117 | | } |
| 0 | 118 | | } |
| | 119 | |
|
| | 120 | | internal HttpMessage CreateGetRequest(string resourceGroupName, string circuitName) |
| | 121 | | { |
| 0 | 122 | | var message = _pipeline.CreateMessage(); |
| 0 | 123 | | var request = message.Request; |
| 0 | 124 | | request.Method = RequestMethod.Get; |
| 0 | 125 | | var uri = new RawRequestUriBuilder(); |
| 0 | 126 | | uri.Reset(endpoint); |
| 0 | 127 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 128 | | uri.AppendPath(subscriptionId, true); |
| 0 | 129 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 130 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 131 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false); |
| 0 | 132 | | uri.AppendPath(circuitName, true); |
| 0 | 133 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 134 | | request.Uri = uri; |
| 0 | 135 | | return message; |
| | 136 | | } |
| | 137 | |
|
| | 138 | | /// <summary> Gets information about the specified express route circuit. </summary> |
| | 139 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 140 | | /// <param name="circuitName"> The name of express route circuit. </param> |
| | 141 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 142 | | public async Task<Response<ExpressRouteCircuit>> GetAsync(string resourceGroupName, string circuitName, Cancella |
| | 143 | | { |
| 0 | 144 | | if (resourceGroupName == null) |
| | 145 | | { |
| 0 | 146 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 147 | | } |
| 0 | 148 | | if (circuitName == null) |
| | 149 | | { |
| 0 | 150 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 151 | | } |
| | 152 | |
|
| 0 | 153 | | using var message = CreateGetRequest(resourceGroupName, circuitName); |
| 0 | 154 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 155 | | switch (message.Response.Status) |
| | 156 | | { |
| | 157 | | case 200: |
| | 158 | | { |
| 0 | 159 | | ExpressRouteCircuit value = default; |
| 0 | 160 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 161 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 162 | | { |
| 0 | 163 | | value = null; |
| | 164 | | } |
| | 165 | | else |
| | 166 | | { |
| 0 | 167 | | value = ExpressRouteCircuit.DeserializeExpressRouteCircuit(document.RootElement); |
| | 168 | | } |
| 0 | 169 | | return Response.FromValue(value, message.Response); |
| | 170 | | } |
| | 171 | | default: |
| 0 | 172 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 173 | | } |
| 0 | 174 | | } |
| | 175 | |
|
| | 176 | | /// <summary> Gets information about the specified express route circuit. </summary> |
| | 177 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 178 | | /// <param name="circuitName"> The name of express route circuit. </param> |
| | 179 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 180 | | public Response<ExpressRouteCircuit> Get(string resourceGroupName, string circuitName, CancellationToken cancell |
| | 181 | | { |
| 0 | 182 | | if (resourceGroupName == null) |
| | 183 | | { |
| 0 | 184 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 185 | | } |
| 0 | 186 | | if (circuitName == null) |
| | 187 | | { |
| 0 | 188 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 189 | | } |
| | 190 | |
|
| 0 | 191 | | using var message = CreateGetRequest(resourceGroupName, circuitName); |
| 0 | 192 | | _pipeline.Send(message, cancellationToken); |
| 0 | 193 | | switch (message.Response.Status) |
| | 194 | | { |
| | 195 | | case 200: |
| | 196 | | { |
| 0 | 197 | | ExpressRouteCircuit value = default; |
| 0 | 198 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 199 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 200 | | { |
| 0 | 201 | | value = null; |
| | 202 | | } |
| | 203 | | else |
| | 204 | | { |
| 0 | 205 | | value = ExpressRouteCircuit.DeserializeExpressRouteCircuit(document.RootElement); |
| | 206 | | } |
| 0 | 207 | | return Response.FromValue(value, message.Response); |
| | 208 | | } |
| | 209 | | default: |
| 0 | 210 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 211 | | } |
| 0 | 212 | | } |
| | 213 | |
|
| | 214 | | internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string circuitName, ExpressRouteCircu |
| | 215 | | { |
| 0 | 216 | | var message = _pipeline.CreateMessage(); |
| 0 | 217 | | var request = message.Request; |
| 0 | 218 | | request.Method = RequestMethod.Put; |
| 0 | 219 | | var uri = new RawRequestUriBuilder(); |
| 0 | 220 | | uri.Reset(endpoint); |
| 0 | 221 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 222 | | uri.AppendPath(subscriptionId, true); |
| 0 | 223 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 224 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 225 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false); |
| 0 | 226 | | uri.AppendPath(circuitName, true); |
| 0 | 227 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 228 | | request.Uri = uri; |
| 0 | 229 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 230 | | var content = new Utf8JsonRequestContent(); |
| 0 | 231 | | content.JsonWriter.WriteObjectValue(parameters); |
| 0 | 232 | | request.Content = content; |
| 0 | 233 | | return message; |
| | 234 | | } |
| | 235 | |
|
| | 236 | | /// <summary> Creates or updates an express route circuit. </summary> |
| | 237 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 238 | | /// <param name="circuitName"> The name of the circuit. </param> |
| | 239 | | /// <param name="parameters"> Parameters supplied to the create or update express route circuit operation. </par |
| | 240 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 241 | | public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string circuitName, ExpressRouteCircui |
| | 242 | | { |
| 0 | 243 | | if (resourceGroupName == null) |
| | 244 | | { |
| 0 | 245 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 246 | | } |
| 0 | 247 | | if (circuitName == null) |
| | 248 | | { |
| 0 | 249 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 250 | | } |
| 0 | 251 | | if (parameters == null) |
| | 252 | | { |
| 0 | 253 | | throw new ArgumentNullException(nameof(parameters)); |
| | 254 | | } |
| | 255 | |
|
| 0 | 256 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, circuitName, parameters); |
| 0 | 257 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 258 | | switch (message.Response.Status) |
| | 259 | | { |
| | 260 | | case 200: |
| | 261 | | case 201: |
| 0 | 262 | | return message.Response; |
| | 263 | | default: |
| 0 | 264 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 265 | | } |
| 0 | 266 | | } |
| | 267 | |
|
| | 268 | | /// <summary> Creates or updates an express route circuit. </summary> |
| | 269 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 270 | | /// <param name="circuitName"> The name of the circuit. </param> |
| | 271 | | /// <param name="parameters"> Parameters supplied to the create or update express route circuit operation. </par |
| | 272 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 273 | | public Response CreateOrUpdate(string resourceGroupName, string circuitName, ExpressRouteCircuit parameters, Can |
| | 274 | | { |
| 0 | 275 | | if (resourceGroupName == null) |
| | 276 | | { |
| 0 | 277 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 278 | | } |
| 0 | 279 | | if (circuitName == null) |
| | 280 | | { |
| 0 | 281 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 282 | | } |
| 0 | 283 | | if (parameters == null) |
| | 284 | | { |
| 0 | 285 | | throw new ArgumentNullException(nameof(parameters)); |
| | 286 | | } |
| | 287 | |
|
| 0 | 288 | | using var message = CreateCreateOrUpdateRequest(resourceGroupName, circuitName, parameters); |
| 0 | 289 | | _pipeline.Send(message, cancellationToken); |
| 0 | 290 | | switch (message.Response.Status) |
| | 291 | | { |
| | 292 | | case 200: |
| | 293 | | case 201: |
| 0 | 294 | | return message.Response; |
| | 295 | | default: |
| 0 | 296 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 297 | | } |
| 0 | 298 | | } |
| | 299 | |
|
| | 300 | | internal HttpMessage CreateUpdateTagsRequest(string resourceGroupName, string circuitName, TagsObject parameters |
| | 301 | | { |
| 0 | 302 | | var message = _pipeline.CreateMessage(); |
| 0 | 303 | | var request = message.Request; |
| 0 | 304 | | request.Method = RequestMethod.Patch; |
| 0 | 305 | | var uri = new RawRequestUriBuilder(); |
| 0 | 306 | | uri.Reset(endpoint); |
| 0 | 307 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 308 | | uri.AppendPath(subscriptionId, true); |
| 0 | 309 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 310 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 311 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false); |
| 0 | 312 | | uri.AppendPath(circuitName, true); |
| 0 | 313 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 314 | | request.Uri = uri; |
| 0 | 315 | | request.Headers.Add("Content-Type", "application/json"); |
| 0 | 316 | | var content = new Utf8JsonRequestContent(); |
| 0 | 317 | | content.JsonWriter.WriteObjectValue(parameters); |
| 0 | 318 | | request.Content = content; |
| 0 | 319 | | return message; |
| | 320 | | } |
| | 321 | |
|
| | 322 | | /// <summary> Updates an express route circuit tags. </summary> |
| | 323 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 324 | | /// <param name="circuitName"> The name of the circuit. </param> |
| | 325 | | /// <param name="parameters"> Parameters supplied to update express route circuit tags. </param> |
| | 326 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 327 | | public async Task<Response<ExpressRouteCircuit>> UpdateTagsAsync(string resourceGroupName, string circuitName, T |
| | 328 | | { |
| 0 | 329 | | if (resourceGroupName == null) |
| | 330 | | { |
| 0 | 331 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 332 | | } |
| 0 | 333 | | if (circuitName == null) |
| | 334 | | { |
| 0 | 335 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 336 | | } |
| 0 | 337 | | if (parameters == null) |
| | 338 | | { |
| 0 | 339 | | throw new ArgumentNullException(nameof(parameters)); |
| | 340 | | } |
| | 341 | |
|
| 0 | 342 | | using var message = CreateUpdateTagsRequest(resourceGroupName, circuitName, parameters); |
| 0 | 343 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 344 | | switch (message.Response.Status) |
| | 345 | | { |
| | 346 | | case 200: |
| | 347 | | { |
| 0 | 348 | | ExpressRouteCircuit value = default; |
| 0 | 349 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 350 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 351 | | { |
| 0 | 352 | | value = null; |
| | 353 | | } |
| | 354 | | else |
| | 355 | | { |
| 0 | 356 | | value = ExpressRouteCircuit.DeserializeExpressRouteCircuit(document.RootElement); |
| | 357 | | } |
| 0 | 358 | | return Response.FromValue(value, message.Response); |
| | 359 | | } |
| | 360 | | default: |
| 0 | 361 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 362 | | } |
| 0 | 363 | | } |
| | 364 | |
|
| | 365 | | /// <summary> Updates an express route circuit tags. </summary> |
| | 366 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 367 | | /// <param name="circuitName"> The name of the circuit. </param> |
| | 368 | | /// <param name="parameters"> Parameters supplied to update express route circuit tags. </param> |
| | 369 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 370 | | public Response<ExpressRouteCircuit> UpdateTags(string resourceGroupName, string circuitName, TagsObject paramet |
| | 371 | | { |
| 0 | 372 | | if (resourceGroupName == null) |
| | 373 | | { |
| 0 | 374 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 375 | | } |
| 0 | 376 | | if (circuitName == null) |
| | 377 | | { |
| 0 | 378 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 379 | | } |
| 0 | 380 | | if (parameters == null) |
| | 381 | | { |
| 0 | 382 | | throw new ArgumentNullException(nameof(parameters)); |
| | 383 | | } |
| | 384 | |
|
| 0 | 385 | | using var message = CreateUpdateTagsRequest(resourceGroupName, circuitName, parameters); |
| 0 | 386 | | _pipeline.Send(message, cancellationToken); |
| 0 | 387 | | switch (message.Response.Status) |
| | 388 | | { |
| | 389 | | case 200: |
| | 390 | | { |
| 0 | 391 | | ExpressRouteCircuit value = default; |
| 0 | 392 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 393 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 394 | | { |
| 0 | 395 | | value = null; |
| | 396 | | } |
| | 397 | | else |
| | 398 | | { |
| 0 | 399 | | value = ExpressRouteCircuit.DeserializeExpressRouteCircuit(document.RootElement); |
| | 400 | | } |
| 0 | 401 | | return Response.FromValue(value, message.Response); |
| | 402 | | } |
| | 403 | | default: |
| 0 | 404 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 405 | | } |
| 0 | 406 | | } |
| | 407 | |
|
| | 408 | | internal HttpMessage CreateListArpTableRequest(string resourceGroupName, string circuitName, string peeringName, |
| | 409 | | { |
| 0 | 410 | | var message = _pipeline.CreateMessage(); |
| 0 | 411 | | var request = message.Request; |
| 0 | 412 | | request.Method = RequestMethod.Post; |
| 0 | 413 | | var uri = new RawRequestUriBuilder(); |
| 0 | 414 | | uri.Reset(endpoint); |
| 0 | 415 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 416 | | uri.AppendPath(subscriptionId, true); |
| 0 | 417 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 418 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 419 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false); |
| 0 | 420 | | uri.AppendPath(circuitName, true); |
| 0 | 421 | | uri.AppendPath("/peerings/", false); |
| 0 | 422 | | uri.AppendPath(peeringName, true); |
| 0 | 423 | | uri.AppendPath("/arpTables/", false); |
| 0 | 424 | | uri.AppendPath(devicePath, true); |
| 0 | 425 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 426 | | request.Uri = uri; |
| 0 | 427 | | return message; |
| | 428 | | } |
| | 429 | |
|
| | 430 | | /// <summary> Gets the currently advertised ARP table associated with the express route circuit in a resource gr |
| | 431 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 432 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 433 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 434 | | /// <param name="devicePath"> The path of the device. </param> |
| | 435 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 436 | | public async Task<Response> ListArpTableAsync(string resourceGroupName, string circuitName, string peeringName, |
| | 437 | | { |
| 0 | 438 | | if (resourceGroupName == null) |
| | 439 | | { |
| 0 | 440 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 441 | | } |
| 0 | 442 | | if (circuitName == null) |
| | 443 | | { |
| 0 | 444 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 445 | | } |
| 0 | 446 | | if (peeringName == null) |
| | 447 | | { |
| 0 | 448 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 449 | | } |
| 0 | 450 | | if (devicePath == null) |
| | 451 | | { |
| 0 | 452 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 453 | | } |
| | 454 | |
|
| 0 | 455 | | using var message = CreateListArpTableRequest(resourceGroupName, circuitName, peeringName, devicePath); |
| 0 | 456 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 457 | | switch (message.Response.Status) |
| | 458 | | { |
| | 459 | | case 200: |
| | 460 | | case 202: |
| 0 | 461 | | return message.Response; |
| | 462 | | default: |
| 0 | 463 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 464 | | } |
| 0 | 465 | | } |
| | 466 | |
|
| | 467 | | /// <summary> Gets the currently advertised ARP table associated with the express route circuit in a resource gr |
| | 468 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 469 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 470 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 471 | | /// <param name="devicePath"> The path of the device. </param> |
| | 472 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 473 | | public Response ListArpTable(string resourceGroupName, string circuitName, string peeringName, string devicePath |
| | 474 | | { |
| 0 | 475 | | if (resourceGroupName == null) |
| | 476 | | { |
| 0 | 477 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 478 | | } |
| 0 | 479 | | if (circuitName == null) |
| | 480 | | { |
| 0 | 481 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 482 | | } |
| 0 | 483 | | if (peeringName == null) |
| | 484 | | { |
| 0 | 485 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 486 | | } |
| 0 | 487 | | if (devicePath == null) |
| | 488 | | { |
| 0 | 489 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 490 | | } |
| | 491 | |
|
| 0 | 492 | | using var message = CreateListArpTableRequest(resourceGroupName, circuitName, peeringName, devicePath); |
| 0 | 493 | | _pipeline.Send(message, cancellationToken); |
| 0 | 494 | | switch (message.Response.Status) |
| | 495 | | { |
| | 496 | | case 200: |
| | 497 | | case 202: |
| 0 | 498 | | return message.Response; |
| | 499 | | default: |
| 0 | 500 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 501 | | } |
| 0 | 502 | | } |
| | 503 | |
|
| | 504 | | internal HttpMessage CreateListRoutesTableRequest(string resourceGroupName, string circuitName, string peeringNa |
| | 505 | | { |
| 0 | 506 | | var message = _pipeline.CreateMessage(); |
| 0 | 507 | | var request = message.Request; |
| 0 | 508 | | request.Method = RequestMethod.Post; |
| 0 | 509 | | var uri = new RawRequestUriBuilder(); |
| 0 | 510 | | uri.Reset(endpoint); |
| 0 | 511 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 512 | | uri.AppendPath(subscriptionId, true); |
| 0 | 513 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 514 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 515 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false); |
| 0 | 516 | | uri.AppendPath(circuitName, true); |
| 0 | 517 | | uri.AppendPath("/peerings/", false); |
| 0 | 518 | | uri.AppendPath(peeringName, true); |
| 0 | 519 | | uri.AppendPath("/routeTables/", false); |
| 0 | 520 | | uri.AppendPath(devicePath, true); |
| 0 | 521 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 522 | | request.Uri = uri; |
| 0 | 523 | | return message; |
| | 524 | | } |
| | 525 | |
|
| | 526 | | /// <summary> Gets the currently advertised routes table associated with the express route circuit in a resource |
| | 527 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 528 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 529 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 530 | | /// <param name="devicePath"> The path of the device. </param> |
| | 531 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 532 | | public async Task<Response> ListRoutesTableAsync(string resourceGroupName, string circuitName, string peeringNam |
| | 533 | | { |
| 0 | 534 | | if (resourceGroupName == null) |
| | 535 | | { |
| 0 | 536 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 537 | | } |
| 0 | 538 | | if (circuitName == null) |
| | 539 | | { |
| 0 | 540 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 541 | | } |
| 0 | 542 | | if (peeringName == null) |
| | 543 | | { |
| 0 | 544 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 545 | | } |
| 0 | 546 | | if (devicePath == null) |
| | 547 | | { |
| 0 | 548 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 549 | | } |
| | 550 | |
|
| 0 | 551 | | using var message = CreateListRoutesTableRequest(resourceGroupName, circuitName, peeringName, devicePath); |
| 0 | 552 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 553 | | switch (message.Response.Status) |
| | 554 | | { |
| | 555 | | case 200: |
| | 556 | | case 202: |
| 0 | 557 | | return message.Response; |
| | 558 | | default: |
| 0 | 559 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 560 | | } |
| 0 | 561 | | } |
| | 562 | |
|
| | 563 | | /// <summary> Gets the currently advertised routes table associated with the express route circuit in a resource |
| | 564 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 565 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 566 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 567 | | /// <param name="devicePath"> The path of the device. </param> |
| | 568 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 569 | | public Response ListRoutesTable(string resourceGroupName, string circuitName, string peeringName, string deviceP |
| | 570 | | { |
| 0 | 571 | | if (resourceGroupName == null) |
| | 572 | | { |
| 0 | 573 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 574 | | } |
| 0 | 575 | | if (circuitName == null) |
| | 576 | | { |
| 0 | 577 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 578 | | } |
| 0 | 579 | | if (peeringName == null) |
| | 580 | | { |
| 0 | 581 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 582 | | } |
| 0 | 583 | | if (devicePath == null) |
| | 584 | | { |
| 0 | 585 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 586 | | } |
| | 587 | |
|
| 0 | 588 | | using var message = CreateListRoutesTableRequest(resourceGroupName, circuitName, peeringName, devicePath); |
| 0 | 589 | | _pipeline.Send(message, cancellationToken); |
| 0 | 590 | | switch (message.Response.Status) |
| | 591 | | { |
| | 592 | | case 200: |
| | 593 | | case 202: |
| 0 | 594 | | return message.Response; |
| | 595 | | default: |
| 0 | 596 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 597 | | } |
| 0 | 598 | | } |
| | 599 | |
|
| | 600 | | internal HttpMessage CreateListRoutesTableSummaryRequest(string resourceGroupName, string circuitName, string pe |
| | 601 | | { |
| 0 | 602 | | var message = _pipeline.CreateMessage(); |
| 0 | 603 | | var request = message.Request; |
| 0 | 604 | | request.Method = RequestMethod.Post; |
| 0 | 605 | | var uri = new RawRequestUriBuilder(); |
| 0 | 606 | | uri.Reset(endpoint); |
| 0 | 607 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 608 | | uri.AppendPath(subscriptionId, true); |
| 0 | 609 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 610 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 611 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false); |
| 0 | 612 | | uri.AppendPath(circuitName, true); |
| 0 | 613 | | uri.AppendPath("/peerings/", false); |
| 0 | 614 | | uri.AppendPath(peeringName, true); |
| 0 | 615 | | uri.AppendPath("/routeTablesSummary/", false); |
| 0 | 616 | | uri.AppendPath(devicePath, true); |
| 0 | 617 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 618 | | request.Uri = uri; |
| 0 | 619 | | return message; |
| | 620 | | } |
| | 621 | |
|
| | 622 | | /// <summary> Gets the currently advertised routes table summary associated with the express route circuit in a |
| | 623 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 624 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 625 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 626 | | /// <param name="devicePath"> The path of the device. </param> |
| | 627 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 628 | | public async Task<Response> ListRoutesTableSummaryAsync(string resourceGroupName, string circuitName, string pee |
| | 629 | | { |
| 0 | 630 | | if (resourceGroupName == null) |
| | 631 | | { |
| 0 | 632 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 633 | | } |
| 0 | 634 | | if (circuitName == null) |
| | 635 | | { |
| 0 | 636 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 637 | | } |
| 0 | 638 | | if (peeringName == null) |
| | 639 | | { |
| 0 | 640 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 641 | | } |
| 0 | 642 | | if (devicePath == null) |
| | 643 | | { |
| 0 | 644 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 645 | | } |
| | 646 | |
|
| 0 | 647 | | using var message = CreateListRoutesTableSummaryRequest(resourceGroupName, circuitName, peeringName, deviceP |
| 0 | 648 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 649 | | switch (message.Response.Status) |
| | 650 | | { |
| | 651 | | case 200: |
| | 652 | | case 202: |
| 0 | 653 | | return message.Response; |
| | 654 | | default: |
| 0 | 655 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 656 | | } |
| 0 | 657 | | } |
| | 658 | |
|
| | 659 | | /// <summary> Gets the currently advertised routes table summary associated with the express route circuit in a |
| | 660 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 661 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 662 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 663 | | /// <param name="devicePath"> The path of the device. </param> |
| | 664 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 665 | | public Response ListRoutesTableSummary(string resourceGroupName, string circuitName, string peeringName, string |
| | 666 | | { |
| 0 | 667 | | if (resourceGroupName == null) |
| | 668 | | { |
| 0 | 669 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 670 | | } |
| 0 | 671 | | if (circuitName == null) |
| | 672 | | { |
| 0 | 673 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 674 | | } |
| 0 | 675 | | if (peeringName == null) |
| | 676 | | { |
| 0 | 677 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 678 | | } |
| 0 | 679 | | if (devicePath == null) |
| | 680 | | { |
| 0 | 681 | | throw new ArgumentNullException(nameof(devicePath)); |
| | 682 | | } |
| | 683 | |
|
| 0 | 684 | | using var message = CreateListRoutesTableSummaryRequest(resourceGroupName, circuitName, peeringName, deviceP |
| 0 | 685 | | _pipeline.Send(message, cancellationToken); |
| 0 | 686 | | switch (message.Response.Status) |
| | 687 | | { |
| | 688 | | case 200: |
| | 689 | | case 202: |
| 0 | 690 | | return message.Response; |
| | 691 | | default: |
| 0 | 692 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 693 | | } |
| 0 | 694 | | } |
| | 695 | |
|
| | 696 | | internal HttpMessage CreateGetStatsRequest(string resourceGroupName, string circuitName) |
| | 697 | | { |
| 0 | 698 | | var message = _pipeline.CreateMessage(); |
| 0 | 699 | | var request = message.Request; |
| 0 | 700 | | request.Method = RequestMethod.Get; |
| 0 | 701 | | var uri = new RawRequestUriBuilder(); |
| 0 | 702 | | uri.Reset(endpoint); |
| 0 | 703 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 704 | | uri.AppendPath(subscriptionId, true); |
| 0 | 705 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 706 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 707 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false); |
| 0 | 708 | | uri.AppendPath(circuitName, true); |
| 0 | 709 | | uri.AppendPath("/stats", false); |
| 0 | 710 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 711 | | request.Uri = uri; |
| 0 | 712 | | return message; |
| | 713 | | } |
| | 714 | |
|
| | 715 | | /// <summary> Gets all the stats from an express route circuit in a resource group. </summary> |
| | 716 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 717 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 718 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 719 | | public async Task<Response<ExpressRouteCircuitStats>> GetStatsAsync(string resourceGroupName, string circuitName |
| | 720 | | { |
| 0 | 721 | | if (resourceGroupName == null) |
| | 722 | | { |
| 0 | 723 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 724 | | } |
| 0 | 725 | | if (circuitName == null) |
| | 726 | | { |
| 0 | 727 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 728 | | } |
| | 729 | |
|
| 0 | 730 | | using var message = CreateGetStatsRequest(resourceGroupName, circuitName); |
| 0 | 731 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 732 | | switch (message.Response.Status) |
| | 733 | | { |
| | 734 | | case 200: |
| | 735 | | { |
| 0 | 736 | | ExpressRouteCircuitStats value = default; |
| 0 | 737 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 738 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 739 | | { |
| 0 | 740 | | value = null; |
| | 741 | | } |
| | 742 | | else |
| | 743 | | { |
| 0 | 744 | | value = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(document.RootElement); |
| | 745 | | } |
| 0 | 746 | | return Response.FromValue(value, message.Response); |
| | 747 | | } |
| | 748 | | default: |
| 0 | 749 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 750 | | } |
| 0 | 751 | | } |
| | 752 | |
|
| | 753 | | /// <summary> Gets all the stats from an express route circuit in a resource group. </summary> |
| | 754 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 755 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 756 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 757 | | public Response<ExpressRouteCircuitStats> GetStats(string resourceGroupName, string circuitName, CancellationTok |
| | 758 | | { |
| 0 | 759 | | if (resourceGroupName == null) |
| | 760 | | { |
| 0 | 761 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 762 | | } |
| 0 | 763 | | if (circuitName == null) |
| | 764 | | { |
| 0 | 765 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 766 | | } |
| | 767 | |
|
| 0 | 768 | | using var message = CreateGetStatsRequest(resourceGroupName, circuitName); |
| 0 | 769 | | _pipeline.Send(message, cancellationToken); |
| 0 | 770 | | switch (message.Response.Status) |
| | 771 | | { |
| | 772 | | case 200: |
| | 773 | | { |
| 0 | 774 | | ExpressRouteCircuitStats value = default; |
| 0 | 775 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 776 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 777 | | { |
| 0 | 778 | | value = null; |
| | 779 | | } |
| | 780 | | else |
| | 781 | | { |
| 0 | 782 | | value = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(document.RootElement); |
| | 783 | | } |
| 0 | 784 | | return Response.FromValue(value, message.Response); |
| | 785 | | } |
| | 786 | | default: |
| 0 | 787 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 788 | | } |
| 0 | 789 | | } |
| | 790 | |
|
| | 791 | | internal HttpMessage CreateGetPeeringStatsRequest(string resourceGroupName, string circuitName, string peeringNa |
| | 792 | | { |
| 0 | 793 | | var message = _pipeline.CreateMessage(); |
| 0 | 794 | | var request = message.Request; |
| 0 | 795 | | request.Method = RequestMethod.Get; |
| 0 | 796 | | var uri = new RawRequestUriBuilder(); |
| 0 | 797 | | uri.Reset(endpoint); |
| 0 | 798 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 799 | | uri.AppendPath(subscriptionId, true); |
| 0 | 800 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 801 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 802 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits/", false); |
| 0 | 803 | | uri.AppendPath(circuitName, true); |
| 0 | 804 | | uri.AppendPath("/peerings/", false); |
| 0 | 805 | | uri.AppendPath(peeringName, true); |
| 0 | 806 | | uri.AppendPath("/stats", false); |
| 0 | 807 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 808 | | request.Uri = uri; |
| 0 | 809 | | return message; |
| | 810 | | } |
| | 811 | |
|
| | 812 | | /// <summary> Gets all stats from an express route circuit in a resource group. </summary> |
| | 813 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 814 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 815 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 816 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 817 | | public async Task<Response<ExpressRouteCircuitStats>> GetPeeringStatsAsync(string resourceGroupName, string circ |
| | 818 | | { |
| 0 | 819 | | if (resourceGroupName == null) |
| | 820 | | { |
| 0 | 821 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 822 | | } |
| 0 | 823 | | if (circuitName == null) |
| | 824 | | { |
| 0 | 825 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 826 | | } |
| 0 | 827 | | if (peeringName == null) |
| | 828 | | { |
| 0 | 829 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 830 | | } |
| | 831 | |
|
| 0 | 832 | | using var message = CreateGetPeeringStatsRequest(resourceGroupName, circuitName, peeringName); |
| 0 | 833 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 834 | | switch (message.Response.Status) |
| | 835 | | { |
| | 836 | | case 200: |
| | 837 | | { |
| 0 | 838 | | ExpressRouteCircuitStats value = default; |
| 0 | 839 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 840 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 841 | | { |
| 0 | 842 | | value = null; |
| | 843 | | } |
| | 844 | | else |
| | 845 | | { |
| 0 | 846 | | value = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(document.RootElement); |
| | 847 | | } |
| 0 | 848 | | return Response.FromValue(value, message.Response); |
| | 849 | | } |
| | 850 | | default: |
| 0 | 851 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 852 | | } |
| 0 | 853 | | } |
| | 854 | |
|
| | 855 | | /// <summary> Gets all stats from an express route circuit in a resource group. </summary> |
| | 856 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 857 | | /// <param name="circuitName"> The name of the express route circuit. </param> |
| | 858 | | /// <param name="peeringName"> The name of the peering. </param> |
| | 859 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 860 | | public Response<ExpressRouteCircuitStats> GetPeeringStats(string resourceGroupName, string circuitName, string p |
| | 861 | | { |
| 0 | 862 | | if (resourceGroupName == null) |
| | 863 | | { |
| 0 | 864 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 865 | | } |
| 0 | 866 | | if (circuitName == null) |
| | 867 | | { |
| 0 | 868 | | throw new ArgumentNullException(nameof(circuitName)); |
| | 869 | | } |
| 0 | 870 | | if (peeringName == null) |
| | 871 | | { |
| 0 | 872 | | throw new ArgumentNullException(nameof(peeringName)); |
| | 873 | | } |
| | 874 | |
|
| 0 | 875 | | using var message = CreateGetPeeringStatsRequest(resourceGroupName, circuitName, peeringName); |
| 0 | 876 | | _pipeline.Send(message, cancellationToken); |
| 0 | 877 | | switch (message.Response.Status) |
| | 878 | | { |
| | 879 | | case 200: |
| | 880 | | { |
| 0 | 881 | | ExpressRouteCircuitStats value = default; |
| 0 | 882 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 883 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 884 | | { |
| 0 | 885 | | value = null; |
| | 886 | | } |
| | 887 | | else |
| | 888 | | { |
| 0 | 889 | | value = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(document.RootElement); |
| | 890 | | } |
| 0 | 891 | | return Response.FromValue(value, message.Response); |
| | 892 | | } |
| | 893 | | default: |
| 0 | 894 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 895 | | } |
| 0 | 896 | | } |
| | 897 | |
|
| | 898 | | internal HttpMessage CreateListRequest(string resourceGroupName) |
| | 899 | | { |
| 0 | 900 | | var message = _pipeline.CreateMessage(); |
| 0 | 901 | | var request = message.Request; |
| 0 | 902 | | request.Method = RequestMethod.Get; |
| 0 | 903 | | var uri = new RawRequestUriBuilder(); |
| 0 | 904 | | uri.Reset(endpoint); |
| 0 | 905 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 906 | | uri.AppendPath(subscriptionId, true); |
| 0 | 907 | | uri.AppendPath("/resourceGroups/", false); |
| 0 | 908 | | uri.AppendPath(resourceGroupName, true); |
| 0 | 909 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits", false); |
| 0 | 910 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 911 | | request.Uri = uri; |
| 0 | 912 | | return message; |
| | 913 | | } |
| | 914 | |
|
| | 915 | | /// <summary> Gets all the express route circuits in a resource group. </summary> |
| | 916 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 917 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 918 | | public async Task<Response<ExpressRouteCircuitListResult>> ListAsync(string resourceGroupName, CancellationToken |
| | 919 | | { |
| 0 | 920 | | if (resourceGroupName == null) |
| | 921 | | { |
| 0 | 922 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 923 | | } |
| | 924 | |
|
| 0 | 925 | | using var message = CreateListRequest(resourceGroupName); |
| 0 | 926 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 927 | | switch (message.Response.Status) |
| | 928 | | { |
| | 929 | | case 200: |
| | 930 | | { |
| 0 | 931 | | ExpressRouteCircuitListResult value = default; |
| 0 | 932 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 933 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 934 | | { |
| 0 | 935 | | value = null; |
| | 936 | | } |
| | 937 | | else |
| | 938 | | { |
| 0 | 939 | | value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root |
| | 940 | | } |
| 0 | 941 | | return Response.FromValue(value, message.Response); |
| | 942 | | } |
| | 943 | | default: |
| 0 | 944 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 945 | | } |
| 0 | 946 | | } |
| | 947 | |
|
| | 948 | | /// <summary> Gets all the express route circuits in a resource group. </summary> |
| | 949 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 950 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 951 | | public Response<ExpressRouteCircuitListResult> List(string resourceGroupName, CancellationToken cancellationToke |
| | 952 | | { |
| 0 | 953 | | if (resourceGroupName == null) |
| | 954 | | { |
| 0 | 955 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 956 | | } |
| | 957 | |
|
| 0 | 958 | | using var message = CreateListRequest(resourceGroupName); |
| 0 | 959 | | _pipeline.Send(message, cancellationToken); |
| 0 | 960 | | switch (message.Response.Status) |
| | 961 | | { |
| | 962 | | case 200: |
| | 963 | | { |
| 0 | 964 | | ExpressRouteCircuitListResult value = default; |
| 0 | 965 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 966 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 967 | | { |
| 0 | 968 | | value = null; |
| | 969 | | } |
| | 970 | | else |
| | 971 | | { |
| 0 | 972 | | value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root |
| | 973 | | } |
| 0 | 974 | | return Response.FromValue(value, message.Response); |
| | 975 | | } |
| | 976 | | default: |
| 0 | 977 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 978 | | } |
| 0 | 979 | | } |
| | 980 | |
|
| | 981 | | internal HttpMessage CreateListAllRequest() |
| | 982 | | { |
| 0 | 983 | | var message = _pipeline.CreateMessage(); |
| 0 | 984 | | var request = message.Request; |
| 0 | 985 | | request.Method = RequestMethod.Get; |
| 0 | 986 | | var uri = new RawRequestUriBuilder(); |
| 0 | 987 | | uri.Reset(endpoint); |
| 0 | 988 | | uri.AppendPath("/subscriptions/", false); |
| 0 | 989 | | uri.AppendPath(subscriptionId, true); |
| 0 | 990 | | uri.AppendPath("/providers/Microsoft.Network/expressRouteCircuits", false); |
| 0 | 991 | | uri.AppendQuery("api-version", "2020-04-01", true); |
| 0 | 992 | | request.Uri = uri; |
| 0 | 993 | | return message; |
| | 994 | | } |
| | 995 | |
|
| | 996 | | /// <summary> Gets all the express route circuits in a subscription. </summary> |
| | 997 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 998 | | public async Task<Response<ExpressRouteCircuitListResult>> ListAllAsync(CancellationToken cancellationToken = de |
| | 999 | | { |
| 0 | 1000 | | using var message = CreateListAllRequest(); |
| 0 | 1001 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1002 | | switch (message.Response.Status) |
| | 1003 | | { |
| | 1004 | | case 200: |
| | 1005 | | { |
| 0 | 1006 | | ExpressRouteCircuitListResult value = default; |
| 0 | 1007 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1008 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1009 | | { |
| 0 | 1010 | | value = null; |
| | 1011 | | } |
| | 1012 | | else |
| | 1013 | | { |
| 0 | 1014 | | value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root |
| | 1015 | | } |
| 0 | 1016 | | return Response.FromValue(value, message.Response); |
| | 1017 | | } |
| | 1018 | | default: |
| 0 | 1019 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1020 | | } |
| 0 | 1021 | | } |
| | 1022 | |
|
| | 1023 | | /// <summary> Gets all the express route circuits in a subscription. </summary> |
| | 1024 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1025 | | public Response<ExpressRouteCircuitListResult> ListAll(CancellationToken cancellationToken = default) |
| | 1026 | | { |
| 0 | 1027 | | using var message = CreateListAllRequest(); |
| 0 | 1028 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1029 | | switch (message.Response.Status) |
| | 1030 | | { |
| | 1031 | | case 200: |
| | 1032 | | { |
| 0 | 1033 | | ExpressRouteCircuitListResult value = default; |
| 0 | 1034 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1035 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1036 | | { |
| 0 | 1037 | | value = null; |
| | 1038 | | } |
| | 1039 | | else |
| | 1040 | | { |
| 0 | 1041 | | value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root |
| | 1042 | | } |
| 0 | 1043 | | return Response.FromValue(value, message.Response); |
| | 1044 | | } |
| | 1045 | | default: |
| 0 | 1046 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1047 | | } |
| 0 | 1048 | | } |
| | 1049 | |
|
| | 1050 | | internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName) |
| | 1051 | | { |
| 0 | 1052 | | var message = _pipeline.CreateMessage(); |
| 0 | 1053 | | var request = message.Request; |
| 0 | 1054 | | request.Method = RequestMethod.Get; |
| 0 | 1055 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1056 | | uri.Reset(endpoint); |
| 0 | 1057 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1058 | | request.Uri = uri; |
| 0 | 1059 | | return message; |
| | 1060 | | } |
| | 1061 | |
|
| | 1062 | | /// <summary> Gets all the express route circuits in a resource group. </summary> |
| | 1063 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1064 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1065 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1066 | | public async Task<Response<ExpressRouteCircuitListResult>> ListNextPageAsync(string nextLink, string resourceGro |
| | 1067 | | { |
| 0 | 1068 | | if (nextLink == null) |
| | 1069 | | { |
| 0 | 1070 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1071 | | } |
| 0 | 1072 | | if (resourceGroupName == null) |
| | 1073 | | { |
| 0 | 1074 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1075 | | } |
| | 1076 | |
|
| 0 | 1077 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName); |
| 0 | 1078 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1079 | | switch (message.Response.Status) |
| | 1080 | | { |
| | 1081 | | case 200: |
| | 1082 | | { |
| 0 | 1083 | | ExpressRouteCircuitListResult value = default; |
| 0 | 1084 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1085 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1086 | | { |
| 0 | 1087 | | value = null; |
| | 1088 | | } |
| | 1089 | | else |
| | 1090 | | { |
| 0 | 1091 | | value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root |
| | 1092 | | } |
| 0 | 1093 | | return Response.FromValue(value, message.Response); |
| | 1094 | | } |
| | 1095 | | default: |
| 0 | 1096 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1097 | | } |
| 0 | 1098 | | } |
| | 1099 | |
|
| | 1100 | | /// <summary> Gets all the express route circuits in a resource group. </summary> |
| | 1101 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1102 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1103 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1104 | | public Response<ExpressRouteCircuitListResult> ListNextPage(string nextLink, string resourceGroupName, Cancellat |
| | 1105 | | { |
| 0 | 1106 | | if (nextLink == null) |
| | 1107 | | { |
| 0 | 1108 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1109 | | } |
| 0 | 1110 | | if (resourceGroupName == null) |
| | 1111 | | { |
| 0 | 1112 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1113 | | } |
| | 1114 | |
|
| 0 | 1115 | | using var message = CreateListNextPageRequest(nextLink, resourceGroupName); |
| 0 | 1116 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1117 | | switch (message.Response.Status) |
| | 1118 | | { |
| | 1119 | | case 200: |
| | 1120 | | { |
| 0 | 1121 | | ExpressRouteCircuitListResult value = default; |
| 0 | 1122 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1123 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1124 | | { |
| 0 | 1125 | | value = null; |
| | 1126 | | } |
| | 1127 | | else |
| | 1128 | | { |
| 0 | 1129 | | value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root |
| | 1130 | | } |
| 0 | 1131 | | return Response.FromValue(value, message.Response); |
| | 1132 | | } |
| | 1133 | | default: |
| 0 | 1134 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1135 | | } |
| 0 | 1136 | | } |
| | 1137 | |
|
| | 1138 | | internal HttpMessage CreateListAllNextPageRequest(string nextLink) |
| | 1139 | | { |
| 0 | 1140 | | var message = _pipeline.CreateMessage(); |
| 0 | 1141 | | var request = message.Request; |
| 0 | 1142 | | request.Method = RequestMethod.Get; |
| 0 | 1143 | | var uri = new RawRequestUriBuilder(); |
| 0 | 1144 | | uri.Reset(endpoint); |
| 0 | 1145 | | uri.AppendRawNextLink(nextLink, false); |
| 0 | 1146 | | request.Uri = uri; |
| 0 | 1147 | | return message; |
| | 1148 | | } |
| | 1149 | |
|
| | 1150 | | /// <summary> Gets all the express route circuits in a subscription. </summary> |
| | 1151 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1152 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1153 | | public async Task<Response<ExpressRouteCircuitListResult>> ListAllNextPageAsync(string nextLink, CancellationTok |
| | 1154 | | { |
| 0 | 1155 | | if (nextLink == null) |
| | 1156 | | { |
| 0 | 1157 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1158 | | } |
| | 1159 | |
|
| 0 | 1160 | | using var message = CreateListAllNextPageRequest(nextLink); |
| 0 | 1161 | | await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); |
| 0 | 1162 | | switch (message.Response.Status) |
| | 1163 | | { |
| | 1164 | | case 200: |
| | 1165 | | { |
| 0 | 1166 | | ExpressRouteCircuitListResult value = default; |
| 0 | 1167 | | using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc |
| 0 | 1168 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1169 | | { |
| 0 | 1170 | | value = null; |
| | 1171 | | } |
| | 1172 | | else |
| | 1173 | | { |
| 0 | 1174 | | value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root |
| | 1175 | | } |
| 0 | 1176 | | return Response.FromValue(value, message.Response); |
| | 1177 | | } |
| | 1178 | | default: |
| 0 | 1179 | | throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa |
| | 1180 | | } |
| 0 | 1181 | | } |
| | 1182 | |
|
| | 1183 | | /// <summary> Gets all the express route circuits in a subscription. </summary> |
| | 1184 | | /// <param name="nextLink"> The URL to the next page of results. </param> |
| | 1185 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1186 | | public Response<ExpressRouteCircuitListResult> ListAllNextPage(string nextLink, CancellationToken cancellationTo |
| | 1187 | | { |
| 0 | 1188 | | if (nextLink == null) |
| | 1189 | | { |
| 0 | 1190 | | throw new ArgumentNullException(nameof(nextLink)); |
| | 1191 | | } |
| | 1192 | |
|
| 0 | 1193 | | using var message = CreateListAllNextPageRequest(nextLink); |
| 0 | 1194 | | _pipeline.Send(message, cancellationToken); |
| 0 | 1195 | | switch (message.Response.Status) |
| | 1196 | | { |
| | 1197 | | case 200: |
| | 1198 | | { |
| 0 | 1199 | | ExpressRouteCircuitListResult value = default; |
| 0 | 1200 | | using var document = JsonDocument.Parse(message.Response.ContentStream); |
| 0 | 1201 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 1202 | | { |
| 0 | 1203 | | value = null; |
| | 1204 | | } |
| | 1205 | | else |
| | 1206 | | { |
| 0 | 1207 | | value = ExpressRouteCircuitListResult.DeserializeExpressRouteCircuitListResult(document.Root |
| | 1208 | | } |
| 0 | 1209 | | return Response.FromValue(value, message.Response); |
| | 1210 | | } |
| | 1211 | | default: |
| 0 | 1212 | | throw _clientDiagnostics.CreateRequestFailedException(message.Response); |
| | 1213 | | } |
| 0 | 1214 | | } |
| | 1215 | | } |
| | 1216 | | } |