TM1 REST API - GitInit

Post Reply
luizg2019
Posts: 41
Joined: Thu Sep 12, 2019 11:02 pm
OLAP Product: TM1 - PAX-PAW-Perspectiv-Arc
Version: PA 2.0.9 - PAW 2.0.73
Excel Version: office 2016

TM1 REST API - GitInit

Post by luizg2019 »

Hello!

I'm trying to set up git on my server but i'm getting an error. IBM's documentation on this is pretty basic and lack a lot of info.

Here's my code:

Code: Select all

POST https://localhost:15000/api/v1/GitInit

{
"URL": "https://github.com/Luiz/Test.git",
"Deployment": "dev",
"Username": "Luiz",
"Password": "xxx",
"Force": true
}
And this is the response I'm getting:

Code: Select all

{
    "error": {
        "code": "278",
        "message": "'GitInit' resource can not be resolved on type 'EntityContainer'."
    }
}
Anyone got an idea? :| Thank you.
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: TM1 REST API - GitInit

Post by macsir »

I am interested in it too but haven't got chance to try it yet.
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Edward Stuart
Community Contributor
Posts: 247
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: TM1 REST API - GitInit

Post by Edward Stuart »

Hi Luiz,

I'm interested in testing this as well and will find some time to have a go as well.

Assume you are following the manual details:

https://www.ibm.com/support/knowledgece ... ntegration

As I understand it you need to export certificates from github and import them into the PA certificate store and then you can run the GitInit which will create a }git folder in your data directory
kangkc
Community Contributor
Posts: 206
Joined: Fri Oct 17, 2008 2:40 am
OLAP Product: TM1, PA , TMVGate
Version: 2.x
Excel Version: 36x
Location: Singapore
Contact:

Re: TM1 REST API - GitInit

Post by kangkc »

I did managed to get GInit running without error but I was using a local repository hence may be different as I didn't want to go through a trouble of involving certificates.
I did encounter some error initially and I have to explicily run a Git Init command (not using TM1 Rest) with the local repository else I will get an error with GITinit Rest call. Can't recall whether it is the same error you encountered.
luizg2019
Posts: 41
Joined: Thu Sep 12, 2019 11:02 pm
OLAP Product: TM1 - PAX-PAW-Perspectiv-Arc
Version: PA 2.0.9 - PAW 2.0.73
Excel Version: office 2016

Re: TM1 REST API - GitInit

Post by luizg2019 »

Edward Stuart wrote: Fri Nov 08, 2019 11:05 am As I understand it you need to export certificates from github and import them into the PA certificate store and then you can run the GitInit which will create a }git folder in your data directory
Yes, I already did this. I used the 2nd command line from IBM's documentation to check the github certificates and it returns "OK" to all 3 certifs so I don't know what's wrong :(
I'm trying to follow this tutorial from TM1up which is a little more detailed and better explained than IBM's documentation but my gitnit command is not working. I'll keep trying and if I find out what's wrong I'll update this thread since you and @macsir are interested in this too.
kangkc wrote: Fri Nov 08, 2019 12:27 pm I did managed to get GInit running without error but I was using a local repository hence may be different as I didn't want to go through a trouble of involving certificates.
I did encounter some error initially and I have to explicily run a Git Init command (not using TM1 Rest) with the local repository else I will get an error with GITinit Rest call. Can't recall whether it is the same error you encountered.
Thank you for the info. I guess I’ll try git with the local repository as well.
Edward Stuart
Community Contributor
Posts: 247
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: TM1 REST API - GitInit

Post by Edward Stuart »

I've followed the same details and have a slightly different error:

Code: Select all

{
    "error": {
        "code": "289",
        "message": "TM1 Git failed to connect to remote. Reason: TM1 Git network connection failed."
    }
}
This returns a 400 Bad Request Error

I changed the Post URL to use a lowercase i on Init:

https://localhost:<HttpPortNumber>/api/v1/Gitinit

and returned your EntityContainer error code 278
Edward Stuart
Community Contributor
Posts: 247
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: TM1 REST API - GitInit

Post by Edward Stuart »

Quick update,

I was also successful in using a local repository

Will try and get some time this week to investigate further
luizg2019
Posts: 41
Joined: Thu Sep 12, 2019 11:02 pm
OLAP Product: TM1 - PAX-PAW-Perspectiv-Arc
Version: PA 2.0.9 - PAW 2.0.73
Excel Version: office 2016

Re: TM1 REST API - GitInit

Post by luizg2019 »

Edward Stuart wrote: Fri Nov 08, 2019 2:01 pm I've followed the same details and have a slightly different error:

Code: Select all

{
    "error": {
        "code": "289",
        "message": "TM1 Git failed to connect to remote. Reason: TM1 Git network connection failed."
    }
}
This returns a 400 Bad Request Error
Thank you for your help Edward, you made me realize my PA version was wrong.
I'm embarrassed but turns out I was running Planning Analytics 2.0.4 on my test machine, and the git feature is only available on 2.0.7 and higher :oops:
But after updating it to 2.0.7 I got the same "289" error as you. Turns out we're supposed to restart the TM1 Server that we're trying to run the GitInit, after installing the certificates :|

After restarting the TM1 server, I was able to run GitInit successfully. Hope this works for you.
this is the response I got:

Code: Select all

Status: 201 Created
{
    "@odata.context": "$metadata#ibm.tm1.api.v1.Git",
    "URL": "https://github.com/Luiz/Teste.git",
    "Deployment": "dev",
    "DeployedCommit": {
        "ID": null,
        "Summary": null,
        "Author": null
    },
    "Remote": {
        "Connected": true,
        "Branches": [],
        "Tags": []
    }
}

If anyone has any questions or doubts about this, I'm available :D
Gonna try the other git features now.
Edward Stuart
Community Contributor
Posts: 247
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: TM1 REST API - GitInit

Post by Edward Stuart »

Seems I'd been working on 2.0.4 as well, for anyone following this thread you will need Planning Analytics 2.0.7 installed, further details can be found on the New Features listing for 2.0.7 here: https://www.ibm.com/support/knowledgece ... yment.html

It all follows a similar pattern for GitStatus, GitPull, GitPush etc.. Helps if you have some understanding/ familiarity with Git as should be fairly obvious.

A great many advantages to running with Git but I'm more interested in learning if the internal commands offer advantages over running a standard Git deployment.
luizg2019
Posts: 41
Joined: Thu Sep 12, 2019 11:02 pm
OLAP Product: TM1 - PAX-PAW-Perspectiv-Arc
Version: PA 2.0.9 - PAW 2.0.73
Excel Version: office 2016

Re: TM1 REST API - GitInit

Post by luizg2019 »

Edward Stuart wrote: Tue Nov 12, 2019 11:12 pm A great many advantages to running with Git but I'm more interested in learning if the internal commands offer advantages over running a standard Git deployment.
Well for me the best advantage of using TM1's internal git is when you do a GitPull command it automatically updates its objetcts (cubes, processes, rules, etc) dynamically without having to restart the server like you'd have to if you simply replaced the .rux/.pro file in its data directory. :)

The sad part is that IBM's documentation on this is not very detailed. For example, they say you SHOULD create a tm1project file for each model, but I have no idea how to create this, where to save it, how to execute it, etc.. Does anyone have more info on this?

One thing I noticed is that a gitpull will "update" the pro,rux, etc files instead of just adding the new lines that you created in dev, is there any way where I could just modify the old lines that were modified and add the new lines without replacing the whole file? Because we have some servers that have slightly different rules from each other so a gitpull would erase that. :(
Roberto88
Posts: 1
Joined: Tue May 19, 2020 1:48 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2019

Re: TM1 REST API - GitInit

Post by Roberto88 »

Hi!
I tried to configure Git via instuction on TM1up, and got an error 289, when I did GitPush on GitHub repository. But restarting the TM1 servers and services didn't help me. I had two-factor authorization and problem was solved by making a token and use this token instead of Password in HTTP request.
ichermak
Posts: 4
Joined: Thu Feb 25, 2021 9:24 pm
OLAP Product: TM1 / IBM Planning Analytics
Version: 2.0.9.10
Excel Version: 2019
Contact:

Re: TM1 REST API - GitInit

Post by ichermak »

Hi,

I had the same error message when trying to git init with a private github repository...It works fine whit public one :roll:

++
Post Reply