REST API: Variables info missing when deploy a TI process

Post Reply
Artem Larionov
Posts: 2
Joined: Tue Jul 03, 2018 3:50 pm
OLAP Product: IBM Planning Analytics
Version: 2.0.6
Excel Version: 2016

REST API: Variables info missing when deploy a TI process

Post by Artem Larionov »

Hi everyone!

I have a question about deploying a TI process with REST API without server restart (for example, hot deploy from test to prod).

I do this by exporting TI to JSON first:

Code: Select all

api/v1/Processes('ProcessName')?$select=Name,HasSecurityAccess,PrologProcedure,MetadataProcedure,DataProcedure,EpilogProcedure,DataSource,Parameters,Variables > output.json
And then with a POST I send this JSON to target server:

Code: Select all

api/v1/Processes -d @"output.json" -H "Content-Type: application/json"
So everything is working perfectly except for variables. JSON only contains TI variables names and types. It does not have the information if the variables should be ignored or it is 'other' variable. It also ignores custom variables that have formulas. The result is that in the target server the TI process has all variables set to 'ignore' which is not ideal. The custom variables are not created in target server at all.

If then I examine the *.pro files, there will also be a difference. In the source server the *.pro file contains section with variables info:

Code: Select all

582,5
VarType=32ColType=827
VarType=32ColType=827
VarType=32ColType=827
VarType=32ColType=827
VarName=V5VarType=32ColType=827VarFormula=V5='TestVar';:VarFormulaDestination=BOTH
While the same section in the target server will be empty:

Code: Select all

582,0
So this means that not all information is passed when we deploy a TI with that REST API method. Does anyone have any idea how to fix that? Any advice is appreciated!
User avatar
macsir
MVP
Posts: 782
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: REST API: Variables info missing when deploy a TI process

Post by macsir »

I wouldn't recommend to re-invent the wheel as tm1py is already in place for you to use. If you compare your syntax with it, you would find some clues.
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
scrumthing
Posts: 81
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 11.x
Excel Version: MS365

Re: REST API: Variables info missing when deploy a TI process

Post by scrumthing »

We encountered a similar problem when we were using the GIT integration. there the variable information is not passed on to the destination as well.
As far as I know it has something to do with the difference between TM1 server and TM1 architect.they interpreted variables differently and we have special UI data for the architect which is hidden in the rest api and “forgotten” in the GIT integration.
There is no OLAP database besides TM1!
Artem Larionov
Posts: 2
Joined: Tue Jul 03, 2018 3:50 pm
OLAP Product: IBM Planning Analytics
Version: 2.0.6
Excel Version: 2016

Re: REST API: Variables info missing when deploy a TI process

Post by Artem Larionov »

Thanks to macsir for pointing out tm1py, I actually checked the code there and was able to fix my issue.

The issue was that in IBM REST API documentation that I was using here https://www.ibm.com/support/knowledgece ... st_api.pdf
not all request parameters are mentioned. In TM1PY there were other parameters that are not mentioned in the documentation, like UIData, VariablesUIData.

So I modified my get request like this:

Code: Select all

api/v1/Processes('ProcessName')?$select=Name,HasSecurityAccess,PrologProcedure,MetadataProcedure,DataProcedure,EpilogProcedure,Parameters,Variables,UIData,VariablesUIData,DataSource/Type,DataSource/dataSourceNameForServer,DataSource/dataSourceNameForClient,DataSource/asciiDecimalSeparator,DataSource/asciiDelimiterChar,DataSource/asciiDelimiterType,DataSource/asciiHeaderRecords,DataSource/asciiQuoteCharacter,DataSource/asciiThousandSeparator,DataSource/view,DataSource/query,DataSource/userName,DataSource/password,DataSource/usesUnicode,DataSource/subset > output.json
And it's working perfect now. Is there by any chance a more detailed documentation for REST API where some parameters are not omitted?
David Usherwood
Site Admin
Posts: 1453
Joined: Wed May 28, 2008 9:09 am

Re: REST API: Variables info missing when deploy a TI process

Post by David Usherwood »

Why not just use tm1py to do the transfer? It's a pretty impressive piece of work and well looked after (last update 12 May 2020). I'm just building an interface for a client to one of the cloud ERP packages, pulling ledger balances and transactions straight back to TM1, and it's working well.
Post Reply