Esempio n. 1
0
        /// <summary>
        /// Asynchronously updates the <see cref="ServerSettings"/> on the
        /// Splunk server represented by the current instance.
        /// </summary>
        /// <param name="values">
        /// An object representing the updated server setting values.
        /// </param>
        /// <returns>
        /// An object representing the updated server settings on the Splunk
        /// server represented by the current instance.
        /// </returns>
        public async Task <ServerSettings> UpdateSettingsAsync(ServerSettingValues values)
        {
            var resource = new ServerSettings(this.Context, this.Namespace);
            await resource.UpdateAsync(values);

            return(resource);
        }
        /// <summary>
        /// Asynchronously updates the server settings represented by the
        /// current instance.
        /// </summary>
        /// <param name="values">
        /// An object representing the updated server setting values.
        /// </param>
        /// <returns>
        /// </returns>
        public async Task UpdateAsync(ServerSettingValues values)
        {
            using (var response = await this.Context.PostAsync(this.Namespace, this.ResourceName, values))
            {
                await response.EnsureStatusCodeAsync(HttpStatusCode.OK);

                await this.UpdateSnapshotAsync(response);
            }
        }
        /// <inheritdoc/>
        public virtual async Task <ServerSettings> UpdateSettingsAsync(ServerSettingValues values)
        {
            using (var response = await this.Context.PostAsync(this.Namespace, Settings, values).ConfigureAwait(false))
            {
                await response.EnsureStatusCodeAsync(HttpStatusCode.OK).ConfigureAwait(false);

                var feed = new AtomFeed();
                await feed.ReadXmlAsync(response.XmlReader).ConfigureAwait(false);

                var settings = new ServerSettings(feed);

                return(settings);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Asynchronously updates setting values on the current <see cref="Server"/>.
 /// </summary>
 /// <param name="values">
 /// An object representing the setting values to be changed.
 /// </param>
 /// <returns>
 /// An object representing the updated server settings.
 /// </returns>
 /// <seealso cref="M:Splunk.Client.IServer.UpdateSettingsAsync(ServerSettingValues)"/>
 public Task <ServerSettings> UpdateSettingsAsync(ServerSettingValues values)
 {
     Contract.Requires(values != null);
     return(null);
 }