Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: iso-8859-1 -*-
- # Import standard Python libraries
- import logging
- from exceptions import Exception
- # Third party libraries.
- try:
- from ladon.ladonizer import ladonize
- from ladon.types.ladontype import LadonType,attachment
- from ladon.exceptions.service import ServiceFault
- from ladon.compat import PORTABLE_STRING
- except ImportError,e:
- logging.exception(e)
- raise
- class TSSFault(ServiceFault):
- def __init__(self,faultstring,detail=None,stack_depth=2):
- super(ServerFault,self).__init__('TSS',faultstring,detail,stack_depth)
- class statusItem(LadonType):
- host = PORTABLE_STRING
- tid = int
- nonce = PORTABLE_STRING
- oid = PORTABLE_STRING
- state = PORTABLE_STRING
- extra = PORTABLE_STRING
- flags = int
- ipAddr = PORTABLE_STRING
- class retrieveItem(LadonType):
- nonce = PORTABLE_STRING
- result = PORTABLE_STRING
- object = attachment
- class storeItem(LadonType):
- nonce = PORTABLE_STRING
- oid = PORTABLE_STRING
- class findItem(LadonType):
- host = PORTABLE_STRING
- speed = int
- tids = [ int ]
- class searchItem(LadonType):
- tid = int
- oid = PORTABLE_STRING
- match = PORTABLE_STRING
- class metaItem(LadonType):
- item = PORTABLE_STRING
- value = PORTABLE_STRING
- class keyword(LadonType):
- key = PORTABLE_STRING
- value = PORTABLE_STRING
- class TSSClass(object):
- """
- The class that makes the SOAP services for the TSS
- """
- @ladonize(rtype=PORTABLE_STRING)
- def shutdown(self):
- """ Shutdown the system, gracefully"""
- # Shutdown the soap server.
- pass
- @ladonize(rtype=PORTABLE_STRING)
- def version(self):
- """ Return the version of the system."""
- pass
- @ladonize(int,PORTABLE_STRING,rtype=PORTABLE_STRING)
- def removeObject(self,tid,oid):
- """ Force the end-of-life indicator for the object (tid,OID) to be tomorrow."""
- pass
- @ladonize([int],PORTABLE_STRING,rtype = findItem)
- def findObjects(self,ListOfTids,oid):
- """ Find all the tenants from a list of tenants that have a particular OID."""
- pass
- @ladonize(int,PORTABLE_STRING,rtype = PORTABLE_STRING)
- def getStorageMap(self,tid,oid):
- """ Return the storage map for a particular (tid,oid)."""
- pass
- @ladonize(int,[PORTABLE_STRING],rtype = [statusItem])
- def status(self,tid,ListOfNonces):
- """ Return status information for tenant, tid, for a list of nonces.
- The nonce names can be wildcarded using regexp patterns."""
- pass
- @ladonize(PORTABLE_STRING,int,PORTABLE_STRING,PORTABLE_STRING,PORTABLE_STRING,rtype = retrieveItem)
- def retrieveObject(self,Nonce,tid,oid,How,ipaddr):
- """ Return the contents of object (tid,OID), returning the data How."""
- pass
- @ladonize([int],PORTABLE_STRING,PORTABLE_STRING,rtype = [searchItem])
- def searchObject(self,ListOfTids,oid,searchString):
- """Search the system looking for a specific object in which the
- search string matches."""
- pass
- @ladonize(int,int,[int], rtype = [metaItem])
- def searchMetadata(self,tid,oid,whatList):
- """ Return the metadata, in whatList, for object (tid,OID)."""
- pass
- @ladonize(int,PORTABLE_STRING,[metaItem],rtype=str)
- def addMetadata(self,tid,oid,metaArray):
- """ Add metaadata to an object's space. """
- pass
- @ladonize(int,PORTABLE_STRING,rtype=PORTABLE_STRING)
- def indexObject(self,tid,oid):
- """Index the contents of a file, which must be in the system."""
- pass
- @ladonize(PORTABLE_STRING,int,PORTABLE_STRING,PORTABLE_STRING,[int],[PORTABLE_STRING],
- [PORTABLE_STRING],attachment,PORTABLE_STRING,PORTABLE_STRING,rtype=storeItem)
- def storeObject(self,Nonce,tid,oid,HashRef,equivTidList,HomePeers,StorePeers,ObjectData,eol,ipaddr):
- """Store an object in the repository"""
- pass
- @ladonize(PORTABLE_STRING,int,PORTABLE_STRING,[int], [int],PORTABLE_STRING,PORTABLE_STRING,PORTABLE_STRING,rtype=storeItem)
- def storeRef(self,Nonce,tid,oid,HomePeers,StorePeers,RefData,eol,ipaddr):
- """Store an reference to something in the repository"""
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement