Exemplo n.º 1
0
 public virtual ArmOperation <P2SVpnGateway> Reset(bool waitForCompletion, CancellationToken cancellationToken = default)
 {
     using var scope = _p2SVpnGatewayP2sVpnGatewaysClientDiagnostics.CreateScope("P2SVpnGateway.Reset");
     scope.Start();
     try
     {
         var response  = _p2SVpnGatewayP2sVpnGatewaysRestClient.Reset(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         var operation = new NetworkArmOperation <P2SVpnGateway>(new P2SVpnGatewayOperationSource(Client), _p2SVpnGatewayP2sVpnGatewaysClientDiagnostics, Pipeline, _p2SVpnGatewayP2sVpnGatewaysRestClient.CreateResetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location);
         if (waitForCompletion)
         {
             operation.WaitForCompletion(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Exemplo n.º 2
0
 public virtual P2SVpnGatewayResetOperation Reset(bool waitForCompletion = true, CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("P2SVpnGateway.Reset");
     scope.Start();
     try
     {
         var response  = _restClient.Reset(Id.ResourceGroupName, Id.Name, cancellationToken);
         var operation = new P2SVpnGatewayResetOperation(_clientDiagnostics, Pipeline, _restClient.CreateResetRequest(Id.ResourceGroupName, Id.Name).Request, response);
         if (waitForCompletion)
         {
             operation.WaitForCompletion(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }