Exemple #1
0
        public virtual async Task <ArmOperation <ServiceRegistryResource> > UpdateAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
        {
            using var scope = _serviceRegistryResourceServiceRegistriesClientDiagnostics.CreateScope("ServiceRegistryResource.Update");
            scope.Start();
            try
            {
                var response = await _serviceRegistryResourceServiceRegistriesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);

                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)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #2
0
        public virtual async Task <ArmOperation <AppPlatformAppResource> > SetActiveDeploymentsAsync(WaitUntil waitUntil, ActiveDeploymentList activeDeploymentCollection, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(activeDeploymentCollection, nameof(activeDeploymentCollection));

            using var scope = _appPlatformAppResourceAppsClientDiagnostics.CreateScope("AppPlatformAppResource.SetActiveDeployments");
            scope.Start();
            try
            {
                var response = await _appPlatformAppResourceAppsRestClient.SetActiveDeploymentsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, activeDeploymentCollection, cancellationToken).ConfigureAwait(false);

                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)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #3
0
        public virtual async Task <ArmOperation <AppPlatformCustomDomainResource> > UpdateAsync(WaitUntil waitUntil, AppPlatformCustomDomainResourceData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _appPlatformCustomDomainResourceCustomDomainsClientDiagnostics.CreateScope("AppPlatformCustomDomainResource.Update");
            scope.Start();
            try
            {
                var response = await _appPlatformCustomDomainResourceCustomDomainsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);

                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)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #4
0
        public virtual async Task <ArmOperation <AppBuildResource> > UpdateAsync(WaitUntil waitUntil, AppBuildData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _appBuildBuildServiceClientDiagnostics.CreateScope("AppBuildResource.Update");
            scope.Start();
            try
            {
                var response = await _appBuildBuildServiceRestClient.CreateOrUpdateBuildAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);

                var operation = new AppPlatformArmOperation <AppBuildResource>(Response.FromValue(new AppBuildResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #5
0
        public virtual async Task <ArmOperation <ConfigurationServiceSettingsValidateResult> > ValidateAsync(WaitUntil waitUntil, ConfigurationServiceSettings settings, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(settings, nameof(settings));

            using var scope = _configurationServiceResourceConfigurationServicesClientDiagnostics.CreateScope("ConfigurationServiceResource.Validate");
            scope.Start();
            try
            {
                var response = await _configurationServiceResourceConfigurationServicesRestClient.ValidateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, settings, cancellationToken).ConfigureAwait(false);

                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)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #6
0
        public virtual async Task <ArmOperation <ConfigurationServiceResource> > CreateOrUpdateAsync(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 = await _configurationServiceResourceConfigurationServicesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configurationServiceName, data, cancellationToken).ConfigureAwait(false);

                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)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }