skipcheck

TM1 client · Docs · The server

ServerService

using Skipcheck.Tm1.Client.Services;

The server: what it is (Server), how it's configured, and its loggers.

The static configuration is tm1s.cfg's, and the one to change; the active one is what the server runs with now, read only.

Read the server's name and version:

var server = await tm1.Server.ServerAsync(ODataQuery.None().Select(Server.Fields.Name, Server.Fields.ProductVersion));
return $"{server.Name} runs TM1 {server.ProductVersion}";

Read a setting the server runs with now:

// What the server runs with now, which can differ from tm1s.cfg until it restarts
var settings = await tm1.Server.ActiveConfigurationAsync();
return settings.Administration?.DataBaseDirectory;

Change a logger's level:

// Takes effect at once, without a restart
await tm1.Server.SetLoggerLevelAsync("TM1.Process", LogLevel.Debug);

Members

ServerService constructorA service that sends its requests through session.
ServerAsyncThe server's name, version and ports.
StaticConfigurationAsyncThe settings the server started with, from tm1s.cfg.
UpdateStaticConfigurationAsyncChanges tm1s.cfg; most settings take effect when the server next starts.
ActiveConfigurationAsyncThe settings the server runs with now.
ConfigurationAsyncThe server's configuration in the older, flat form.
LoggersAsyncGET Loggers, streamed.
LoggerAsyncGET Loggers('name').
SetLoggerLevelAsyncChanges a logger's level, at once.

ServerService

constructor
ServerService(Tm1Session session)

A service that sends its requests through session.

ServerAsync

Task<Server> ServerAsync(ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Server: the server's name, version and ports. TM1 (11.8) sends no ETag for it.

TM1 REST Singleton Server

StaticConfigurationAsync

Task<ServerSettings> StaticConfigurationAsync(ODataQuery? query = null, CancellationToken cancellationToken = default)

GET StaticConfiguration: the settings the server started with, from tm1s.cfg.

TM1 REST Singleton StaticConfiguration

UpdateStaticConfigurationAsync

Task UpdateStaticConfigurationAsync(ServerSettingsPatch patch, CancellationToken cancellationToken = default)

PATCH StaticConfiguration: changes tm1s.cfg; most settings take effect when the server next starts.

TM1 REST Singleton StaticConfiguration

ActiveConfigurationAsync

Task<ServerSettings> ActiveConfigurationAsync(ODataQuery? query = null, CancellationToken cancellationToken = default)

GET ActiveConfiguration: the settings the server runs with now. Read only: TM1 (11.8) refuses a PATCH here ("PATCH not allowed on this resource"); settings change through UpdateStaticConfigurationAsync.

TM1 REST Singleton ActiveConfiguration

ConfigurationAsync

Task<Configuration> ConfigurationAsync(ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Configuration: the server's configuration in the older, flat form. Deprecated in TM1 schema 11.0.0: use StaticConfigurationAsync and ActiveConfigurationAsync.

TM1 REST Singleton Configuration

LoggersAsync

IAsyncEnumerable<Logger> LoggersAsync(ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Loggers, streamed: the server's loggers and their levels.

TM1 REST EntitySet Loggers

LoggerAsync

Task<Logger> LoggerAsync(string name, ODataQuery? query = null, CancellationToken cancellationToken = default)

GET Loggers('name').

TM1 REST EntitySet Loggers

SetLoggerLevelAsync

Task SetLoggerLevelAsync(string name, LogLevel level, CancellationToken cancellationToken = default)

PATCH Loggers('name'): changes a logger's level, at once.

TM1 REST EntitySet Loggers