| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | // <auto-generated/> |
| | | 5 | | |
| | | 6 | | #nullable disable |
| | | 7 | | |
| | | 8 | | using System; |
| | | 9 | | using System.Threading; |
| | | 10 | | using System.Threading.Tasks; |
| | | 11 | | using Azure; |
| | | 12 | | using Azure.Core; |
| | | 13 | | using Azure.Core.Pipeline; |
| | | 14 | | using Azure.ResourceManager.Network.Models; |
| | | 15 | | |
| | | 16 | | namespace Azure.ResourceManager.Network |
| | | 17 | | { |
| | | 18 | | /// <summary> The ConnectionMonitors service client. </summary> |
| | | 19 | | public partial class ConnectionMonitorsOperations |
| | | 20 | | { |
| | | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | | 22 | | private readonly HttpPipeline _pipeline; |
| | 0 | 23 | | internal ConnectionMonitorsRestOperations RestClient { get; } |
| | | 24 | | /// <summary> Initializes a new instance of ConnectionMonitorsOperations for mocking. </summary> |
| | 0 | 25 | | protected ConnectionMonitorsOperations() |
| | | 26 | | { |
| | 0 | 27 | | } |
| | | 28 | | /// <summary> Initializes a new instance of ConnectionMonitorsOperations. </summary> |
| | | 29 | | /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param> |
| | | 30 | | /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param> |
| | | 31 | | /// <param name="subscriptionId"> The subscription credentials which uniquely identify the Microsoft Azure subsc |
| | | 32 | | /// <param name="endpoint"> server parameter. </param> |
| | 0 | 33 | | internal ConnectionMonitorsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscri |
| | | 34 | | { |
| | 0 | 35 | | RestClient = new ConnectionMonitorsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| | 0 | 36 | | _clientDiagnostics = clientDiagnostics; |
| | 0 | 37 | | _pipeline = pipeline; |
| | 0 | 38 | | } |
| | | 39 | | |
| | | 40 | | /// <summary> Gets a connection monitor by name. </summary> |
| | | 41 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 42 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 43 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 44 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 45 | | public virtual async Task<Response<ConnectionMonitorResult>> GetAsync(string resourceGroupName, string networkWa |
| | | 46 | | { |
| | 0 | 47 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.Get"); |
| | 0 | 48 | | scope.Start(); |
| | | 49 | | try |
| | | 50 | | { |
| | 0 | 51 | | return await RestClient.GetAsync(resourceGroupName, networkWatcherName, connectionMonitorName, cancellat |
| | | 52 | | } |
| | 0 | 53 | | catch (Exception e) |
| | | 54 | | { |
| | 0 | 55 | | scope.Failed(e); |
| | 0 | 56 | | throw; |
| | | 57 | | } |
| | 0 | 58 | | } |
| | | 59 | | |
| | | 60 | | /// <summary> Gets a connection monitor by name. </summary> |
| | | 61 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 62 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 63 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 64 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 65 | | public virtual Response<ConnectionMonitorResult> Get(string resourceGroupName, string networkWatcherName, string |
| | | 66 | | { |
| | 0 | 67 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.Get"); |
| | 0 | 68 | | scope.Start(); |
| | | 69 | | try |
| | | 70 | | { |
| | 0 | 71 | | return RestClient.Get(resourceGroupName, networkWatcherName, connectionMonitorName, cancellationToken); |
| | | 72 | | } |
| | 0 | 73 | | catch (Exception e) |
| | | 74 | | { |
| | 0 | 75 | | scope.Failed(e); |
| | 0 | 76 | | throw; |
| | | 77 | | } |
| | 0 | 78 | | } |
| | | 79 | | |
| | | 80 | | /// <summary> Update tags of the specified connection monitor. </summary> |
| | | 81 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 82 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | | 83 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 84 | | /// <param name="parameters"> Parameters supplied to update connection monitor tags. </param> |
| | | 85 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 86 | | public virtual async Task<Response<ConnectionMonitorResult>> UpdateTagsAsync(string resourceGroupName, string ne |
| | | 87 | | { |
| | 0 | 88 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.UpdateTags"); |
| | 0 | 89 | | scope.Start(); |
| | | 90 | | try |
| | | 91 | | { |
| | 0 | 92 | | return await RestClient.UpdateTagsAsync(resourceGroupName, networkWatcherName, connectionMonitorName, pa |
| | | 93 | | } |
| | 0 | 94 | | catch (Exception e) |
| | | 95 | | { |
| | 0 | 96 | | scope.Failed(e); |
| | 0 | 97 | | throw; |
| | | 98 | | } |
| | 0 | 99 | | } |
| | | 100 | | |
| | | 101 | | /// <summary> Update tags of the specified connection monitor. </summary> |
| | | 102 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | | 103 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | | 104 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 105 | | /// <param name="parameters"> Parameters supplied to update connection monitor tags. </param> |
| | | 106 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 107 | | public virtual Response<ConnectionMonitorResult> UpdateTags(string resourceGroupName, string networkWatcherName, |
| | | 108 | | { |
| | 0 | 109 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.UpdateTags"); |
| | 0 | 110 | | scope.Start(); |
| | | 111 | | try |
| | | 112 | | { |
| | 0 | 113 | | return RestClient.UpdateTags(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, c |
| | | 114 | | } |
| | 0 | 115 | | catch (Exception e) |
| | | 116 | | { |
| | 0 | 117 | | scope.Failed(e); |
| | 0 | 118 | | throw; |
| | | 119 | | } |
| | 0 | 120 | | } |
| | | 121 | | |
| | | 122 | | /// <summary> Lists all connection monitors for the specified Network Watcher. </summary> |
| | | 123 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 124 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 125 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 126 | | public virtual AsyncPageable<ConnectionMonitorResult> ListAsync(string resourceGroupName, string networkWatcherN |
| | | 127 | | { |
| | 0 | 128 | | if (resourceGroupName == null) |
| | | 129 | | { |
| | 0 | 130 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 131 | | } |
| | 0 | 132 | | if (networkWatcherName == null) |
| | | 133 | | { |
| | 0 | 134 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 135 | | } |
| | | 136 | | |
| | | 137 | | async Task<Page<ConnectionMonitorResult>> FirstPageFunc(int? pageSizeHint) |
| | | 138 | | { |
| | 0 | 139 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.List"); |
| | 0 | 140 | | scope.Start(); |
| | | 141 | | try |
| | | 142 | | { |
| | 0 | 143 | | var response = await RestClient.ListAsync(resourceGroupName, networkWatcherName, cancellationToken). |
| | 0 | 144 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | | 145 | | } |
| | 0 | 146 | | catch (Exception e) |
| | | 147 | | { |
| | 0 | 148 | | scope.Failed(e); |
| | 0 | 149 | | throw; |
| | | 150 | | } |
| | 0 | 151 | | } |
| | 0 | 152 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); |
| | | 153 | | } |
| | | 154 | | |
| | | 155 | | /// <summary> Lists all connection monitors for the specified Network Watcher. </summary> |
| | | 156 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 157 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 158 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 159 | | public virtual Pageable<ConnectionMonitorResult> List(string resourceGroupName, string networkWatcherName, Cance |
| | | 160 | | { |
| | 0 | 161 | | if (resourceGroupName == null) |
| | | 162 | | { |
| | 0 | 163 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 164 | | } |
| | 0 | 165 | | if (networkWatcherName == null) |
| | | 166 | | { |
| | 0 | 167 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 168 | | } |
| | | 169 | | |
| | | 170 | | Page<ConnectionMonitorResult> FirstPageFunc(int? pageSizeHint) |
| | | 171 | | { |
| | 0 | 172 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.List"); |
| | 0 | 173 | | scope.Start(); |
| | | 174 | | try |
| | | 175 | | { |
| | 0 | 176 | | var response = RestClient.List(resourceGroupName, networkWatcherName, cancellationToken); |
| | 0 | 177 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | | 178 | | } |
| | 0 | 179 | | catch (Exception e) |
| | | 180 | | { |
| | 0 | 181 | | scope.Failed(e); |
| | 0 | 182 | | throw; |
| | | 183 | | } |
| | 0 | 184 | | } |
| | 0 | 185 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, null); |
| | | 186 | | } |
| | | 187 | | |
| | | 188 | | /// <summary> Create or update a connection monitor. </summary> |
| | | 189 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 190 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 191 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 192 | | /// <param name="parameters"> Parameters that define the operation to create a connection monitor. </param> |
| | | 193 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 194 | | public virtual async Task<ConnectionMonitorsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGro |
| | | 195 | | { |
| | 0 | 196 | | if (resourceGroupName == null) |
| | | 197 | | { |
| | 0 | 198 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 199 | | } |
| | 0 | 200 | | if (networkWatcherName == null) |
| | | 201 | | { |
| | 0 | 202 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 203 | | } |
| | 0 | 204 | | if (connectionMonitorName == null) |
| | | 205 | | { |
| | 0 | 206 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 207 | | } |
| | 0 | 208 | | if (parameters == null) |
| | | 209 | | { |
| | 0 | 210 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 211 | | } |
| | | 212 | | |
| | 0 | 213 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartCreateOrUpdate"); |
| | 0 | 214 | | scope.Start(); |
| | | 215 | | try |
| | | 216 | | { |
| | 0 | 217 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, networkWatcherName, conne |
| | 0 | 218 | | return new ConnectionMonitorsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCre |
| | | 219 | | } |
| | 0 | 220 | | catch (Exception e) |
| | | 221 | | { |
| | 0 | 222 | | scope.Failed(e); |
| | 0 | 223 | | throw; |
| | | 224 | | } |
| | 0 | 225 | | } |
| | | 226 | | |
| | | 227 | | /// <summary> Create or update a connection monitor. </summary> |
| | | 228 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 229 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 230 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 231 | | /// <param name="parameters"> Parameters that define the operation to create a connection monitor. </param> |
| | | 232 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 233 | | public virtual ConnectionMonitorsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string ne |
| | | 234 | | { |
| | 0 | 235 | | if (resourceGroupName == null) |
| | | 236 | | { |
| | 0 | 237 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 238 | | } |
| | 0 | 239 | | if (networkWatcherName == null) |
| | | 240 | | { |
| | 0 | 241 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 242 | | } |
| | 0 | 243 | | if (connectionMonitorName == null) |
| | | 244 | | { |
| | 0 | 245 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 246 | | } |
| | 0 | 247 | | if (parameters == null) |
| | | 248 | | { |
| | 0 | 249 | | throw new ArgumentNullException(nameof(parameters)); |
| | | 250 | | } |
| | | 251 | | |
| | 0 | 252 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartCreateOrUpdate"); |
| | 0 | 253 | | scope.Start(); |
| | | 254 | | try |
| | | 255 | | { |
| | 0 | 256 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonito |
| | 0 | 257 | | return new ConnectionMonitorsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCre |
| | | 258 | | } |
| | 0 | 259 | | catch (Exception e) |
| | | 260 | | { |
| | 0 | 261 | | scope.Failed(e); |
| | 0 | 262 | | throw; |
| | | 263 | | } |
| | 0 | 264 | | } |
| | | 265 | | |
| | | 266 | | /// <summary> Deletes the specified connection monitor. </summary> |
| | | 267 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 268 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 269 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 270 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 271 | | public virtual async Task<ConnectionMonitorsDeleteOperation> StartDeleteAsync(string resourceGroupName, string n |
| | | 272 | | { |
| | 0 | 273 | | if (resourceGroupName == null) |
| | | 274 | | { |
| | 0 | 275 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 276 | | } |
| | 0 | 277 | | if (networkWatcherName == null) |
| | | 278 | | { |
| | 0 | 279 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 280 | | } |
| | 0 | 281 | | if (connectionMonitorName == null) |
| | | 282 | | { |
| | 0 | 283 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 284 | | } |
| | | 285 | | |
| | 0 | 286 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartDelete"); |
| | 0 | 287 | | scope.Start(); |
| | | 288 | | try |
| | | 289 | | { |
| | 0 | 290 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, networkWatcherName, connectionMon |
| | 0 | 291 | | return new ConnectionMonitorsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReque |
| | | 292 | | } |
| | 0 | 293 | | catch (Exception e) |
| | | 294 | | { |
| | 0 | 295 | | scope.Failed(e); |
| | 0 | 296 | | throw; |
| | | 297 | | } |
| | 0 | 298 | | } |
| | | 299 | | |
| | | 300 | | /// <summary> Deletes the specified connection monitor. </summary> |
| | | 301 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 302 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 303 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 304 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 305 | | public virtual ConnectionMonitorsDeleteOperation StartDelete(string resourceGroupName, string networkWatcherName |
| | | 306 | | { |
| | 0 | 307 | | if (resourceGroupName == null) |
| | | 308 | | { |
| | 0 | 309 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 310 | | } |
| | 0 | 311 | | if (networkWatcherName == null) |
| | | 312 | | { |
| | 0 | 313 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 314 | | } |
| | 0 | 315 | | if (connectionMonitorName == null) |
| | | 316 | | { |
| | 0 | 317 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 318 | | } |
| | | 319 | | |
| | 0 | 320 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartDelete"); |
| | 0 | 321 | | scope.Start(); |
| | | 322 | | try |
| | | 323 | | { |
| | 0 | 324 | | var originalResponse = RestClient.Delete(resourceGroupName, networkWatcherName, connectionMonitorName, c |
| | 0 | 325 | | return new ConnectionMonitorsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteReque |
| | | 326 | | } |
| | 0 | 327 | | catch (Exception e) |
| | | 328 | | { |
| | 0 | 329 | | scope.Failed(e); |
| | 0 | 330 | | throw; |
| | | 331 | | } |
| | 0 | 332 | | } |
| | | 333 | | |
| | | 334 | | /// <summary> Stops the specified connection monitor. </summary> |
| | | 335 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 336 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 337 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 338 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 339 | | public virtual async Task<ConnectionMonitorsStopOperation> StartStopAsync(string resourceGroupName, string netwo |
| | | 340 | | { |
| | 0 | 341 | | if (resourceGroupName == null) |
| | | 342 | | { |
| | 0 | 343 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 344 | | } |
| | 0 | 345 | | if (networkWatcherName == null) |
| | | 346 | | { |
| | 0 | 347 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 348 | | } |
| | 0 | 349 | | if (connectionMonitorName == null) |
| | | 350 | | { |
| | 0 | 351 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 352 | | } |
| | | 353 | | |
| | 0 | 354 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartStop"); |
| | 0 | 355 | | scope.Start(); |
| | | 356 | | try |
| | | 357 | | { |
| | 0 | 358 | | var originalResponse = await RestClient.StopAsync(resourceGroupName, networkWatcherName, connectionMonit |
| | 0 | 359 | | return new ConnectionMonitorsStopOperation(_clientDiagnostics, _pipeline, RestClient.CreateStopRequest(r |
| | | 360 | | } |
| | 0 | 361 | | catch (Exception e) |
| | | 362 | | { |
| | 0 | 363 | | scope.Failed(e); |
| | 0 | 364 | | throw; |
| | | 365 | | } |
| | 0 | 366 | | } |
| | | 367 | | |
| | | 368 | | /// <summary> Stops the specified connection monitor. </summary> |
| | | 369 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 370 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 371 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 372 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 373 | | public virtual ConnectionMonitorsStopOperation StartStop(string resourceGroupName, string networkWatcherName, st |
| | | 374 | | { |
| | 0 | 375 | | if (resourceGroupName == null) |
| | | 376 | | { |
| | 0 | 377 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 378 | | } |
| | 0 | 379 | | if (networkWatcherName == null) |
| | | 380 | | { |
| | 0 | 381 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 382 | | } |
| | 0 | 383 | | if (connectionMonitorName == null) |
| | | 384 | | { |
| | 0 | 385 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 386 | | } |
| | | 387 | | |
| | 0 | 388 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartStop"); |
| | 0 | 389 | | scope.Start(); |
| | | 390 | | try |
| | | 391 | | { |
| | 0 | 392 | | var originalResponse = RestClient.Stop(resourceGroupName, networkWatcherName, connectionMonitorName, can |
| | 0 | 393 | | return new ConnectionMonitorsStopOperation(_clientDiagnostics, _pipeline, RestClient.CreateStopRequest(r |
| | | 394 | | } |
| | 0 | 395 | | catch (Exception e) |
| | | 396 | | { |
| | 0 | 397 | | scope.Failed(e); |
| | 0 | 398 | | throw; |
| | | 399 | | } |
| | 0 | 400 | | } |
| | | 401 | | |
| | | 402 | | /// <summary> Starts the specified connection monitor. </summary> |
| | | 403 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 404 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 405 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 406 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 407 | | public virtual async Task<ConnectionMonitorsStartOperation> StartStartAsync(string resourceGroupName, string net |
| | | 408 | | { |
| | 0 | 409 | | if (resourceGroupName == null) |
| | | 410 | | { |
| | 0 | 411 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 412 | | } |
| | 0 | 413 | | if (networkWatcherName == null) |
| | | 414 | | { |
| | 0 | 415 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 416 | | } |
| | 0 | 417 | | if (connectionMonitorName == null) |
| | | 418 | | { |
| | 0 | 419 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 420 | | } |
| | | 421 | | |
| | 0 | 422 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartStart"); |
| | 0 | 423 | | scope.Start(); |
| | | 424 | | try |
| | | 425 | | { |
| | 0 | 426 | | var originalResponse = await RestClient.StartAsync(resourceGroupName, networkWatcherName, connectionMoni |
| | 0 | 427 | | return new ConnectionMonitorsStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartRequest |
| | | 428 | | } |
| | 0 | 429 | | catch (Exception e) |
| | | 430 | | { |
| | 0 | 431 | | scope.Failed(e); |
| | 0 | 432 | | throw; |
| | | 433 | | } |
| | 0 | 434 | | } |
| | | 435 | | |
| | | 436 | | /// <summary> Starts the specified connection monitor. </summary> |
| | | 437 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 438 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 439 | | /// <param name="connectionMonitorName"> The name of the connection monitor. </param> |
| | | 440 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 441 | | public virtual ConnectionMonitorsStartOperation StartStart(string resourceGroupName, string networkWatcherName, |
| | | 442 | | { |
| | 0 | 443 | | if (resourceGroupName == null) |
| | | 444 | | { |
| | 0 | 445 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 446 | | } |
| | 0 | 447 | | if (networkWatcherName == null) |
| | | 448 | | { |
| | 0 | 449 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 450 | | } |
| | 0 | 451 | | if (connectionMonitorName == null) |
| | | 452 | | { |
| | 0 | 453 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 454 | | } |
| | | 455 | | |
| | 0 | 456 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartStart"); |
| | 0 | 457 | | scope.Start(); |
| | | 458 | | try |
| | | 459 | | { |
| | 0 | 460 | | var originalResponse = RestClient.Start(resourceGroupName, networkWatcherName, connectionMonitorName, ca |
| | 0 | 461 | | return new ConnectionMonitorsStartOperation(_clientDiagnostics, _pipeline, RestClient.CreateStartRequest |
| | | 462 | | } |
| | 0 | 463 | | catch (Exception e) |
| | | 464 | | { |
| | 0 | 465 | | scope.Failed(e); |
| | 0 | 466 | | throw; |
| | | 467 | | } |
| | 0 | 468 | | } |
| | | 469 | | |
| | | 470 | | /// <summary> Query a snapshot of the most recent connection states. </summary> |
| | | 471 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 472 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 473 | | /// <param name="connectionMonitorName"> The name given to the connection monitor. </param> |
| | | 474 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 475 | | public virtual async Task<ConnectionMonitorsQueryOperation> StartQueryAsync(string resourceGroupName, string net |
| | | 476 | | { |
| | 0 | 477 | | if (resourceGroupName == null) |
| | | 478 | | { |
| | 0 | 479 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 480 | | } |
| | 0 | 481 | | if (networkWatcherName == null) |
| | | 482 | | { |
| | 0 | 483 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 484 | | } |
| | 0 | 485 | | if (connectionMonitorName == null) |
| | | 486 | | { |
| | 0 | 487 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 488 | | } |
| | | 489 | | |
| | 0 | 490 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartQuery"); |
| | 0 | 491 | | scope.Start(); |
| | | 492 | | try |
| | | 493 | | { |
| | 0 | 494 | | var originalResponse = await RestClient.QueryAsync(resourceGroupName, networkWatcherName, connectionMoni |
| | 0 | 495 | | return new ConnectionMonitorsQueryOperation(_clientDiagnostics, _pipeline, RestClient.CreateQueryRequest |
| | | 496 | | } |
| | 0 | 497 | | catch (Exception e) |
| | | 498 | | { |
| | 0 | 499 | | scope.Failed(e); |
| | 0 | 500 | | throw; |
| | | 501 | | } |
| | 0 | 502 | | } |
| | | 503 | | |
| | | 504 | | /// <summary> Query a snapshot of the most recent connection states. </summary> |
| | | 505 | | /// <param name="resourceGroupName"> The name of the resource group containing Network Watcher. </param> |
| | | 506 | | /// <param name="networkWatcherName"> The name of the Network Watcher resource. </param> |
| | | 507 | | /// <param name="connectionMonitorName"> The name given to the connection monitor. </param> |
| | | 508 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | | 509 | | public virtual ConnectionMonitorsQueryOperation StartQuery(string resourceGroupName, string networkWatcherName, |
| | | 510 | | { |
| | 0 | 511 | | if (resourceGroupName == null) |
| | | 512 | | { |
| | 0 | 513 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | | 514 | | } |
| | 0 | 515 | | if (networkWatcherName == null) |
| | | 516 | | { |
| | 0 | 517 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | | 518 | | } |
| | 0 | 519 | | if (connectionMonitorName == null) |
| | | 520 | | { |
| | 0 | 521 | | throw new ArgumentNullException(nameof(connectionMonitorName)); |
| | | 522 | | } |
| | | 523 | | |
| | 0 | 524 | | using var scope = _clientDiagnostics.CreateScope("ConnectionMonitorsOperations.StartQuery"); |
| | 0 | 525 | | scope.Start(); |
| | | 526 | | try |
| | | 527 | | { |
| | 0 | 528 | | var originalResponse = RestClient.Query(resourceGroupName, networkWatcherName, connectionMonitorName, ca |
| | 0 | 529 | | return new ConnectionMonitorsQueryOperation(_clientDiagnostics, _pipeline, RestClient.CreateQueryRequest |
| | | 530 | | } |
| | 0 | 531 | | catch (Exception e) |
| | | 532 | | { |
| | 0 | 533 | | scope.Failed(e); |
| | 0 | 534 | | throw; |
| | | 535 | | } |
| | 0 | 536 | | } |
| | | 537 | | } |
| | | 538 | | } |