tm1-client 0.1.1 API

A reactive Java client for the IBM Planning Analytics (TM1) REST API: every endpoint as a typed service, with a model generated from TM1's own metadata.

Getting started

  1. Have a TM1 server to talk to. To run one on your own computer in Docker, follow Run TM1 on your own computer. It takes about 15 minutes, and you need your own licensed copy of TM1 Server.

  2. Add the client to your build. Gradle:

    implementation("io.skipcheck:tm1-client:0.1.1")

    Maven:

    <dependency>
      <groupId>io.skipcheck</groupId>
      <artifactId>tm1-client</artifactId>
      <version>0.1.1</version>
    </dependency>

    It needs Java 17 or later.

  3. Say hello. This connects, prints the server's version and lists its cubes:

    public static void main(String[] args) {
    	Tm1Client tm1 = Tm1Client.builder()
    		.baseUrl("http://localhost:8010/api/v1/")
    		.basicAuth("admin", "") // tm1-server's default login
    		.build();
    	// block() is fine in a main(); in an application, return the Mono instead
    	hello(tm1).then(tm1.close()).block();
    }
    
    static Mono<Void> hello(Tm1Client tm1) {
    	return tm1.session()
    		.version()
    		.doOnNext(version -> System.out.println("Hello from TM1 " + version))
    		.thenMany(tm1.cubes().modelCubes(ODataQuery.none().select(Cube.NAME)))
    		.doOnNext(cube -> System.out.println("  " + cube.name()))
    		.then();
    }
    

Where next

  • Tm1Client: the entry point, with a service for each area of TM1, such as cubes and cellsets for reading data. Each service's page shows how to use it.
  • Tm1Session: logging in with CAM, sandboxes, and sending a request no service covers yet.
  • tm1-spring-boot-starter: the client as a Spring Boot bean, configured from properties.
  • tm1-testcontainers: test your code against a real TM1 server in Docker.
Packages
Package
Description
The TM1 REST client: Tm1Client, the entry point, and Tm1Request, one REST call described but not sent.
How the client authenticates to TM1: Tm1Authenticator and its implementations for TM1's own security (Basic) and Cognos Access Manager (CAMNamespace, CAMPassport).
The client's exceptions.
The TM1 REST API's model, generated from the $metadata snapshot by tm1-codegen: don't edit these files.
OData v4 protocol support that knows nothing about TM1: building correctly encoded resource paths and query options, the $filter expression language, JSON control information, and decoding collections as a stream.
The services: one per REST resource family, in a subpackage per area.
Services for annotations on cube cells.
Attribute definitions, and the attribute values translated per locale (LocalizedAttributes), for every kind of TM1 object that has them.
Services for the Applications contents tree: folders, documents, links and references.
Services for cubes and views.
Services for data: cellsets, cell writes, MDX, sandboxes, change sets and drillthrough.
Services for dimensions, hierarchies, elements, edges, levels, members and subsets.
Encryption at rest: the model's files encrypted with a key from a key management service.
TM1 Git: putting a model under version control, and moving it between servers (plan phase 9).
Services for processes and chores.
Services for security and runtime: users, groups, sessions and threads.
Services for the server, its configuration and its logs.
The TM1 session every service shares: login, re-login, close, and the request pipeline.
TM1 versions, as Server.ProductVersion reports them.