Module TeamDriveApi :: Class InternalTeamDriveApi

Class InternalTeamDriveApi

Known Subclasses:

Instance Methods
TeamDriveApi
__init__(self, server='[::1]:45454')
Creates a new instance of the API.
list[int]
getSpaceIds(self)
Returns a list of all known Spaces Ids.
dict
getSpace(self, spaceId)
Will return information about that Space.
dict
createSpace(self, spaceName, disableFileSystem)
Creates a new Space.
dict
deleteSpace(self, spaceId, delInFs, delOnServer)
Deletes a Space.
dict
joinSpace(self, spaceId, disableFileSystem, spacePath=None)
Joins an archived Space or rejoins an existing.
dict
inviteMember(self, spaceId, addressId, text)
Invites a user into a Space.
dict
quit(self, logout)
Quits TeamDrive.
dict
getLoginInformation(self)
Returns information about the current user
dict
about(self)
Returns information about the application.
dict
login(self, username, password)
Will login a user with a given password.
dict
getFile(self, fileId)
Returns information about the given File Id
list[dict]
getFiles(self, spaceId, filePath, trashed)
Returns a list of files matching the Space Id, the file path and the trashed flag.
list[int]
getFolderContent(self, spaceId, filePath, trashed)
Returns a list of file Ids in the Space in a folder.
dict
putFile(self, spaceId, path, data)
Uploads a file into a Space.
dict
moveFile(self, spaceId, filePath, trashed, newFilePath)
Moves a file from filePath to newFilePath in the given Space.
list[int]
getAddressbookIds(self)
Returns all knows Addressbook Ids.
dict
getAddressbook(self, addressId)
Returns information about a given Addressbook Id.
Method Details

__init__(self, server='[::1]:45454')
(Constructor)

 

Creates a new instance of the API.

example:

>>> api = TeamDriveApi("127.0.0.1:45454")
>>> map(api.getSpace, api.getSpaceIds())
[{.....}]
Returns: TeamDriveApi
Raises:
  • httplib.HTTPException - a Connection Error.

getSpaceIds(self)

 

Returns a list of all known Spaces Ids.

example:

>>> api = TeamDriveApi("127.0.0.1:45454")
>>> map(api.getSpace, api.getSpaceIds())
[{.....}]
Returns: list[int]
Raises:
  • httplib.HTTPException - a Connection Error.

getSpace(self, spaceId)

 

Will return information about that Space.

example:

>>> api = TeamDriveApi("127.0.0.1:45454")
>>> map(api.getSpace, api.getSpaceIds())
[{.....}]
Parameters:
  • spaceId (int) - The Id of the Space
Returns: dict
Raises:
  • httplib.HTTPException - a Connection Error.

createSpace(self, spaceName, disableFileSystem)

 

Creates a new Space. Throws TeamDriveException, if the call fails.

Parameters:
  • spaceName (str) - The Name of the new Space
  • disableFileSystem (bool) - This will disable the synchronization into the file system
Returns: dict
Raises:

deleteSpace(self, spaceId, delInFs, delOnServer)

 

Deletes a Space. Throws TeamDriveException, if the call fails.

Parameters:
  • spaceId (int) - The Id of the Space
  • delInFs (bool) - Delete the Space in the File System
  • delOnServer (bool) - Deletes the Space on the server. (requires Administrator rights)
Returns: dict
Raises:

joinSpace(self, spaceId, disableFileSystem, spacePath=None)

 

Joins an archived Space or rejoins an existing. Throws TeamDriveException, if the call fails.

Parameters:
  • spaceId (int) - The Id of the Space
  • disableFileSystem (bool) - This will disable the synchronization into the file system
  • spacePath (str) - optional Space Root in the file system.spacePath
Returns: dict
Raises:

inviteMember(self, spaceId, addressId, text)

 

Invites a user into a Space. Throws TeamDriveException, if the call fails.

Parameters:
  • spaceId (int) - The Id of the Space
  • addressId (int) - Addressbook Id.
  • text (str) - Invitation Text
Returns: dict
Raises:
  • httplib.HTTPException - a Connection Error.
  • TeamDriveException - Inviting that member failed

quit(self, logout)

 

Quits TeamDrive. Throws TeamDriveException, if the call fails.

Parameters:
  • logout (bool) - Quit and Logout
Returns: dict
Raises:
  • httplib.HTTPException - a Connection Error.

getLoginInformation(self)

 

Returns information about the current user

Returns: dict
Raises:
  • httplib.HTTPException - a Connection Error.

about(self)

 

Returns information about the application.

Returns: dict
Raises:
  • httplib.HTTPException - a Connection Error.

login(self, username, password)

 

Will login a user with a given password. Throws TeamDriveException, if the call fails.

Parameters:
  • username (str) - The Username
  • password (str) - The Password
Returns: dict
Raises:

getFile(self, fileId)

 

Returns information about the given File Id

Parameters:
  • fileId (int) - The File id
Returns: dict
Raises:
  • httplib.HTTPException - a Connection Error.

getFiles(self, spaceId, filePath, trashed)

 

Returns a list of files matching the Space Id, the file path and the trashed flag.

Parameters:
  • spaceId (int) - The Id of the Space
  • filePath (str) - the path of the file in the Space.
  • trashed (bool) - Is the file in the trash?
Returns: list[dict]
Raises:
  • httplib.HTTPException - a Connection Error.

getFolderContent(self, spaceId, filePath, trashed)

 

Returns a list of file Ids in the Space in a folder.

Parameters:
  • spaceId (int) - The Id of the Space
  • filePath (str) - The parent folder path.
  • trashed (bool) - In Trash?
Returns: list[int]
Raises:
  • httplib.HTTPException - a Connection Error.

putFile(self, spaceId, path, data)

 

Uploads a file into a Space. The file creation is done asynchronously, a successful return code does not indicate a successful import.

Parameters:
  • spaceId (int) - The Id of the Space
  • path (str) - the path of the file in the Space.
  • data - The binary data
Returns: dict
Raises:
  • httplib.HTTPException - a Connection Error.

moveFile(self, spaceId, filePath, trashed, newFilePath)

 

Moves a file from filePath to newFilePath in the given Space. Throws TeamDriveException, if the call fails.

Parameters:
  • spaceId (int) - The Id of the Space
  • filePath (str) - the path of the file in the Space.
  • trashed (bool) - Is the file in the trash?
  • newFilePath (str) - The destination file path.
Returns: dict
Raises:
  • httplib.HTTPException - a Connection Error.

getAddressbookIds(self)

 

Returns all knows Addressbook Ids.

Returns: list[int]
Raises:
  • httplib.HTTPException - a Connection Error.

getAddressbook(self, addressId)

 

Returns information about a given Addressbook Id.

Parameters:
  • addressId (int) - the Address Id.
Returns: dict
Raises:
  • httplib.HTTPException - a Connection Error.