| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Threading; |
| | 10 | | using System.Threading.Tasks; |
| | 11 | | using Azure.Core.Pipeline; |
| | 12 | | using Azure.ResourceManager.Compute.Models; |
| | 13 | |
|
| | 14 | | namespace Azure.ResourceManager.Compute |
| | 15 | | { |
| | 16 | | /// <summary> The LogAnalytics service client. </summary> |
| | 17 | | public partial class LogAnalyticsOperations |
| | 18 | | { |
| | 19 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 20 | | private readonly HttpPipeline _pipeline; |
| 0 | 21 | | internal LogAnalyticsRestOperations RestClient { get; } |
| | 22 | | /// <summary> Initializes a new instance of LogAnalyticsOperations for mocking. </summary> |
| 396 | 23 | | protected LogAnalyticsOperations() |
| | 24 | | { |
| 396 | 25 | | } |
| | 26 | | /// <summary> Initializes a new instance of LogAnalyticsOperations. </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"> Subscription credentials which uniquely identify Microsoft Azure subscription. |
| | 30 | | /// <param name="endpoint"> server parameter. </param> |
| 396 | 31 | | internal LogAnalyticsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionI |
| | 32 | | { |
| 396 | 33 | | RestClient = new LogAnalyticsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 396 | 34 | | _clientDiagnostics = clientDiagnostics; |
| 396 | 35 | | _pipeline = pipeline; |
| 396 | 36 | | } |
| | 37 | |
|
| | 38 | | /// <summary> Export logs that show Api requests made by this subscription in the given time window to show thro |
| | 39 | | /// <param name="location"> The location upon which virtual-machine-sizes is queried. </param> |
| | 40 | | /// <param name="parameters"> Parameters supplied to the LogAnalytics getRequestRateByInterval Api. </param> |
| | 41 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 42 | | public virtual async Task<LogAnalyticsExportRequestRateByIntervalOperation> StartExportRequestRateByIntervalAsyn |
| | 43 | | { |
| 0 | 44 | | if (location == null) |
| | 45 | | { |
| 0 | 46 | | throw new ArgumentNullException(nameof(location)); |
| | 47 | | } |
| 0 | 48 | | if (parameters == null) |
| | 49 | | { |
| 0 | 50 | | throw new ArgumentNullException(nameof(parameters)); |
| | 51 | | } |
| | 52 | |
|
| 0 | 53 | | using var scope = _clientDiagnostics.CreateScope("LogAnalyticsOperations.StartExportRequestRateByInterval"); |
| 0 | 54 | | scope.Start(); |
| | 55 | | try |
| | 56 | | { |
| 0 | 57 | | var originalResponse = await RestClient.ExportRequestRateByIntervalAsync(location, parameters, cancellat |
| 0 | 58 | | return new LogAnalyticsExportRequestRateByIntervalOperation(_clientDiagnostics, _pipeline, RestClient.Cr |
| | 59 | | } |
| 0 | 60 | | catch (Exception e) |
| | 61 | | { |
| 0 | 62 | | scope.Failed(e); |
| 0 | 63 | | throw; |
| | 64 | | } |
| 0 | 65 | | } |
| | 66 | |
|
| | 67 | | /// <summary> Export logs that show Api requests made by this subscription in the given time window to show thro |
| | 68 | | /// <param name="location"> The location upon which virtual-machine-sizes is queried. </param> |
| | 69 | | /// <param name="parameters"> Parameters supplied to the LogAnalytics getRequestRateByInterval Api. </param> |
| | 70 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 71 | | public virtual LogAnalyticsExportRequestRateByIntervalOperation StartExportRequestRateByInterval(string location |
| | 72 | | { |
| 0 | 73 | | if (location == null) |
| | 74 | | { |
| 0 | 75 | | throw new ArgumentNullException(nameof(location)); |
| | 76 | | } |
| 0 | 77 | | if (parameters == null) |
| | 78 | | { |
| 0 | 79 | | throw new ArgumentNullException(nameof(parameters)); |
| | 80 | | } |
| | 81 | |
|
| 0 | 82 | | using var scope = _clientDiagnostics.CreateScope("LogAnalyticsOperations.StartExportRequestRateByInterval"); |
| 0 | 83 | | scope.Start(); |
| | 84 | | try |
| | 85 | | { |
| 0 | 86 | | var originalResponse = RestClient.ExportRequestRateByInterval(location, parameters, cancellationToken); |
| 0 | 87 | | return new LogAnalyticsExportRequestRateByIntervalOperation(_clientDiagnostics, _pipeline, RestClient.Cr |
| | 88 | | } |
| 0 | 89 | | catch (Exception e) |
| | 90 | | { |
| 0 | 91 | | scope.Failed(e); |
| 0 | 92 | | throw; |
| | 93 | | } |
| 0 | 94 | | } |
| | 95 | |
|
| | 96 | | /// <summary> Export logs that show total throttled Api requests for this subscription in the given time window. |
| | 97 | | /// <param name="location"> The location upon which virtual-machine-sizes is queried. </param> |
| | 98 | | /// <param name="parameters"> Parameters supplied to the LogAnalytics getThrottledRequests Api. </param> |
| | 99 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 100 | | public virtual async Task<LogAnalyticsExportThrottledRequestsOperation> StartExportThrottledRequestsAsync(string |
| | 101 | | { |
| 0 | 102 | | if (location == null) |
| | 103 | | { |
| 0 | 104 | | throw new ArgumentNullException(nameof(location)); |
| | 105 | | } |
| 0 | 106 | | if (parameters == null) |
| | 107 | | { |
| 0 | 108 | | throw new ArgumentNullException(nameof(parameters)); |
| | 109 | | } |
| | 110 | |
|
| 0 | 111 | | using var scope = _clientDiagnostics.CreateScope("LogAnalyticsOperations.StartExportThrottledRequests"); |
| 0 | 112 | | scope.Start(); |
| | 113 | | try |
| | 114 | | { |
| 0 | 115 | | var originalResponse = await RestClient.ExportThrottledRequestsAsync(location, parameters, cancellationT |
| 0 | 116 | | return new LogAnalyticsExportThrottledRequestsOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | 117 | | } |
| 0 | 118 | | catch (Exception e) |
| | 119 | | { |
| 0 | 120 | | scope.Failed(e); |
| 0 | 121 | | throw; |
| | 122 | | } |
| 0 | 123 | | } |
| | 124 | |
|
| | 125 | | /// <summary> Export logs that show total throttled Api requests for this subscription in the given time window. |
| | 126 | | /// <param name="location"> The location upon which virtual-machine-sizes is queried. </param> |
| | 127 | | /// <param name="parameters"> Parameters supplied to the LogAnalytics getThrottledRequests Api. </param> |
| | 128 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 129 | | public virtual LogAnalyticsExportThrottledRequestsOperation StartExportThrottledRequests(string location, LogAna |
| | 130 | | { |
| 0 | 131 | | if (location == null) |
| | 132 | | { |
| 0 | 133 | | throw new ArgumentNullException(nameof(location)); |
| | 134 | | } |
| 0 | 135 | | if (parameters == null) |
| | 136 | | { |
| 0 | 137 | | throw new ArgumentNullException(nameof(parameters)); |
| | 138 | | } |
| | 139 | |
|
| 0 | 140 | | using var scope = _clientDiagnostics.CreateScope("LogAnalyticsOperations.StartExportThrottledRequests"); |
| 0 | 141 | | scope.Start(); |
| | 142 | | try |
| | 143 | | { |
| 0 | 144 | | var originalResponse = RestClient.ExportThrottledRequests(location, parameters, cancellationToken); |
| 0 | 145 | | return new LogAnalyticsExportThrottledRequestsOperation(_clientDiagnostics, _pipeline, RestClient.Create |
| | 146 | | } |
| 0 | 147 | | catch (Exception e) |
| | 148 | | { |
| 0 | 149 | | scope.Failed(e); |
| 0 | 150 | | throw; |
| | 151 | | } |
| 0 | 152 | | } |
| | 153 | | } |
| | 154 | | } |