Пример #1
0
 public virtual ArmOperation <OperationStatusResult> Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
 {
     using var scope = _sapCentralServerInstanceSAPCentralInstancesClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Delete");
     scope.Start();
     try
     {
         var response  = _sapCentralServerInstanceSAPCentralInstancesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new WorkloadsArmOperation <OperationStatusResult>(new OperationStatusResultOperationSource(), _sapCentralServerInstanceSAPCentralInstancesClientDiagnostics, Pipeline, _sapCentralServerInstanceSAPCentralInstancesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletion(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Пример #2
0
 public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
 {
     using var scope = _wordPressInstanceResourceWordpressInstancesClientDiagnostics.CreateScope("WordPressInstanceResource.Delete");
     scope.Start();
     try
     {
         var response  = _wordPressInstanceResourceWordpressInstancesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken);
         var operation = new WorkloadsArmOperation(response);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Пример #3
0
 public virtual ArmOperation Delete(WaitUntil waitUntil, string deleteInfra = null, CancellationToken cancellationToken = default)
 {
     using var scope = _phpWorkloadResourcePhpWorkloadsClientDiagnostics.CreateScope("PhpWorkloadResource.Delete");
     scope.Start();
     try
     {
         var response  = _phpWorkloadResourcePhpWorkloadsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deleteInfra, cancellationToken);
         var operation = new WorkloadsArmOperation(_phpWorkloadResourcePhpWorkloadsClientDiagnostics, Pipeline, _phpWorkloadResourcePhpWorkloadsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, deleteInfra).Request, response, OperationFinalStateVia.Location);
         if (waitUntil == WaitUntil.Completed)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Пример #4
0
        public virtual async Task <ArmOperation <OperationStatusResult> > StopAsync(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default)
        {
            using var scope = _sapVirtualInstanceSAPVirtualInstancesClientDiagnostics.CreateScope("SapVirtualInstanceResource.Stop");
            scope.Start();
            try
            {
                var response = await _sapVirtualInstanceSAPVirtualInstancesRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false);

                var operation = new WorkloadsArmOperation <OperationStatusResult>(new OperationStatusResultOperationSource(), _sapVirtualInstanceSAPVirtualInstancesClientDiagnostics, Pipeline, _sapVirtualInstanceSAPVirtualInstancesRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Пример #5
0
        public virtual ArmOperation <SapCentralServerInstanceResource> Update(WaitUntil waitUntil, SapCentralServerInstancePatch patch, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(patch, nameof(patch));

            using var scope = _sapCentralServerInstanceSAPCentralInstancesClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Update");
            scope.Start();
            try
            {
                var response  = _sapCentralServerInstanceSAPCentralInstancesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken);
                var operation = new WorkloadsArmOperation <SapCentralServerInstanceResource>(new SapCentralServerInstanceOperationSource(Client), _sapCentralServerInstanceSAPCentralInstancesClientDiagnostics, Pipeline, _sapCentralServerInstanceSAPCentralInstancesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Пример #6
0
        public virtual ArmOperation <WordPressInstanceResource> CreateOrUpdate(WaitUntil waitUntil, WordPressInstanceResourceData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _wordPressInstanceResourceWordpressInstancesClientDiagnostics.CreateScope("WordPressInstanceResource.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _wordPressInstanceResourceWordpressInstancesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken);
                var operation = new WorkloadsArmOperation <WordPressInstanceResource>(new WordPressInstanceResourceOperationSource(Client), _wordPressInstanceResourceWordpressInstancesClientDiagnostics, Pipeline, _wordPressInstanceResourceWordpressInstancesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Пример #7
0
        public virtual ArmOperation <SapApplicationServerInstanceResource> CreateOrUpdate(WaitUntil waitUntil, string applicationInstanceName, SapApplicationServerInstanceData data = null, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName));

            using var scope = _sapApplicationServerInstanceSAPApplicationServerInstancesClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _sapApplicationServerInstanceSAPApplicationServerInstancesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data, cancellationToken);
                var operation = new WorkloadsArmOperation <SapApplicationServerInstanceResource>(new SapApplicationServerInstanceOperationSource(Client), _sapApplicationServerInstanceSAPApplicationServerInstancesClientDiagnostics, Pipeline, _sapApplicationServerInstanceSAPApplicationServerInstancesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Пример #8
0
        public virtual async Task <ArmOperation <SapProviderInstanceResource> > UpdateAsync(WaitUntil waitUntil, SapProviderInstanceData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _sapProviderInstanceProviderInstancesClientDiagnostics.CreateScope("SapProviderInstanceResource.Update");
            scope.Start();
            try
            {
                var response = await _sapProviderInstanceProviderInstancesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);

                var operation = new WorkloadsArmOperation <SapProviderInstanceResource>(new SapProviderInstanceOperationSource(Client), _sapProviderInstanceProviderInstancesClientDiagnostics, Pipeline, _sapProviderInstanceProviderInstancesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Пример #9
0
        public virtual async Task <ArmOperation <PhpWorkloadResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string phpWorkloadName, PhpWorkloadResourceData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(phpWorkloadName, nameof(phpWorkloadName));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _phpWorkloadResourcePhpWorkloadsClientDiagnostics.CreateScope("PhpWorkloadResourceCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _phpWorkloadResourcePhpWorkloadsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, phpWorkloadName, data, cancellationToken).ConfigureAwait(false);

                var operation = new WorkloadsArmOperation <PhpWorkloadResource>(new PhpWorkloadResourceOperationSource(Client), _phpWorkloadResourcePhpWorkloadsClientDiagnostics, Pipeline, _phpWorkloadResourcePhpWorkloadsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, phpWorkloadName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }