Exemplo n.º 1
0
        public virtual ArmOperation PurgeContent(bool waitForCompletion, AfdPurgeOptions contents, CancellationToken cancellationToken = default)
        {
            if (contents == null)
            {
                throw new ArgumentNullException(nameof(contents));
            }

            using var scope = _afdEndpointClientDiagnostics.CreateScope("AfdEndpoint.PurgeContent");
            scope.Start();
            try
            {
                var response  = _afdEndpointRestClient.PurgeContent(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, contents, cancellationToken);
                var operation = new CdnArmOperation(_afdEndpointClientDiagnostics, Pipeline, _afdEndpointRestClient.CreatePurgeContentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, contents).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitForCompletion)
                {
                    operation.WaitForCompletionResponse(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
 public virtual ArmOperation Delete(bool waitForCompletion, CancellationToken cancellationToken = default)
 {
     using var scope = _afdRouteClientDiagnostics.CreateScope("AfdRoute.Delete");
     scope.Start();
     try
     {
         var response = _afdRouteRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new CdnArmOperation(_afdRouteClientDiagnostics, Pipeline, _afdRouteRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
         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 = _cdnOriginClientDiagnostics.CreateScope("CdnOriginResource.Delete");
     scope.Start();
     try
     {
         var response  = _cdnOriginRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new CdnArmOperation(_cdnOriginClientDiagnostics, Pipeline, _cdnOriginRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Exemplo n.º 4
0
 public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
 {
     using var scope = _cdnWebApplicationFirewallPolicyPoliciesClientDiagnostics.CreateScope("CdnWebApplicationFirewallPolicyResource.Delete");
     scope.Start();
     try
     {
         var response  = _cdnWebApplicationFirewallPolicyPoliciesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         var operation = new CdnArmOperation(response);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
 public virtual ArmOperation EnableCustomHttps(WaitUntil waitUntil, CustomDomainHttpsOptions customDomainHttpsParameters = null, CancellationToken cancellationToken = default)
 {
     using var scope = _cdnCustomDomainClientDiagnostics.CreateScope("CdnCustomDomain.EnableCustomHttps");
     scope.Start();
     try
     {
         var response  = _cdnCustomDomainRestClient.EnableCustomHttps(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, customDomainHttpsParameters, cancellationToken);
         var operation = new CdnArmOperation(_cdnCustomDomainClientDiagnostics, Pipeline, _cdnCustomDomainRestClient.CreateEnableCustomHttpsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, customDomainHttpsParameters).Request, response, OperationFinalStateVia.Location);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
 public virtual ArmOperation RefreshValidationToken(WaitUntil waitUntil, CancellationToken cancellationToken = default)
 {
     using var scope = _afdCustomDomainClientDiagnostics.CreateScope("AfdCustomDomainResource.RefreshValidationToken");
     scope.Start();
     try
     {
         var response  = _afdCustomDomainRestClient.RefreshValidationToken(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new CdnArmOperation(_afdCustomDomainClientDiagnostics, Pipeline, _afdCustomDomainRestClient.CreateRefreshValidationTokenRequest(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;
     }
 }
Exemplo n.º 7
0
        public virtual ArmOperation PurgeContent(WaitUntil waitUntil, FrontDoorPurgeContent content, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(content, nameof(content));

            using var scope = _frontDoorEndpointClientDiagnostics.CreateScope("FrontDoorEndpointResource.PurgeContent");
            scope.Start();
            try
            {
                var response  = _frontDoorEndpointRestClient.PurgeContent(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken);
                var operation = new CdnArmOperation(_frontDoorEndpointClientDiagnostics, Pipeline, _frontDoorEndpointRestClient.CreatePurgeContentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletionResponse(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemplo n.º 8
0
        public virtual ArmOperation LoadContent(bool waitForCompletion, LoadOptions contentFilePaths, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(contentFilePaths, nameof(contentFilePaths));

            using var scope = _cdnEndpointClientDiagnostics.CreateScope("CdnEndpoint.LoadContent");
            scope.Start();
            try
            {
                var response  = _cdnEndpointRestClient.LoadContent(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, contentFilePaths, cancellationToken);
                var operation = new CdnArmOperation(_cdnEndpointClientDiagnostics, Pipeline, _cdnEndpointRestClient.CreateLoadContentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, contentFilePaths).Request, response, OperationFinalStateVia.Location);
                if (waitForCompletion)
                {
                    operation.WaitForCompletionResponse(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }