TM1 REST API - GitInit

Post Reply
luizg2019
Posts: 13
Joined: Thu Sep 12, 2019 11:02 pm
OLAP Product: TM1 - PAW & Architect
Version: PA 2.0.7 - PAW 2.0.44
Excel Version: office 2016

TM1 REST API - GitInit

Post by luizg2019 » Thu Nov 07, 2019 6:38 pm

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
Community Contributor
Posts: 659
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013
Contact:

Re: TM1 REST API - GitInit

Post by macsir » Thu Nov 07, 2019 8:08 pm

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: 233
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 » Fri Nov 08, 2019 11:05 am

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: 196
Joined: Fri Oct 17, 2008 2:40 am
OLAP Product: TM1
Version: 9.x
Excel Version: 200x
Location: Singapore

Re: TM1 REST API - GitInit

Post by kangkc » 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.

luizg2019
Posts: 13
Joined: Thu Sep 12, 2019 11:02 pm
OLAP Product: TM1 - PAW & Architect
Version: PA 2.0.7 - PAW 2.0.44
Excel Version: office 2016

Re: TM1 REST API - GitInit

Post by luizg2019 » Fri Nov 08, 2019 12:36 pm

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: 233
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 » 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

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: 233
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 » Mon Nov 11, 2019 9:49 am

Quick update,

I was also successful in using a local repository

Will try and get some time this week to investigate further

luizg2019
Posts: 13
Joined: Thu Sep 12, 2019 11:02 pm
OLAP Product: TM1 - PAW & Architect
Version: PA 2.0.7 - PAW 2.0.44
Excel Version: office 2016

Re: TM1 REST API - GitInit

Post by luizg2019 » Mon Nov 11, 2019 7:26 pm

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: 233
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 » Tue Nov 12, 2019 11:12 pm

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: 13
Joined: Thu Sep 12, 2019 11:02 pm
OLAP Product: TM1 - PAW & Architect
Version: PA 2.0.7 - PAW 2.0.44
Excel Version: office 2016

Re: TM1 REST API - GitInit

Post by luizg2019 » Wed Nov 13, 2019 2:04 pm

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. :(

Post Reply