Exemple #1
0
 public virtual ArmOperation <ServiceRegistryResource> Update(WaitUntil waitUntil, CancellationToken cancellationToken = default)
 {
     using var scope = _serviceRegistryResourceServiceRegistriesClientDiagnostics.CreateScope("ServiceRegistryResource.Update");
     scope.Start();
     try
     {
         var response  = _serviceRegistryResourceServiceRegistriesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new AppPlatformArmOperation <ServiceRegistryResource>(new ServiceRegistryResourceOperationSource(Client), _serviceRegistryResourceServiceRegistriesClientDiagnostics, Pipeline, _serviceRegistryResourceServiceRegistriesRestClient.CreateCreateOrUpdateRequest(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;
     }
 }
Exemple #2
0
        public virtual ArmOperation <AppPlatformAppResource> SetActiveDeployments(WaitUntil waitUntil, ActiveDeploymentList activeDeploymentCollection, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(activeDeploymentCollection, nameof(activeDeploymentCollection));

            using var scope = _appPlatformAppResourceAppsClientDiagnostics.CreateScope("AppPlatformAppResource.SetActiveDeployments");
            scope.Start();
            try
            {
                var response  = _appPlatformAppResourceAppsRestClient.SetActiveDeployments(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, activeDeploymentCollection, cancellationToken);
                var operation = new AppPlatformArmOperation <AppPlatformAppResource>(new AppPlatformAppResourceOperationSource(Client), _appPlatformAppResourceAppsClientDiagnostics, Pipeline, _appPlatformAppResourceAppsRestClient.CreateSetActiveDeploymentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, activeDeploymentCollection).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #3
0
        public virtual ArmOperation <AppPlatformCustomDomainResource> Update(WaitUntil waitUntil, AppPlatformCustomDomainResourceData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _appPlatformCustomDomainResourceCustomDomainsClientDiagnostics.CreateScope("AppPlatformCustomDomainResource.Update");
            scope.Start();
            try
            {
                var response  = _appPlatformCustomDomainResourceCustomDomainsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken);
                var operation = new AppPlatformArmOperation <AppPlatformCustomDomainResource>(new AppPlatformCustomDomainResourceOperationSource(Client), _appPlatformCustomDomainResourceCustomDomainsClientDiagnostics, Pipeline, _appPlatformCustomDomainResourceCustomDomainsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #4
0
        public virtual ArmOperation <AppBuildResource> Update(WaitUntil waitUntil, AppBuildData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _appBuildBuildServiceClientDiagnostics.CreateScope("AppBuildResource.Update");
            scope.Start();
            try
            {
                var response  = _appBuildBuildServiceRestClient.CreateOrUpdateBuild(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken);
                var operation = new AppPlatformArmOperation <AppBuildResource>(Response.FromValue(new AppBuildResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #5
0
        public virtual ArmOperation <ConfigurationServiceSettingsValidateResult> Validate(WaitUntil waitUntil, ConfigurationServiceSettings settings, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(settings, nameof(settings));

            using var scope = _configurationServiceResourceConfigurationServicesClientDiagnostics.CreateScope("ConfigurationServiceResource.Validate");
            scope.Start();
            try
            {
                var response  = _configurationServiceResourceConfigurationServicesRestClient.Validate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, settings, cancellationToken);
                var operation = new AppPlatformArmOperation <ConfigurationServiceSettingsValidateResult>(new ConfigurationServiceSettingsValidateResultOperationSource(), _configurationServiceResourceConfigurationServicesClientDiagnostics, Pipeline, _configurationServiceResourceConfigurationServicesRestClient.CreateValidateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, settings).Request, response, OperationFinalStateVia.Location);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #6
0
        public virtual ArmOperation <ConfigurationServiceResource> CreateOrUpdate(WaitUntil waitUntil, string configurationServiceName, ConfigurationServiceResourceData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(configurationServiceName, nameof(configurationServiceName));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _configurationServiceResourceConfigurationServicesClientDiagnostics.CreateScope("ConfigurationServiceResourceCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _configurationServiceResourceConfigurationServicesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationServiceName, data, cancellationToken);
                var operation = new AppPlatformArmOperation <ConfigurationServiceResource>(new ConfigurationServiceResourceOperationSource(Client), _configurationServiceResourceConfigurationServicesClientDiagnostics, Pipeline, _configurationServiceResourceConfigurationServicesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationServiceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }