skipcheck

TM1 client · Docs · The server

ServerService

import { ServerService } from "@skipcheck/tm1-client";

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:

const server = await tm1.server.server(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
const settings = await tm1.server.activeConfiguration();
return settings.Administration?.DataBaseDirectory ?? undefined;

Change a logger's level:

// Takes effect at once, without a restart
return tm1.server.setLoggerLevel("TM1.Process", LogLevel.Debug);

Members

serverThe server's name, version and ports.
staticConfigurationThe settings the server started with, from tm1s.cfg.
updateStaticConfigurationChanges tm1s.cfg; most settings take effect when the server next starts.
activeConfigurationThe settings the server runs with now.
configurationThe server's configuration in the older, flat form.
loggersGET Loggers, streamed.
loggerGET Loggers('name'), such as TM1.Server.
setLoggerLevelChanges a logger's level, at once.

server

server(query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Server>

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

TM1 REST Singleton Server

staticConfiguration

staticConfiguration(query?: ODataQuery | null, options?: Tm1CallOptions): Promise<ServerSettings>

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

TM1 REST Singleton StaticConfiguration

updateStaticConfiguration

updateStaticConfiguration(patch: ServerSettingsPatch, options?: Tm1CallOptions): Promise<void>

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

TM1 REST Singleton StaticConfiguration

activeConfiguration

activeConfiguration(query?: ODataQuery | null, options?: Tm1CallOptions): Promise<ServerSettings>

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 updateStaticConfiguration.

TM1 REST Singleton ActiveConfiguration

configuration

configuration(query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Configuration>

GET Configuration: the server's configuration in the older, flat form.

TM1 REST Singleton Configuration

loggers

loggers(query?: ODataQuery | null, options?: Tm1CallOptions): Tm1Stream<Logger>

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

TM1 REST EntitySet Loggers

logger

logger(name: string, query?: ODataQuery | null, options?: Tm1CallOptions): Promise<Logger>

GET Loggers('name'), such as TM1.Server: the logger, or a Tm1NotFoundException if there's none.

TM1 REST EntitySet Loggers

setLoggerLevel

setLoggerLevel(name: string, level: LogLevel, options?: Tm1CallOptions): Promise<void>

PATCH Loggers('name'): changes a logger's level, at once. Unrecognized, a level this client doesn't know, isn't sent.

TM1 REST EntitySet Loggers