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