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 constructor | A service that sends its requests through session. |
ServerAsync | The server's name, version and ports. |
StaticConfigurationAsync | The settings the server started with, from tm1s.cfg. |
UpdateStaticConfigurationAsync | Changes tm1s.cfg; most settings take effect when the server next starts. |
ActiveConfigurationAsync | The settings the server runs with now. |
ConfigurationAsync | The server's configuration in the older, flat form. |
LoggersAsync | GET Loggers, streamed. |
LoggerAsync | GET Loggers('name'). |
SetLoggerLevelAsync | Changes a logger's level, at once. |
ServerService
constructorServerService(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