Public Member Functions | |
def | __init__ |
def | set |
def | find |
def | findByArgs |
def | findTag |
def | findProperty |
def | getAllTags |
def | getAllProperties |
def | delete |
def | update |
Static Public Attributes | |
connection = None |
The ChannelFinderClient provides a connection object to perform set, update, delete and find operations.
def channelfinder::ChannelFinderClient::ChannelFinderClient::__init__ | ( | self, | ||
BaseURL = None , |
||||
username = None , |
||||
password = None | ||||
) |
BaseURL = the url of the channelfinder service username =
def channelfinder::ChannelFinderClient::ChannelFinderClient::delete | ( | self, | ||
kwds | ||||
) |
Method to delete a channel, property, tag delete(channelName = String) >>> delete(channelName = 'ch1') delete(tagName = String) >>> delete(tagName = 'myTag') # tagName = tag name of the tag to be removed from all channels delete(propertyName = String) >>> delete(propertyName = 'position') # propertyName = property name of property to be removed from all channels delete(tag = Tag ,channelName = String) >>> delete(tag=Tag('myTag','tagOwner'), channelName = 'chName') # delete the tag from the specified channel _chName_ delete(tag = Tag ,channelNames = [String]) >>> delete(tag=Tag('myTag','tagOwner'), channelNames=['ch1','ch2','ch3']) # delete the tag from all the channels specified in the channelNames list delete(property = Property ,channelName = String) >>> delete(property = Property('propName','propOwner') ,channelName = 'chName') # delete the property from the specified channel delete(property = Property ,channelNames = [String]) >>> delete(property = Property('propName','propOwner') ,channelNames = ['ch1','ch2','ch3']) # delete the property from all the channels in the channelNames list
def channelfinder::ChannelFinderClient::ChannelFinderClient::find | ( | self, | ||
kwds | ||||
) |
Method allows you to query for a channel/s based on name, properties, tags find(name = channelNamePattern) >>> find(name='*') >>> find(name='SR:C01*') find(tagName = tagNamePattern) >>> find(tagName = 'myTag') find(property = [(propertyName,propertyValuePattern)]) >>> find(property=[('position','*')]) >>> find(property=[('position','*'),('cell','')]) returns a _list_ of matching Channels special pattern matching char * for multiple char ? for single char Searching with multiple parameters >>> find(name='SR:C01*', tagName = 'myTag', property=[('position','pattern1')]) return all channels with name matching 'SR:C01*' AND with tagName = 'mytag' AND with property 'position' with value matching 'pattern1' For multiValued searches >>> find(name='pattern1,pattern2') will return all the channels which match either pattern1 OR pattern2 >>> find(property=[('propA','pattern1,pattern2')]) will return all the channels which have the property propA and whose values match pattern1 OR pattern2 >>> find(property=[('propA', 'pattern1'),('propB', 'pattern2')]) will return all the channels which have properties _propA_ with value matching _pattern1_ AND _propB_ with value matching _pattern2_ >>> find(tagName='pattern1,pattern2') will return all the channels which have the tags matching pattern1 AND pattern2 To query for the existance of a tag or property use findTag and findProperty.
def channelfinder::ChannelFinderClient::ChannelFinderClient::findProperty | ( | self, | ||
propertyName | ||||
) |
Searches for the _exact_ propertyName and return a single Property object if found
def channelfinder::ChannelFinderClient::ChannelFinderClient::findTag | ( | self, | ||
tagName | ||||
) |
Searches for the _exact_ tagName and returns a single Tag object if found
def channelfinder::ChannelFinderClient::ChannelFinderClient::getAllProperties | ( | self | ) |
return a list of all the Properties present - even the ones not associated w/t any channel
def channelfinder::ChannelFinderClient::ChannelFinderClient::getAllTags | ( | self | ) |
return a list of all the Tags present - even the ones not associated w/t any channel
def channelfinder::ChannelFinderClient::ChannelFinderClient::set | ( | self, | ||
kwds | ||||
) |
method to allow various types of set operations on one or many channels, tags or properties The operation creates a new entry if none exists and destructively replaces existing entries. set(channel = Channel) >>> set(channel=Channel('channelName', 'channelOwner')) set(channels = [Channel]) >>> set(channels=[Channel('chName1','chOwner'),Channel('chName2','chOwner')]) set(tag = Tag) >>> set(tag=Tag('tagName','tagOwner')) set(tags = [Tag]) >>> set(tags=[Tag('tag1','tagOwner'),Tag('tag2','tagOwner')]) set(property = Property ) >>> set(property=Property('propertyName','propertyOwner')) set(properties = [Property]) >>> set(properties=[Property('prop1','propOwner'),'prop2','propOwner']) *** IMP NOTE: Following operation are destructive *** *** if you simply want to append a tag or property use the update operation*** set(tag=Tag, channelName=String) >>> set(tag=Tag('tagName','tagOwner), channelName='chName') # will create/replace specified Tag # and add it to the channel with the name = channelName set(tag=Tag, channelNames=[String]) >>> set (tag=Tag('tagName','tagOwner), channelNames=['ch1','ch2','ch3']) # will create/replace the specified Tag # and add it to the channels with the names specified in channelNames # and delete it from all other channels set(property=Property, channelName=String) >>> set(property=Property('propName','propOwner','propValue'), channelName='channelName') # will create/replace the specified Property # and add it to the channel with the name = channelName set(property=Property, channelNames=[String]) >>> set(property=Property('propName','propOwner','propValue'), channelNames=[String]) # will create/replace the specified Property # and add it to the channels with the names specified in channelNames # and delete it from all other channels
def channelfinder::ChannelFinderClient::ChannelFinderClient::update | ( | self, | ||
kwds | ||||
) |
update(channel = Channel) >>> update(channel = Channel('existingCh', 'chOwner', properties=[ Property('newProp','propOwner','Val'), Property('existingProp','propOwner','newVal')], tags=[Tag('mytag','tagOwner')]) # updates the channel 'existingCh' with the new provided properties and tags # without affecting the other tags and properties of this channel update(property = Property, channelName = String) >>> update(property=Property('propName', 'propOwner', 'propValue'), channelName='ch1') # Add Property to the channel with the name 'ch1' # without affecting the other channels using this property >>>update(property=Property('propName', 'propOwner', 'propValue'), channelNames=['ch1','ch2','ch3']) # Add Property to the channels with the names in the list channelNames # without affecting the other channels using this property update(tag = Tag, channelName = String) >>> update(tag = Tag('myTag','tagOwner'), channelName='chName') # Add tag to channel with name chName # without affecting the other channels using this tag update(tag = Tag, channelNames = [String]) >>> update(tag = Tag('tagName'), channelNames=['ch1','ch2','ch3']) # Add tag to channels with names in the list channeNames # without affecting the other channels using this tag update(property = Property) update(tag = Tag) ## RENAME OPERATIONS ## update(channel = Channel, originalChannelName = String) >>> update(channel = Channel('newChannelName','channelOwner), originalChannelName = 'oldChannelName') # rename the channel 'oldChannelName' to 'newChannelName' update(property = Property, originalPropertyName = String) >>> update(property = Property('newPropertyName','propOwner'), originalPropertyName = 'oldPropertyName') # rename the property 'oldPropertyName' to 'newPropertyName' # the channels with the old property are also updated update(tab = Tag, originalTagName = String) >>> update(tab = Tag('newTagName','tagOwner'), originalTagName = 'oldTagName') # rename the tag 'oldTagName' to 'newTagName' # the channel with the old tag are also updated