services

how to create a new service:

tba.

AbstractService:

services - module

This module registers all services. if you write a new Service object add the name of your service-module in the __all list as well

AbstractService-Class

class pipeLionServer.services.abstractService.AbstractService(dataBase)[source]

the abstractService class defines in which way a Service will search for requests to define a new Service inherit this service object and name all your request-functions like:

1 | def reguest_YOURREQUESTNAME(self, YOURARGS): 2 | ...
makeRequest(request, **kwargs)[source]

method will call the instance method request_REQUEST(kwargs) in case it cannot find that function it will raise a PipeLionServerException

Parameters:
  • request (string) – name of the request function
  • kwargs (dictionary) – dictionary of arguments, which should be inputted to the instance-method
Returns:

returnValue of request_REQUEST(kwargs) or PipeLionServerException

Return type:

variant object

derived Services:

StandardServices

class pipeLionServer.services.standardServices.StandardServices(dataBase)[source]

StandardServices holds requests which are all about basic dataBase requests like creating tables, adding entries or saving entries

request_getAllProjects()[source]

return the whole project table of a given project

Parameters:project (string) – name of the project
Returns:list of tuples
Return type:list
request_getEntry(project='', id='')[source]

get an entry of a given project table

Parameters:
  • project (string) – name of the project
  • id (string) – dotNotation of the Id which data should be returned
Returns:

list of dictionaries

Return type:

list

request_getProjectTable(name='')[source]

return the whole project table of a given project

Parameters:project (string) – name of the project
Returns:list of tuples
Return type:list
request_getUserEntry(baseId='')[source]

getUserEntry will return a certain entry in the user-table depending on the given baseId

Parameters:baseId (string) – dotNotation of the baseId of the desired user
Returns:list of dictionaries holding all versions of a certain baseId
Return type:list
request_getUserTable()[source]

request will return the user table

Returns:list of tuples
Return type:list
request_insertEntry(project='', tableEntries='')[source]

request to add an entry to the dataBas :param project: name of the project :type project: string :param tableEntries: tuple of six entries: (id, name, type, version, baseId, assetDict) :type tableEntries: tuple

Returns:empty list
Return type:list
request_insertTable(project='', type='')[source]

request will add a table to the dataBase :param project: name of the project :type project: string :param type: type should be either ‘user’ or ‘project’ :type type: string

@return list
empty list
request_insertUserTable()[source]

wrapper around the insertTable request, to create a new user-table

request_projectTableExists(name='')[source]

wrapper around tableExists

Parameters:name (string) – name of the project or if type is ‘user’ name should be ‘user’ as well
Returns:True/False
Return type:bool
request_tableExists(type='', name='')[source]

returnes True or False depending on the existence of a given table

Parameters:
  • type (string) – defines the table type: can only be ‘user’ or ‘project’
  • name (string) – name of the project or if type is ‘user’ name should be ‘user’ as well
Returns:

True/False

Return type:

bool

request_userTableExists()[source]

wrapper around tableExists

Returns:True/False
Return type:bool

IdServices

class pipeLionServer.services.idServices.IdServices(dB)[source]

IdServices holds server requests for generating Ids centrrally. It should be used to generate new unique ids. all id’s will be registred in the __idManager object.

request_addGivenId(id)[source]

use this function to register a new Id :param id: id which will be registred on the server :type id: Id

Returns:returns the registred Id
Return type:Id
request_addIdFromDotNotation(dotNotation, force=False)[source]

this will register an Id from a dotnotation. This function allows it to create double Ids on the server, using the force argument

Parameters:
  • dotNotation (string) – dotnotation of the Id which should be created
  • force (bool) – parameter, which specifies if the creation of the Id should be forced
Returns:

returns the newly registred Id

Return type:

Id

request_allIds()[source]

this request will return a list of all Ids currently registred

Returns:list of all Ids currently registred
Return type:list
request_clearIds()[source]

request removes all registred Ids from the server

Returns:None
Return type:None
request_getIdRange(first=0, last=-1)[source]

request will return all Ids within a certain range. For default it will return all registred Ids

Parameters:
  • first (int) – index number of the first Id which should be returned. default:0
  • last (int) – indx number of the last Id which should be returned. default: -1
Returns:

list of Ids

Return type:

list

request_getLastIds(number=1)[source]

this will return the last x Ids registred. x is given by number.

Parameters:number (int) – number defines how many Ids will be returned
Returns:list of Ids
Return type:list
request_getNewId(project, type)[source]

request returns a new id

