예제 #1
0
        public virtual async Task <ArmOperation> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
        {
            using var scope = _wordPressInstanceResourceWordpressInstancesClientDiagnostics.CreateScope("WordPressInstanceResource.Delete");
            scope.Start();
            try
            {
                var response = await _wordPressInstanceResourceWordpressInstancesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false);

                var operation = new WorkloadsArmOperation(response);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
예제 #2
0
        public virtual async Task <ArmOperation> DeleteAsync(WaitUntil waitUntil, string deleteInfra = null, CancellationToken cancellationToken = default)
        {
            using var scope = _phpWorkloadResourcePhpWorkloadsClientDiagnostics.CreateScope("PhpWorkloadResource.Delete");
            scope.Start();
            try
            {
                var response = await _phpWorkloadResourcePhpWorkloadsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deleteInfra, cancellationToken).ConfigureAwait(false);

                var operation = new WorkloadsArmOperation(_phpWorkloadResourcePhpWorkloadsClientDiagnostics, Pipeline, _phpWorkloadResourcePhpWorkloadsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deleteInfra).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }