Esempio n. 1
0
 public virtual IscsiTargetDeleteOperation Delete(bool waitForCompletion, CancellationToken cancellationToken = default)
 {
     using var scope = _iscsiTargetClientDiagnostics.CreateScope("IscsiTarget.Delete");
     scope.Start();
     try
     {
         var response = _iscsiTargetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new IscsiTargetDeleteOperation(_iscsiTargetClientDiagnostics, Pipeline, _iscsiTargetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response);
         if (waitForCompletion)
             operation.WaitForCompletionResponse(cancellationToken);
         return operation;
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
 public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
 {
     using var scope = _iscsiTargetClientDiagnostics.CreateScope("IscsiTargetResource.Delete");
     scope.Start();
     try
     {
         var response  = _iscsiTargetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new StoragePoolArmOperation(_iscsiTargetClientDiagnostics, Pipeline, _iscsiTargetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }