Page 1 of 3

How to connect

PostPosted: 21 Sep 2015, 12:03
by blacksqd
Hello,

I want to use the TeamDriveApi.py in my program. But I'm blocked at the beginning.
I take an example. I create an account "myUser" with a password "myPwd". When
I'm in the GUI Interface, I check the ID Server and it's "12345". So i thought that I had
everything to start with Python.

So here is my code :

from TeamDriveApi import *
connection = TeamDriveApi("[::1]:12345")
connection.login("myUser", "myPwd")

But I have a connection error.

Thank you for your help.

Re: How to connect

PostPosted: 21 Sep 2015, 12:18
by Sebastian Philipp
Hi blacksqd,

Did you enable the API as described here?

http://docs.teamdrive.net/Agent/4.1/html/TeamDrive_Http_Api.html#overview

Sebastian

Re: How to connect

PostPosted: 21 Sep 2015, 12:50
by blacksqd
Hi,

Yes I enabled the API by adding http-api-port=12345 after Settings

Re: How to connect

PostPosted: 21 Sep 2015, 13:13
by Sebastian Philipp
Hi blacksqd,

if you're using the desktop client, the API will not be available until the Client successfully made a successful log in. This is a technical limitation of the Gui client and only available to Agents.

Sebastian

Re: How to connect

PostPosted: 21 Sep 2015, 13:42
by blacksqd
I'm not sure ton understand everything.

So, I downloaded the Team Drive Agent and nothing else.
I created my program. When I ran it, I have a Connection Error.
When you asked me if I enabled the API, I search for the teamdrive.settings but I
didn't found it. I supposed I have to install the TeamDrive Client so I did it.
And when I dit it, I found the teamdrive.settings et added the line.

I only want to use the TeamDrive.py which is in the Team Drive Agent and use it in my script.

Re: How to connect

PostPosted: 21 Sep 2015, 14:53
by Sebastian Philipp
I'l try to clarify a bit:

  • Please don't install the TeamDrive Client and the TeamDrive Agent at the same time on the same machine, as this unnecessary increases the complexity.
  • The teamdrive.settings file should be automatically created by the agent. There is typically no need to also install the GUI-client.
  • You can run netstat to check that the TeamDrive Agent has successfully opened the port. If the port is not open, please double check that the setting is correct. If it is open, then please check the TeamDriveApi parameters.

Which Linux distribution + Version do you use?

Sebastian

Re: How to connect

PostPosted: 21 Sep 2015, 15:31
by blacksqd
I use Ubuntu 14.04

The teamdrive.settings isn't there without Team Drive Client. So I suppose I didn't install TeamDrive Agent
in the right way.
In http://docs.teamdrive.net/Agent/4.1/html/Agent.html#linux
In the installation, I executed the TeamDriveAgent et I have the GUI.
But after that, I have to open http://localhost:45454. But in this moment, I have
"unreachable web page". I suppose the problem comme from this ?

Re: How to connect

PostPosted: 21 Sep 2015, 16:28
by Sebastian Philipp
If you run

Code: Select all
./teamdrived --http-api-port=45454


the you should definitely not have a user interface. If you have a user interface, you have started the wrong executable. The port number that you added to the command list must match the URL that you open in your browser. Can you please check that the TeamDrive Agent has opened the correct port?

Sebastian

Re: How to connect

PostPosted: 21 Sep 2015, 16:54
by blacksqd
After running (the correct) teamdrived, it seems that the port isn't open.

Re: How to connect

PostPosted: 21 Sep 2015, 17:05
by Sebastian Philipp
do you have any hints regarding the API in the log files? You can find the logs in ~/.teamdrive/logs