Parameters:
  • project (string:) – name of the project the id should be created for
  • type (string) – node-type the id should be created for
Returns:

new unique Id

Return type:

Id

request_latestId()[source]

this request will return the last Id which was registred

Returns:last registred Id
Return type:Id
request_removeId(id)[source]

request removes a given Id from the registred Ids

Parameters:id (Id) – the Id which is to be deleted
Returns:None
Return type:None
request_toDotNotation(id)[source]

return the dotNotation of a given Id

Parameters:id (Id) – the Id, which should be converted
Returns:dotNotation of the given Id
Return type:string

AssetServices

class pipeLionServer.services.assetServices.AssetServices(dataBase)[source]

The AssetServices hold requests about assets like getting all versions of an asset getting a certain asset or getting all assets from a project

request_getActiveAssetsFromProject(project='')[source]

method is a wrapper around the getAllAssetsFromProject request. It filters its return by assets which are the latest or the latest needed.

Parameters:project (string) – name of the project, which should be searched
Returns:list of dictionaries. Filtered return value of getAllAssetsFromProject
Return type:list
request_getAllAssetsFromProject(project='')[source]

similar to the getProjectNodes request, but will return a list dictionaries of all nodes within a project

Parameters:project (string) – name of the project of which all Nodes should be returned
Returns:list of dictionaries
Return type:list
request_getAllVersionsOfAsset(project='', baseId='')[source]

this request will return a list of dictionaries of all Nodes within a given project with the same baseId sorted by the different version numbers.

Parameters:
  • project (string) – name of the project, which should be searched
  • baseId (string) – dotnotation string of the baseId.
Returns:

sorted list of dictionaries, holding all versions of a certain asset.

Return type:

list

request_getLatestVersionOfAsset(project='', baseId='')[source]

this request is a wrapper around the getAllVersionsOfAsset request, and will return the number of the latest existing version of an asset

Parameters:
  • project (string) – name of the project, which should be searched
  • baseId (string) – dotnotation string of the baseId.
Returns:

number of the latest existing version

Return type:

int

request_getProjectNodes(project='')[source]

this service will return a dictionary with all infornation needed to recreate the project-node given by the project arguent.

The dictionary holds keys for:
  1. id
  2. name
  3. type
  4. version
  5. baseId
  6. assetDict
Parameters:project (string) – name of the project which should be returned
Returns:dictionary of the project Node
Return type:dictionary

UserServices

class pipeLionServer.services.userServices.UserServices(dataBase)[source]

UserServices holds requests which are all about Users.

request_allUsers()[source]

request will return all users saved in the database

Returns:list of all Users
Return type:list
request_getAllVersionsOfUser(baseId='')[source]

this request will return a list of dictionaries of all Nodes within a given project with the same baseId sorted by the different version numbers.

Parameters:
  • project (string) – name of the project, which should be searched
  • baseId (string) – dotnotation string of the baseId.
Returns:

sorted list of dictionaries, holding all versions of a certain asset.

Return type:

list

request_getUser(id='')[source]

request will return a certain user, defined by its baseId

Parameters:id (string) – dotNotation baseId of the user who should be returned
Returns:latest version of the user with the given baseId
Return type:dictionary
request_getUserByName(name='')[source]

find a user by its username and return it’s latest version.

Parameters:name (string) – username of the user
Returns:latest version of the user with the given baseId
Return type:dictionary
request_getUserList(listOfIds=None)[source]

request is a wrapper of request_getUser to get multiple users with one request

Parameters:listOfIds (list of string) – list of dotNotations describing the users
Returns:a list of dictionaries holding all information about each user
Return type:list of dictionaries

PluginServices

class pipeLionServer.services.pluginServices.PluginServices(dataBase)[source]

UserServices holds requests which are all about plugins.

request_allAssetTypes()[source]

request will return all asset-plugins with User/Project and Abstract filtered out

Returns:list of all asset-plugins currently installed
Return type:list of strings
request_allConnectionTypes()[source]

request will return all connection-plugins

Returns:list of all connection-plugins currently installed
Return type:list of strings
request_getAssetClass(className='')[source]

request will return the class to the given className. The class must be found in the asset-plugins of the pipeLion

Parameters:className (string) – name of the class, which shoulld be returned
Returns:the class containing to the given className
Return type:class
request_getConnectionClass(className='')[source]

request will return the class to the given className. The class must be found in the connection-plugins of the pipeLion

Parameters:className (string) – name of the class, which shoulld be returned
Returns:the class containing to the given className
Return type:class

Table Of Contents

Previous topic

dataBase - API

Next topic

utils

This Page