Exemple #1
0
        public virtual WebAppUpdateDiagnosticLogsConfigSlotOperation CreateOrUpdate(SiteLogsConfigData siteLogsConfig, bool waitForCompletion = true, CancellationToken cancellationToken = default)
        {
            if (siteLogsConfig == null)
            {
                throw new ArgumentNullException(nameof(siteLogsConfig));
            }

            using var scope = _clientDiagnostics.CreateScope("SiteSlotConfigLogs.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _webAppsRestClient.UpdateDiagnosticLogsConfigSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, siteLogsConfig, cancellationToken);
                var operation = new WebAppUpdateDiagnosticLogsConfigSlotOperation(this, response);
                if (waitForCompletion)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #2
0
 internal SiteSlotConfigLogs(ArmResource options, SiteLogsConfigData resource) : base(options, resource.Id)
 {
     HasData            = true;
     _data              = resource;
     Parent             = options;
     _clientDiagnostics = new ClientDiagnostics(ClientOptions);
     _webAppsRestClient = new WebAppsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
 }
Exemple #3
0
 internal LogsSiteSlotConfigResource(ArmClient client, SiteLogsConfigData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }
Exemple #4
0
        public virtual ArmOperation <LogsSiteSlotConfigResource> CreateOrUpdate(WaitUntil waitUntil, SiteLogsConfigData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _logsSiteSlotConfigWebAppsClientDiagnostics.CreateScope("LogsSiteSlotConfigResource.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _logsSiteSlotConfigWebAppsRestClient.UpdateDiagnosticLogsConfigSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken);
                var operation = new AppServiceArmOperation <LogsSiteSlotConfigResource>(Response.FromValue(new LogsSiteSlotConfigResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
        public async virtual Task <ArmOperation <LogsSiteSlotConfig> > CreateOrUpdateAsync(bool waitForCompletion, SiteLogsConfigData siteLogsConfig, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(siteLogsConfig, nameof(siteLogsConfig));

            using var scope = _logsSiteSlotConfigWebAppsClientDiagnostics.CreateScope("LogsSiteSlotConfig.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _logsSiteSlotConfigWebAppsRestClient.UpdateDiagnosticLogsConfigSlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, siteLogsConfig, cancellationToken).ConfigureAwait(false);

                var operation = new AppServiceArmOperation <LogsSiteSlotConfig>(Response.FromValue(new LogsSiteSlotConfig(Client, response), response.GetRawResponse()));
                if (waitForCompletion)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
 internal LogsSiteConfig(ArmClient client, SiteLogsConfigData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }
Exemple #7
0
 internal SiteConfigLogs(ArmClient armClient, SiteLogsConfigData data) : this(armClient, data.Id)
 {
     HasData = true;
     _data   = data;
 }
Exemple #8
0
        public async virtual Task <SiteConfigLogsCreateOrUpdateOperation> CreateOrUpdateAsync(bool waitForCompletion, SiteLogsConfigData siteLogsConfig, CancellationToken cancellationToken = default)
        {
            if (siteLogsConfig == null)
            {
                throw new ArgumentNullException(nameof(siteLogsConfig));
            }

            using var scope = _siteConfigLogsWebAppsClientDiagnostics.CreateScope("SiteConfigLogs.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _siteConfigLogsWebAppsRestClient.UpdateDiagnosticLogsConfigAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, siteLogsConfig, cancellationToken).ConfigureAwait(false);

                var operation = new SiteConfigLogsCreateOrUpdateOperation(ArmClient, response);
                if (waitForCompletion)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }