Esempio n. 1
0
 public virtual ArmOperation Delete(WaitUntil waitUntil, bool?force = null, CancellationToken cancellationToken = default)
 {
     using var scope = _vMwareHostHostsClientDiagnostics.CreateScope("VMwareHostResource.Delete");
     scope.Start();
     try
     {
         var response  = _vMwareHostHostsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, force, cancellationToken);
         var operation = new ConnectedVMwarevSphereArmOperation(_vMwareHostHostsClientDiagnostics, Pipeline, _vMwareHostHostsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, force).Request, response, OperationFinalStateVia.Location);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Esempio n. 2
0
 public virtual VMwareHostDeleteOperation Delete(bool waitForCompletion, bool?force = null, CancellationToken cancellationToken = default)
 {
     using var scope = _vMwareHostHostsClientDiagnostics.CreateScope("VMwareHost.Delete");
     scope.Start();
     try
     {
         var response  = _vMwareHostHostsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, force, cancellationToken);
         var operation = new VMwareHostDeleteOperation(_vMwareHostHostsClientDiagnostics, Pipeline, _vMwareHostHostsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, force).Request, response);
         if (waitForCompletion)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }