| | 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 NetworkWatchers service client. </summary> |
| | 19 | | public partial class NetworkWatchersOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 56 | 23 | | internal NetworkWatchersRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of NetworkWatchersOperations for mocking. </summary> |
| 40 | 25 | | protected NetworkWatchersOperations() |
| | 26 | | { |
| 40 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of NetworkWatchersOperations. </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> |
| 40 | 33 | | internal NetworkWatchersOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscripti |
| | 34 | | { |
| 40 | 35 | | RestClient = new NetworkWatchersRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 40 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 40 | 37 | | _pipeline = pipeline; |
| 40 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Creates or updates a network watcher in the specified resource group. </summary> |
| | 41 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 42 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 43 | | /// <param name="parameters"> Parameters that define the network watcher resource. </param> |
| | 44 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 45 | | public virtual async Task<Response<NetworkWatcher>> CreateOrUpdateAsync(string resourceGroupName, string network |
| | 46 | | { |
| 2 | 47 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.CreateOrUpdate"); |
| 2 | 48 | | scope.Start(); |
| | 49 | | try |
| | 50 | | { |
| 2 | 51 | | return await RestClient.CreateOrUpdateAsync(resourceGroupName, networkWatcherName, parameters, cancellat |
| | 52 | | } |
| 0 | 53 | | catch (Exception e) |
| | 54 | | { |
| 0 | 55 | | scope.Failed(e); |
| 0 | 56 | | throw; |
| | 57 | | } |
| 2 | 58 | | } |
| | 59 | |
|
| | 60 | | /// <summary> Creates or updates a network watcher in the specified resource group. </summary> |
| | 61 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 62 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 63 | | /// <param name="parameters"> Parameters that define the network watcher resource. </param> |
| | 64 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 65 | | public virtual Response<NetworkWatcher> CreateOrUpdate(string resourceGroupName, string networkWatcherName, Netw |
| | 66 | | { |
| 2 | 67 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.CreateOrUpdate"); |
| 2 | 68 | | scope.Start(); |
| | 69 | | try |
| | 70 | | { |
| 2 | 71 | | return RestClient.CreateOrUpdate(resourceGroupName, networkWatcherName, parameters, cancellationToken); |
| | 72 | | } |
| 0 | 73 | | catch (Exception e) |
| | 74 | | { |
| 0 | 75 | | scope.Failed(e); |
| 0 | 76 | | throw; |
| | 77 | | } |
| 2 | 78 | | } |
| | 79 | |
|
| | 80 | | /// <summary> Gets the specified network watcher by resource group. </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="cancellationToken"> The cancellation token to use. </param> |
| | 84 | | public virtual async Task<Response<NetworkWatcher>> GetAsync(string resourceGroupName, string networkWatcherName |
| | 85 | | { |
| 2 | 86 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.Get"); |
| 2 | 87 | | scope.Start(); |
| | 88 | | try |
| | 89 | | { |
| 2 | 90 | | return await RestClient.GetAsync(resourceGroupName, networkWatcherName, cancellationToken).ConfigureAwai |
| | 91 | | } |
| 0 | 92 | | catch (Exception e) |
| | 93 | | { |
| 0 | 94 | | scope.Failed(e); |
| 0 | 95 | | throw; |
| | 96 | | } |
| 2 | 97 | | } |
| | 98 | |
|
| | 99 | | /// <summary> Gets the specified network watcher by resource group. </summary> |
| | 100 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 101 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 102 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 103 | | public virtual Response<NetworkWatcher> Get(string resourceGroupName, string networkWatcherName, CancellationTok |
| | 104 | | { |
| 2 | 105 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.Get"); |
| 2 | 106 | | scope.Start(); |
| | 107 | | try |
| | 108 | | { |
| 2 | 109 | | return RestClient.Get(resourceGroupName, networkWatcherName, cancellationToken); |
| | 110 | | } |
| 0 | 111 | | catch (Exception e) |
| | 112 | | { |
| 0 | 113 | | scope.Failed(e); |
| 0 | 114 | | throw; |
| | 115 | | } |
| 2 | 116 | | } |
| | 117 | |
|
| | 118 | | /// <summary> Updates a network watcher tags. </summary> |
| | 119 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 120 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 121 | | /// <param name="parameters"> Parameters supplied to update network watcher tags. </param> |
| | 122 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 123 | | public virtual async Task<Response<NetworkWatcher>> UpdateTagsAsync(string resourceGroupName, string networkWatc |
| | 124 | | { |
| 0 | 125 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.UpdateTags"); |
| 0 | 126 | | scope.Start(); |
| | 127 | | try |
| | 128 | | { |
| 0 | 129 | | return await RestClient.UpdateTagsAsync(resourceGroupName, networkWatcherName, parameters, cancellationT |
| | 130 | | } |
| 0 | 131 | | catch (Exception e) |
| | 132 | | { |
| 0 | 133 | | scope.Failed(e); |
| 0 | 134 | | throw; |
| | 135 | | } |
| 0 | 136 | | } |
| | 137 | |
|
| | 138 | | /// <summary> Updates a network watcher tags. </summary> |
| | 139 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 140 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 141 | | /// <param name="parameters"> Parameters supplied to update network watcher tags. </param> |
| | 142 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 143 | | public virtual Response<NetworkWatcher> UpdateTags(string resourceGroupName, string networkWatcherName, TagsObje |
| | 144 | | { |
| 0 | 145 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.UpdateTags"); |
| 0 | 146 | | scope.Start(); |
| | 147 | | try |
| | 148 | | { |
| 0 | 149 | | return RestClient.UpdateTags(resourceGroupName, networkWatcherName, parameters, cancellationToken); |
| | 150 | | } |
| 0 | 151 | | catch (Exception e) |
| | 152 | | { |
| 0 | 153 | | scope.Failed(e); |
| 0 | 154 | | throw; |
| | 155 | | } |
| 0 | 156 | | } |
| | 157 | |
|
| | 158 | | /// <summary> Gets the current network topology by resource group. </summary> |
| | 159 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 160 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 161 | | /// <param name="parameters"> Parameters that define the representation of topology. </param> |
| | 162 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 163 | | public virtual async Task<Response<Topology>> GetTopologyAsync(string resourceGroupName, string networkWatcherNa |
| | 164 | | { |
| 2 | 165 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.GetTopology"); |
| 2 | 166 | | scope.Start(); |
| | 167 | | try |
| | 168 | | { |
| 2 | 169 | | return await RestClient.GetTopologyAsync(resourceGroupName, networkWatcherName, parameters, cancellation |
| | 170 | | } |
| 0 | 171 | | catch (Exception e) |
| | 172 | | { |
| 0 | 173 | | scope.Failed(e); |
| 0 | 174 | | throw; |
| | 175 | | } |
| 2 | 176 | | } |
| | 177 | |
|
| | 178 | | /// <summary> Gets the current network topology by resource group. </summary> |
| | 179 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 180 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 181 | | /// <param name="parameters"> Parameters that define the representation of topology. </param> |
| | 182 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 183 | | public virtual Response<Topology> GetTopology(string resourceGroupName, string networkWatcherName, TopologyParam |
| | 184 | | { |
| 2 | 185 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.GetTopology"); |
| 2 | 186 | | scope.Start(); |
| | 187 | | try |
| | 188 | | { |
| 2 | 189 | | return RestClient.GetTopology(resourceGroupName, networkWatcherName, parameters, cancellationToken); |
| | 190 | | } |
| 0 | 191 | | catch (Exception e) |
| | 192 | | { |
| 0 | 193 | | scope.Failed(e); |
| 0 | 194 | | throw; |
| | 195 | | } |
| 2 | 196 | | } |
| | 197 | |
|
| | 198 | | /// <summary> Gets all network watchers by resource group. </summary> |
| | 199 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 200 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 201 | | public virtual AsyncPageable<NetworkWatcher> ListAsync(string resourceGroupName, CancellationToken cancellationT |
| | 202 | | { |
| 2 | 203 | | if (resourceGroupName == null) |
| | 204 | | { |
| 0 | 205 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 206 | | } |
| | 207 | |
|
| | 208 | | async Task<Page<NetworkWatcher>> FirstPageFunc(int? pageSizeHint) |
| | 209 | | { |
| 2 | 210 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.List"); |
| 2 | 211 | | scope.Start(); |
| | 212 | | try |
| | 213 | | { |
| 2 | 214 | | var response = await RestClient.ListAsync(resourceGroupName, cancellationToken).ConfigureAwait(false |
| 2 | 215 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | 216 | | } |
| 0 | 217 | | catch (Exception e) |
| | 218 | | { |
| 0 | 219 | | scope.Failed(e); |
| 0 | 220 | | throw; |
| | 221 | | } |
| 2 | 222 | | } |
| 2 | 223 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); |
| | 224 | | } |
| | 225 | |
|
| | 226 | | /// <summary> Gets all network watchers by resource group. </summary> |
| | 227 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 228 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 229 | | public virtual Pageable<NetworkWatcher> List(string resourceGroupName, CancellationToken cancellationToken = def |
| | 230 | | { |
| 2 | 231 | | if (resourceGroupName == null) |
| | 232 | | { |
| 0 | 233 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 234 | | } |
| | 235 | |
|
| | 236 | | Page<NetworkWatcher> FirstPageFunc(int? pageSizeHint) |
| | 237 | | { |
| 2 | 238 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.List"); |
| 2 | 239 | | scope.Start(); |
| | 240 | | try |
| | 241 | | { |
| 2 | 242 | | var response = RestClient.List(resourceGroupName, cancellationToken); |
| 2 | 243 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | 244 | | } |
| 0 | 245 | | catch (Exception e) |
| | 246 | | { |
| 0 | 247 | | scope.Failed(e); |
| 0 | 248 | | throw; |
| | 249 | | } |
| 2 | 250 | | } |
| 2 | 251 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, null); |
| | 252 | | } |
| | 253 | |
|
| | 254 | | /// <summary> Gets all network watchers by subscription. </summary> |
| | 255 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 256 | | public virtual AsyncPageable<NetworkWatcher> ListAllAsync(CancellationToken cancellationToken = default) |
| | 257 | | { |
| | 258 | | async Task<Page<NetworkWatcher>> FirstPageFunc(int? pageSizeHint) |
| | 259 | | { |
| 4 | 260 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.ListAll"); |
| 4 | 261 | | scope.Start(); |
| | 262 | | try |
| | 263 | | { |
| 4 | 264 | | var response = await RestClient.ListAllAsync(cancellationToken).ConfigureAwait(false); |
| 4 | 265 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | 266 | | } |
| 0 | 267 | | catch (Exception e) |
| | 268 | | { |
| 0 | 269 | | scope.Failed(e); |
| 0 | 270 | | throw; |
| | 271 | | } |
| 4 | 272 | | } |
| 4 | 273 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); |
| | 274 | | } |
| | 275 | |
|
| | 276 | | /// <summary> Gets all network watchers by subscription. </summary> |
| | 277 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 278 | | public virtual Pageable<NetworkWatcher> ListAll(CancellationToken cancellationToken = default) |
| | 279 | | { |
| | 280 | | Page<NetworkWatcher> FirstPageFunc(int? pageSizeHint) |
| | 281 | | { |
| 4 | 282 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.ListAll"); |
| 4 | 283 | | scope.Start(); |
| | 284 | | try |
| | 285 | | { |
| 4 | 286 | | var response = RestClient.ListAll(cancellationToken); |
| 4 | 287 | | return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); |
| | 288 | | } |
| 0 | 289 | | catch (Exception e) |
| | 290 | | { |
| 0 | 291 | | scope.Failed(e); |
| 0 | 292 | | throw; |
| | 293 | | } |
| 4 | 294 | | } |
| 4 | 295 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, null); |
| | 296 | | } |
| | 297 | |
|
| | 298 | | /// <summary> Deletes the specified network watcher resource. </summary> |
| | 299 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 300 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 301 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 302 | | public virtual async Task<NetworkWatchersDeleteOperation> StartDeleteAsync(string resourceGroupName, string netw |
| | 303 | | { |
| 2 | 304 | | if (resourceGroupName == null) |
| | 305 | | { |
| 0 | 306 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 307 | | } |
| 2 | 308 | | if (networkWatcherName == null) |
| | 309 | | { |
| 0 | 310 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 311 | | } |
| | 312 | |
|
| 2 | 313 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartDelete"); |
| 2 | 314 | | scope.Start(); |
| | 315 | | try |
| | 316 | | { |
| 2 | 317 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, networkWatcherName, cancellationT |
| 2 | 318 | | return new NetworkWatchersDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest( |
| | 319 | | } |
| 0 | 320 | | catch (Exception e) |
| | 321 | | { |
| 0 | 322 | | scope.Failed(e); |
| 0 | 323 | | throw; |
| | 324 | | } |
| 2 | 325 | | } |
| | 326 | |
|
| | 327 | | /// <summary> Deletes the specified network watcher resource. </summary> |
| | 328 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 329 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 330 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 331 | | public virtual NetworkWatchersDeleteOperation StartDelete(string resourceGroupName, string networkWatcherName, C |
| | 332 | | { |
| 2 | 333 | | if (resourceGroupName == null) |
| | 334 | | { |
| 0 | 335 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 336 | | } |
| 2 | 337 | | if (networkWatcherName == null) |
| | 338 | | { |
| 0 | 339 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 340 | | } |
| | 341 | |
|
| 2 | 342 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartDelete"); |
| 2 | 343 | | scope.Start(); |
| | 344 | | try |
| | 345 | | { |
| 2 | 346 | | var originalResponse = RestClient.Delete(resourceGroupName, networkWatcherName, cancellationToken); |
| 2 | 347 | | return new NetworkWatchersDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest( |
| | 348 | | } |
| 0 | 349 | | catch (Exception e) |
| | 350 | | { |
| 0 | 351 | | scope.Failed(e); |
| 0 | 352 | | throw; |
| | 353 | | } |
| 2 | 354 | | } |
| | 355 | |
|
| | 356 | | /// <summary> Verify IP flow from the specified VM to a location given the currently configured NSG rules. </sum |
| | 357 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 358 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 359 | | /// <param name="parameters"> Parameters that define the IP flow to be verified. </param> |
| | 360 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 361 | | public virtual async Task<NetworkWatchersVerifyIPFlowOperation> StartVerifyIPFlowAsync(string resourceGroupName, |
| | 362 | | { |
| 0 | 363 | | if (resourceGroupName == null) |
| | 364 | | { |
| 0 | 365 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 366 | | } |
| 0 | 367 | | if (networkWatcherName == null) |
| | 368 | | { |
| 0 | 369 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 370 | | } |
| 0 | 371 | | if (parameters == null) |
| | 372 | | { |
| 0 | 373 | | throw new ArgumentNullException(nameof(parameters)); |
| | 374 | | } |
| | 375 | |
|
| 0 | 376 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartVerifyIPFlow"); |
| 0 | 377 | | scope.Start(); |
| | 378 | | try |
| | 379 | | { |
| 0 | 380 | | var originalResponse = await RestClient.VerifyIPFlowAsync(resourceGroupName, networkWatcherName, paramet |
| 0 | 381 | | return new NetworkWatchersVerifyIPFlowOperation(_clientDiagnostics, _pipeline, RestClient.CreateVerifyIP |
| | 382 | | } |
| 0 | 383 | | catch (Exception e) |
| | 384 | | { |
| 0 | 385 | | scope.Failed(e); |
| 0 | 386 | | throw; |
| | 387 | | } |
| 0 | 388 | | } |
| | 389 | |
|
| | 390 | | /// <summary> Verify IP flow from the specified VM to a location given the currently configured NSG rules. </sum |
| | 391 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 392 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 393 | | /// <param name="parameters"> Parameters that define the IP flow to be verified. </param> |
| | 394 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 395 | | public virtual NetworkWatchersVerifyIPFlowOperation StartVerifyIPFlow(string resourceGroupName, string networkWa |
| | 396 | | { |
| 0 | 397 | | if (resourceGroupName == null) |
| | 398 | | { |
| 0 | 399 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 400 | | } |
| 0 | 401 | | if (networkWatcherName == null) |
| | 402 | | { |
| 0 | 403 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 404 | | } |
| 0 | 405 | | if (parameters == null) |
| | 406 | | { |
| 0 | 407 | | throw new ArgumentNullException(nameof(parameters)); |
| | 408 | | } |
| | 409 | |
|
| 0 | 410 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartVerifyIPFlow"); |
| 0 | 411 | | scope.Start(); |
| | 412 | | try |
| | 413 | | { |
| 0 | 414 | | var originalResponse = RestClient.VerifyIPFlow(resourceGroupName, networkWatcherName, parameters, cancel |
| 0 | 415 | | return new NetworkWatchersVerifyIPFlowOperation(_clientDiagnostics, _pipeline, RestClient.CreateVerifyIP |
| | 416 | | } |
| 0 | 417 | | catch (Exception e) |
| | 418 | | { |
| 0 | 419 | | scope.Failed(e); |
| 0 | 420 | | throw; |
| | 421 | | } |
| 0 | 422 | | } |
| | 423 | |
|
| | 424 | | /// <summary> Gets the next hop from the specified VM. </summary> |
| | 425 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 426 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 427 | | /// <param name="parameters"> Parameters that define the source and destination endpoint. </param> |
| | 428 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 429 | | public virtual async Task<NetworkWatchersGetNextHopOperation> StartGetNextHopAsync(string resourceGroupName, str |
| | 430 | | { |
| 4 | 431 | | if (resourceGroupName == null) |
| | 432 | | { |
| 0 | 433 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 434 | | } |
| 4 | 435 | | if (networkWatcherName == null) |
| | 436 | | { |
| 0 | 437 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 438 | | } |
| 4 | 439 | | if (parameters == null) |
| | 440 | | { |
| 0 | 441 | | throw new ArgumentNullException(nameof(parameters)); |
| | 442 | | } |
| | 443 | |
|
| 4 | 444 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetNextHop"); |
| 4 | 445 | | scope.Start(); |
| | 446 | | try |
| | 447 | | { |
| 4 | 448 | | var originalResponse = await RestClient.GetNextHopAsync(resourceGroupName, networkWatcherName, parameter |
| 4 | 449 | | return new NetworkWatchersGetNextHopOperation(_clientDiagnostics, _pipeline, RestClient.CreateGetNextHop |
| | 450 | | } |
| 0 | 451 | | catch (Exception e) |
| | 452 | | { |
| 0 | 453 | | scope.Failed(e); |
| 0 | 454 | | throw; |
| | 455 | | } |
| 4 | 456 | | } |
| | 457 | |
|
| | 458 | | /// <summary> Gets the next hop from the specified VM. </summary> |
| | 459 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 460 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 461 | | /// <param name="parameters"> Parameters that define the source and destination endpoint. </param> |
| | 462 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 463 | | public virtual NetworkWatchersGetNextHopOperation StartGetNextHop(string resourceGroupName, string networkWatche |
| | 464 | | { |
| 4 | 465 | | if (resourceGroupName == null) |
| | 466 | | { |
| 0 | 467 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 468 | | } |
| 4 | 469 | | if (networkWatcherName == null) |
| | 470 | | { |
| 0 | 471 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 472 | | } |
| 4 | 473 | | if (parameters == null) |
| | 474 | | { |
| 0 | 475 | | throw new ArgumentNullException(nameof(parameters)); |
| | 476 | | } |
| | 477 | |
|
| 4 | 478 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetNextHop"); |
| 4 | 479 | | scope.Start(); |
| | 480 | | try |
| | 481 | | { |
| 4 | 482 | | var originalResponse = RestClient.GetNextHop(resourceGroupName, networkWatcherName, parameters, cancella |
| 4 | 483 | | return new NetworkWatchersGetNextHopOperation(_clientDiagnostics, _pipeline, RestClient.CreateGetNextHop |
| | 484 | | } |
| 0 | 485 | | catch (Exception e) |
| | 486 | | { |
| 0 | 487 | | scope.Failed(e); |
| 0 | 488 | | throw; |
| | 489 | | } |
| 4 | 490 | | } |
| | 491 | |
|
| | 492 | | /// <summary> Gets the configured and effective security group rules on the specified VM. </summary> |
| | 493 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 494 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 495 | | /// <param name="parameters"> Parameters that define the VM to check security groups for. </param> |
| | 496 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 497 | | public virtual async Task<NetworkWatchersGetVMSecurityRulesOperation> StartGetVMSecurityRulesAsync(string resour |
| | 498 | | { |
| 0 | 499 | | if (resourceGroupName == null) |
| | 500 | | { |
| 0 | 501 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 502 | | } |
| 0 | 503 | | if (networkWatcherName == null) |
| | 504 | | { |
| 0 | 505 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 506 | | } |
| 0 | 507 | | if (parameters == null) |
| | 508 | | { |
| 0 | 509 | | throw new ArgumentNullException(nameof(parameters)); |
| | 510 | | } |
| | 511 | |
|
| 0 | 512 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetVMSecurityRules"); |
| 0 | 513 | | scope.Start(); |
| | 514 | | try |
| | 515 | | { |
| 0 | 516 | | var originalResponse = await RestClient.GetVMSecurityRulesAsync(resourceGroupName, networkWatcherName, p |
| 0 | 517 | | return new NetworkWatchersGetVMSecurityRulesOperation(_clientDiagnostics, _pipeline, RestClient.CreateGe |
| | 518 | | } |
| 0 | 519 | | catch (Exception e) |
| | 520 | | { |
| 0 | 521 | | scope.Failed(e); |
| 0 | 522 | | throw; |
| | 523 | | } |
| 0 | 524 | | } |
| | 525 | |
|
| | 526 | | /// <summary> Gets the configured and effective security group rules on the specified VM. </summary> |
| | 527 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 528 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 529 | | /// <param name="parameters"> Parameters that define the VM to check security groups for. </param> |
| | 530 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 531 | | public virtual NetworkWatchersGetVMSecurityRulesOperation StartGetVMSecurityRules(string resourceGroupName, stri |
| | 532 | | { |
| 0 | 533 | | if (resourceGroupName == null) |
| | 534 | | { |
| 0 | 535 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 536 | | } |
| 0 | 537 | | if (networkWatcherName == null) |
| | 538 | | { |
| 0 | 539 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 540 | | } |
| 0 | 541 | | if (parameters == null) |
| | 542 | | { |
| 0 | 543 | | throw new ArgumentNullException(nameof(parameters)); |
| | 544 | | } |
| | 545 | |
|
| 0 | 546 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetVMSecurityRules"); |
| 0 | 547 | | scope.Start(); |
| | 548 | | try |
| | 549 | | { |
| 0 | 550 | | var originalResponse = RestClient.GetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, |
| 0 | 551 | | return new NetworkWatchersGetVMSecurityRulesOperation(_clientDiagnostics, _pipeline, RestClient.CreateGe |
| | 552 | | } |
| 0 | 553 | | catch (Exception e) |
| | 554 | | { |
| 0 | 555 | | scope.Failed(e); |
| 0 | 556 | | throw; |
| | 557 | | } |
| 0 | 558 | | } |
| | 559 | |
|
| | 560 | | /// <summary> Initiate troubleshooting on a specified resource. </summary> |
| | 561 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 562 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 563 | | /// <param name="parameters"> Parameters that define the resource to troubleshoot. </param> |
| | 564 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 565 | | public virtual async Task<NetworkWatchersGetTroubleshootingOperation> StartGetTroubleshootingAsync(string resour |
| | 566 | | { |
| 0 | 567 | | if (resourceGroupName == null) |
| | 568 | | { |
| 0 | 569 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 570 | | } |
| 0 | 571 | | if (networkWatcherName == null) |
| | 572 | | { |
| 0 | 573 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 574 | | } |
| 0 | 575 | | if (parameters == null) |
| | 576 | | { |
| 0 | 577 | | throw new ArgumentNullException(nameof(parameters)); |
| | 578 | | } |
| | 579 | |
|
| 0 | 580 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetTroubleshooting"); |
| 0 | 581 | | scope.Start(); |
| | 582 | | try |
| | 583 | | { |
| 0 | 584 | | var originalResponse = await RestClient.GetTroubleshootingAsync(resourceGroupName, networkWatcherName, p |
| 0 | 585 | | return new NetworkWatchersGetTroubleshootingOperation(_clientDiagnostics, _pipeline, RestClient.CreateGe |
| | 586 | | } |
| 0 | 587 | | catch (Exception e) |
| | 588 | | { |
| 0 | 589 | | scope.Failed(e); |
| 0 | 590 | | throw; |
| | 591 | | } |
| 0 | 592 | | } |
| | 593 | |
|
| | 594 | | /// <summary> Initiate troubleshooting on a specified resource. </summary> |
| | 595 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 596 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 597 | | /// <param name="parameters"> Parameters that define the resource to troubleshoot. </param> |
| | 598 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 599 | | public virtual NetworkWatchersGetTroubleshootingOperation StartGetTroubleshooting(string resourceGroupName, stri |
| | 600 | | { |
| 0 | 601 | | if (resourceGroupName == null) |
| | 602 | | { |
| 0 | 603 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 604 | | } |
| 0 | 605 | | if (networkWatcherName == null) |
| | 606 | | { |
| 0 | 607 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 608 | | } |
| 0 | 609 | | if (parameters == null) |
| | 610 | | { |
| 0 | 611 | | throw new ArgumentNullException(nameof(parameters)); |
| | 612 | | } |
| | 613 | |
|
| 0 | 614 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetTroubleshooting"); |
| 0 | 615 | | scope.Start(); |
| | 616 | | try |
| | 617 | | { |
| 0 | 618 | | var originalResponse = RestClient.GetTroubleshooting(resourceGroupName, networkWatcherName, parameters, |
| 0 | 619 | | return new NetworkWatchersGetTroubleshootingOperation(_clientDiagnostics, _pipeline, RestClient.CreateGe |
| | 620 | | } |
| 0 | 621 | | catch (Exception e) |
| | 622 | | { |
| 0 | 623 | | scope.Failed(e); |
| 0 | 624 | | throw; |
| | 625 | | } |
| 0 | 626 | | } |
| | 627 | |
|
| | 628 | | /// <summary> Get the last completed troubleshooting result on a specified resource. </summary> |
| | 629 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 630 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 631 | | /// <param name="parameters"> Parameters that define the resource to query the troubleshooting result. </param> |
| | 632 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 633 | | public virtual async Task<NetworkWatchersGetTroubleshootingResultOperation> StartGetTroubleshootingResultAsync(s |
| | 634 | | { |
| 0 | 635 | | if (resourceGroupName == null) |
| | 636 | | { |
| 0 | 637 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 638 | | } |
| 0 | 639 | | if (networkWatcherName == null) |
| | 640 | | { |
| 0 | 641 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 642 | | } |
| 0 | 643 | | if (parameters == null) |
| | 644 | | { |
| 0 | 645 | | throw new ArgumentNullException(nameof(parameters)); |
| | 646 | | } |
| | 647 | |
|
| 0 | 648 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetTroubleshootingResult"); |
| 0 | 649 | | scope.Start(); |
| | 650 | | try |
| | 651 | | { |
| 0 | 652 | | var originalResponse = await RestClient.GetTroubleshootingResultAsync(resourceGroupName, networkWatcherN |
| 0 | 653 | | return new NetworkWatchersGetTroubleshootingResultOperation(_clientDiagnostics, _pipeline, RestClient.Cr |
| | 654 | | } |
| 0 | 655 | | catch (Exception e) |
| | 656 | | { |
| 0 | 657 | | scope.Failed(e); |
| 0 | 658 | | throw; |
| | 659 | | } |
| 0 | 660 | | } |
| | 661 | |
|
| | 662 | | /// <summary> Get the last completed troubleshooting result on a specified resource. </summary> |
| | 663 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 664 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 665 | | /// <param name="parameters"> Parameters that define the resource to query the troubleshooting result. </param> |
| | 666 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 667 | | public virtual NetworkWatchersGetTroubleshootingResultOperation StartGetTroubleshootingResult(string resourceGro |
| | 668 | | { |
| 0 | 669 | | if (resourceGroupName == null) |
| | 670 | | { |
| 0 | 671 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 672 | | } |
| 0 | 673 | | if (networkWatcherName == null) |
| | 674 | | { |
| 0 | 675 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 676 | | } |
| 0 | 677 | | if (parameters == null) |
| | 678 | | { |
| 0 | 679 | | throw new ArgumentNullException(nameof(parameters)); |
| | 680 | | } |
| | 681 | |
|
| 0 | 682 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetTroubleshootingResult"); |
| 0 | 683 | | scope.Start(); |
| | 684 | | try |
| | 685 | | { |
| 0 | 686 | | var originalResponse = RestClient.GetTroubleshootingResult(resourceGroupName, networkWatcherName, parame |
| 0 | 687 | | return new NetworkWatchersGetTroubleshootingResultOperation(_clientDiagnostics, _pipeline, RestClient.Cr |
| | 688 | | } |
| 0 | 689 | | catch (Exception e) |
| | 690 | | { |
| 0 | 691 | | scope.Failed(e); |
| 0 | 692 | | throw; |
| | 693 | | } |
| 0 | 694 | | } |
| | 695 | |
|
| | 696 | | /// <summary> Configures flow log and traffic analytics (optional) on a specified resource. </summary> |
| | 697 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 698 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 699 | | /// <param name="parameters"> Parameters that define the configuration of flow log. </param> |
| | 700 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 701 | | public virtual async Task<NetworkWatchersSetFlowLogConfigurationOperation> StartSetFlowLogConfigurationAsync(str |
| | 702 | | { |
| 0 | 703 | | if (resourceGroupName == null) |
| | 704 | | { |
| 0 | 705 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 706 | | } |
| 0 | 707 | | if (networkWatcherName == null) |
| | 708 | | { |
| 0 | 709 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 710 | | } |
| 0 | 711 | | if (parameters == null) |
| | 712 | | { |
| 0 | 713 | | throw new ArgumentNullException(nameof(parameters)); |
| | 714 | | } |
| | 715 | |
|
| 0 | 716 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartSetFlowLogConfiguration"); |
| 0 | 717 | | scope.Start(); |
| | 718 | | try |
| | 719 | | { |
| 0 | 720 | | var originalResponse = await RestClient.SetFlowLogConfigurationAsync(resourceGroupName, networkWatcherNa |
| 0 | 721 | | return new NetworkWatchersSetFlowLogConfigurationOperation(_clientDiagnostics, _pipeline, RestClient.Cre |
| | 722 | | } |
| 0 | 723 | | catch (Exception e) |
| | 724 | | { |
| 0 | 725 | | scope.Failed(e); |
| 0 | 726 | | throw; |
| | 727 | | } |
| 0 | 728 | | } |
| | 729 | |
|
| | 730 | | /// <summary> Configures flow log and traffic analytics (optional) on a specified resource. </summary> |
| | 731 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 732 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 733 | | /// <param name="parameters"> Parameters that define the configuration of flow log. </param> |
| | 734 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 735 | | public virtual NetworkWatchersSetFlowLogConfigurationOperation StartSetFlowLogConfiguration(string resourceGroup |
| | 736 | | { |
| 0 | 737 | | if (resourceGroupName == null) |
| | 738 | | { |
| 0 | 739 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 740 | | } |
| 0 | 741 | | if (networkWatcherName == null) |
| | 742 | | { |
| 0 | 743 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 744 | | } |
| 0 | 745 | | if (parameters == null) |
| | 746 | | { |
| 0 | 747 | | throw new ArgumentNullException(nameof(parameters)); |
| | 748 | | } |
| | 749 | |
|
| 0 | 750 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartSetFlowLogConfiguration"); |
| 0 | 751 | | scope.Start(); |
| | 752 | | try |
| | 753 | | { |
| 0 | 754 | | var originalResponse = RestClient.SetFlowLogConfiguration(resourceGroupName, networkWatcherName, paramet |
| 0 | 755 | | return new NetworkWatchersSetFlowLogConfigurationOperation(_clientDiagnostics, _pipeline, RestClient.Cre |
| | 756 | | } |
| 0 | 757 | | catch (Exception e) |
| | 758 | | { |
| 0 | 759 | | scope.Failed(e); |
| 0 | 760 | | throw; |
| | 761 | | } |
| 0 | 762 | | } |
| | 763 | |
|
| | 764 | | /// <summary> Queries status of flow log and traffic analytics (optional) on a specified resource. </summary> |
| | 765 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 766 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 767 | | /// <param name="parameters"> Parameters that define a resource to query flow log and traffic analytics (optiona |
| | 768 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 769 | | public virtual async Task<NetworkWatchersGetFlowLogStatusOperation> StartGetFlowLogStatusAsync(string resourceGr |
| | 770 | | { |
| 0 | 771 | | if (resourceGroupName == null) |
| | 772 | | { |
| 0 | 773 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 774 | | } |
| 0 | 775 | | if (networkWatcherName == null) |
| | 776 | | { |
| 0 | 777 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 778 | | } |
| 0 | 779 | | if (parameters == null) |
| | 780 | | { |
| 0 | 781 | | throw new ArgumentNullException(nameof(parameters)); |
| | 782 | | } |
| | 783 | |
|
| 0 | 784 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetFlowLogStatus"); |
| 0 | 785 | | scope.Start(); |
| | 786 | | try |
| | 787 | | { |
| 0 | 788 | | var originalResponse = await RestClient.GetFlowLogStatusAsync(resourceGroupName, networkWatcherName, par |
| 0 | 789 | | return new NetworkWatchersGetFlowLogStatusOperation(_clientDiagnostics, _pipeline, RestClient.CreateGetF |
| | 790 | | } |
| 0 | 791 | | catch (Exception e) |
| | 792 | | { |
| 0 | 793 | | scope.Failed(e); |
| 0 | 794 | | throw; |
| | 795 | | } |
| 0 | 796 | | } |
| | 797 | |
|
| | 798 | | /// <summary> Queries status of flow log and traffic analytics (optional) on a specified resource. </summary> |
| | 799 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 800 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 801 | | /// <param name="parameters"> Parameters that define a resource to query flow log and traffic analytics (optiona |
| | 802 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 803 | | public virtual NetworkWatchersGetFlowLogStatusOperation StartGetFlowLogStatus(string resourceGroupName, string n |
| | 804 | | { |
| 0 | 805 | | if (resourceGroupName == null) |
| | 806 | | { |
| 0 | 807 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 808 | | } |
| 0 | 809 | | if (networkWatcherName == null) |
| | 810 | | { |
| 0 | 811 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 812 | | } |
| 0 | 813 | | if (parameters == null) |
| | 814 | | { |
| 0 | 815 | | throw new ArgumentNullException(nameof(parameters)); |
| | 816 | | } |
| | 817 | |
|
| 0 | 818 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetFlowLogStatus"); |
| 0 | 819 | | scope.Start(); |
| | 820 | | try |
| | 821 | | { |
| 0 | 822 | | var originalResponse = RestClient.GetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, ca |
| 0 | 823 | | return new NetworkWatchersGetFlowLogStatusOperation(_clientDiagnostics, _pipeline, RestClient.CreateGetF |
| | 824 | | } |
| 0 | 825 | | catch (Exception e) |
| | 826 | | { |
| 0 | 827 | | scope.Failed(e); |
| 0 | 828 | | throw; |
| | 829 | | } |
| 0 | 830 | | } |
| | 831 | |
|
| | 832 | | /// <summary> Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given |
| | 833 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 834 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 835 | | /// <param name="parameters"> Parameters that determine how the connectivity check will be performed. </param> |
| | 836 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 837 | | public virtual async Task<NetworkWatchersCheckConnectivityOperation> StartCheckConnectivityAsync(string resource |
| | 838 | | { |
| 2 | 839 | | if (resourceGroupName == null) |
| | 840 | | { |
| 0 | 841 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 842 | | } |
| 2 | 843 | | if (networkWatcherName == null) |
| | 844 | | { |
| 0 | 845 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 846 | | } |
| 2 | 847 | | if (parameters == null) |
| | 848 | | { |
| 0 | 849 | | throw new ArgumentNullException(nameof(parameters)); |
| | 850 | | } |
| | 851 | |
|
| 2 | 852 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartCheckConnectivity"); |
| 2 | 853 | | scope.Start(); |
| | 854 | | try |
| | 855 | | { |
| 2 | 856 | | var originalResponse = await RestClient.CheckConnectivityAsync(resourceGroupName, networkWatcherName, pa |
| 2 | 857 | | return new NetworkWatchersCheckConnectivityOperation(_clientDiagnostics, _pipeline, RestClient.CreateChe |
| | 858 | | } |
| 0 | 859 | | catch (Exception e) |
| | 860 | | { |
| 0 | 861 | | scope.Failed(e); |
| 0 | 862 | | throw; |
| | 863 | | } |
| 2 | 864 | | } |
| | 865 | |
|
| | 866 | | /// <summary> Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given |
| | 867 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 868 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 869 | | /// <param name="parameters"> Parameters that determine how the connectivity check will be performed. </param> |
| | 870 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 871 | | public virtual NetworkWatchersCheckConnectivityOperation StartCheckConnectivity(string resourceGroupName, string |
| | 872 | | { |
| 2 | 873 | | if (resourceGroupName == null) |
| | 874 | | { |
| 0 | 875 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 876 | | } |
| 2 | 877 | | if (networkWatcherName == null) |
| | 878 | | { |
| 0 | 879 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 880 | | } |
| 2 | 881 | | if (parameters == null) |
| | 882 | | { |
| 0 | 883 | | throw new ArgumentNullException(nameof(parameters)); |
| | 884 | | } |
| | 885 | |
|
| 2 | 886 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartCheckConnectivity"); |
| 2 | 887 | | scope.Start(); |
| | 888 | | try |
| | 889 | | { |
| 2 | 890 | | var originalResponse = RestClient.CheckConnectivity(resourceGroupName, networkWatcherName, parameters, c |
| 2 | 891 | | return new NetworkWatchersCheckConnectivityOperation(_clientDiagnostics, _pipeline, RestClient.CreateChe |
| | 892 | | } |
| 0 | 893 | | catch (Exception e) |
| | 894 | | { |
| 0 | 895 | | scope.Failed(e); |
| 0 | 896 | | throw; |
| | 897 | | } |
| 2 | 898 | | } |
| | 899 | |
|
| | 900 | | /// <summary> NOTE: This feature is currently in preview and still being tested for stability. Gets the relative |
| | 901 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 902 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 903 | | /// <param name="parameters"> Parameters that determine Azure reachability report configuration. </param> |
| | 904 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 905 | | public virtual async Task<NetworkWatchersGetAzureReachabilityReportOperation> StartGetAzureReachabilityReportAsy |
| | 906 | | { |
| 0 | 907 | | if (resourceGroupName == null) |
| | 908 | | { |
| 0 | 909 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 910 | | } |
| 0 | 911 | | if (networkWatcherName == null) |
| | 912 | | { |
| 0 | 913 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 914 | | } |
| 0 | 915 | | if (parameters == null) |
| | 916 | | { |
| 0 | 917 | | throw new ArgumentNullException(nameof(parameters)); |
| | 918 | | } |
| | 919 | |
|
| 0 | 920 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetAzureReachabilityReport" |
| 0 | 921 | | scope.Start(); |
| | 922 | | try |
| | 923 | | { |
| 0 | 924 | | var originalResponse = await RestClient.GetAzureReachabilityReportAsync(resourceGroupName, networkWatche |
| 0 | 925 | | return new NetworkWatchersGetAzureReachabilityReportOperation(_clientDiagnostics, _pipeline, RestClient. |
| | 926 | | } |
| 0 | 927 | | catch (Exception e) |
| | 928 | | { |
| 0 | 929 | | scope.Failed(e); |
| 0 | 930 | | throw; |
| | 931 | | } |
| 0 | 932 | | } |
| | 933 | |
|
| | 934 | | /// <summary> NOTE: This feature is currently in preview and still being tested for stability. Gets the relative |
| | 935 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 936 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 937 | | /// <param name="parameters"> Parameters that determine Azure reachability report configuration. </param> |
| | 938 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 939 | | public virtual NetworkWatchersGetAzureReachabilityReportOperation StartGetAzureReachabilityReport(string resourc |
| | 940 | | { |
| 0 | 941 | | if (resourceGroupName == null) |
| | 942 | | { |
| 0 | 943 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 944 | | } |
| 0 | 945 | | if (networkWatcherName == null) |
| | 946 | | { |
| 0 | 947 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 948 | | } |
| 0 | 949 | | if (parameters == null) |
| | 950 | | { |
| 0 | 951 | | throw new ArgumentNullException(nameof(parameters)); |
| | 952 | | } |
| | 953 | |
|
| 0 | 954 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetAzureReachabilityReport" |
| 0 | 955 | | scope.Start(); |
| | 956 | | try |
| | 957 | | { |
| 0 | 958 | | var originalResponse = RestClient.GetAzureReachabilityReport(resourceGroupName, networkWatcherName, para |
| 0 | 959 | | return new NetworkWatchersGetAzureReachabilityReportOperation(_clientDiagnostics, _pipeline, RestClient. |
| | 960 | | } |
| 0 | 961 | | catch (Exception e) |
| | 962 | | { |
| 0 | 963 | | scope.Failed(e); |
| 0 | 964 | | throw; |
| | 965 | | } |
| 0 | 966 | | } |
| | 967 | |
|
| | 968 | | /// <summary> NOTE: This feature is currently in preview and still being tested for stability. Lists all availab |
| | 969 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 970 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 971 | | /// <param name="parameters"> Parameters that scope the list of available providers. </param> |
| | 972 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 973 | | public virtual async Task<NetworkWatchersListAvailableProvidersOperation> StartListAvailableProvidersAsync(strin |
| | 974 | | { |
| 0 | 975 | | if (resourceGroupName == null) |
| | 976 | | { |
| 0 | 977 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 978 | | } |
| 0 | 979 | | if (networkWatcherName == null) |
| | 980 | | { |
| 0 | 981 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 982 | | } |
| 0 | 983 | | if (parameters == null) |
| | 984 | | { |
| 0 | 985 | | throw new ArgumentNullException(nameof(parameters)); |
| | 986 | | } |
| | 987 | |
|
| 0 | 988 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartListAvailableProviders"); |
| 0 | 989 | | scope.Start(); |
| | 990 | | try |
| | 991 | | { |
| 0 | 992 | | var originalResponse = await RestClient.ListAvailableProvidersAsync(resourceGroupName, networkWatcherNam |
| 0 | 993 | | return new NetworkWatchersListAvailableProvidersOperation(_clientDiagnostics, _pipeline, RestClient.Crea |
| | 994 | | } |
| 0 | 995 | | catch (Exception e) |
| | 996 | | { |
| 0 | 997 | | scope.Failed(e); |
| 0 | 998 | | throw; |
| | 999 | | } |
| 0 | 1000 | | } |
| | 1001 | |
|
| | 1002 | | /// <summary> NOTE: This feature is currently in preview and still being tested for stability. Lists all availab |
| | 1003 | | /// <param name="resourceGroupName"> The name of the network watcher resource group. </param> |
| | 1004 | | /// <param name="networkWatcherName"> The name of the network watcher resource. </param> |
| | 1005 | | /// <param name="parameters"> Parameters that scope the list of available providers. </param> |
| | 1006 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1007 | | public virtual NetworkWatchersListAvailableProvidersOperation StartListAvailableProviders(string resourceGroupNa |
| | 1008 | | { |
| 0 | 1009 | | if (resourceGroupName == null) |
| | 1010 | | { |
| 0 | 1011 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1012 | | } |
| 0 | 1013 | | if (networkWatcherName == null) |
| | 1014 | | { |
| 0 | 1015 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 1016 | | } |
| 0 | 1017 | | if (parameters == null) |
| | 1018 | | { |
| 0 | 1019 | | throw new ArgumentNullException(nameof(parameters)); |
| | 1020 | | } |
| | 1021 | |
|
| 0 | 1022 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartListAvailableProviders"); |
| 0 | 1023 | | scope.Start(); |
| | 1024 | | try |
| | 1025 | | { |
| 0 | 1026 | | var originalResponse = RestClient.ListAvailableProviders(resourceGroupName, networkWatcherName, paramete |
| 0 | 1027 | | return new NetworkWatchersListAvailableProvidersOperation(_clientDiagnostics, _pipeline, RestClient.Crea |
| | 1028 | | } |
| 0 | 1029 | | catch (Exception e) |
| | 1030 | | { |
| 0 | 1031 | | scope.Failed(e); |
| 0 | 1032 | | throw; |
| | 1033 | | } |
| 0 | 1034 | | } |
| | 1035 | |
|
| | 1036 | | /// <summary> Gets Network Configuration Diagnostic data to help customers understand and debug network behavior |
| | 1037 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1038 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 1039 | | /// <param name="parameters"> Parameters to get network configuration diagnostic. </param> |
| | 1040 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1041 | | public virtual async Task<NetworkWatchersGetNetworkConfigurationDiagnosticOperation> StartGetNetworkConfiguratio |
| | 1042 | | { |
| 0 | 1043 | | if (resourceGroupName == null) |
| | 1044 | | { |
| 0 | 1045 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1046 | | } |
| 0 | 1047 | | if (networkWatcherName == null) |
| | 1048 | | { |
| 0 | 1049 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 1050 | | } |
| 0 | 1051 | | if (parameters == null) |
| | 1052 | | { |
| 0 | 1053 | | throw new ArgumentNullException(nameof(parameters)); |
| | 1054 | | } |
| | 1055 | |
|
| 0 | 1056 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetNetworkConfigurationDiag |
| 0 | 1057 | | scope.Start(); |
| | 1058 | | try |
| | 1059 | | { |
| 0 | 1060 | | var originalResponse = await RestClient.GetNetworkConfigurationDiagnosticAsync(resourceGroupName, networ |
| 0 | 1061 | | return new NetworkWatchersGetNetworkConfigurationDiagnosticOperation(_clientDiagnostics, _pipeline, Rest |
| | 1062 | | } |
| 0 | 1063 | | catch (Exception e) |
| | 1064 | | { |
| 0 | 1065 | | scope.Failed(e); |
| 0 | 1066 | | throw; |
| | 1067 | | } |
| 0 | 1068 | | } |
| | 1069 | |
|
| | 1070 | | /// <summary> Gets Network Configuration Diagnostic data to help customers understand and debug network behavior |
| | 1071 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 1072 | | /// <param name="networkWatcherName"> The name of the network watcher. </param> |
| | 1073 | | /// <param name="parameters"> Parameters to get network configuration diagnostic. </param> |
| | 1074 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 1075 | | public virtual NetworkWatchersGetNetworkConfigurationDiagnosticOperation StartGetNetworkConfigurationDiagnostic( |
| | 1076 | | { |
| 0 | 1077 | | if (resourceGroupName == null) |
| | 1078 | | { |
| 0 | 1079 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 1080 | | } |
| 0 | 1081 | | if (networkWatcherName == null) |
| | 1082 | | { |
| 0 | 1083 | | throw new ArgumentNullException(nameof(networkWatcherName)); |
| | 1084 | | } |
| 0 | 1085 | | if (parameters == null) |
| | 1086 | | { |
| 0 | 1087 | | throw new ArgumentNullException(nameof(parameters)); |
| | 1088 | | } |
| | 1089 | |
|
| 0 | 1090 | | using var scope = _clientDiagnostics.CreateScope("NetworkWatchersOperations.StartGetNetworkConfigurationDiag |
| 0 | 1091 | | scope.Start(); |
| | 1092 | | try |
| | 1093 | | { |
| 0 | 1094 | | var originalResponse = RestClient.GetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherNam |
| 0 | 1095 | | return new NetworkWatchersGetNetworkConfigurationDiagnosticOperation(_clientDiagnostics, _pipeline, Rest |
| | 1096 | | } |
| 0 | 1097 | | catch (Exception e) |
| | 1098 | | { |
| 0 | 1099 | | scope.Failed(e); |
| 0 | 1100 | | throw; |
| | 1101 | | } |
| 0 | 1102 | | } |
| | 1103 | | } |
| | 1104 | | } |