This module contains PropertyObject implementation.
There is no need to import this module directly. Use the methods of the Ruleset object to create and manipulate PropertyObjects.
>>> o = r.object_add("/PropertyObjects/Test") >>> o.add("Filename=/index.html") >>> print o.items ['Filename=/index.html']
PropertyObject Implementation
Object path: /PropertyObjects
Methods: | ||
---|---|---|
Ungrouped | add(self, value) Add a PropertyObject Item to this PropertyObject |
|
Inherited from PLObject | move(self, newparent) Moves a object to somewhere else in the tree |
|
remove(self, item) Removes an Item from this Object |
||
remove_id(self, id) Removes an Item from this Object by its idnumber |
||
rename(self, newname) Rename the current object |
||
set_visible(self, visible) Set or reset the visible flag on the current object |
Class Variables: | |
---|---|
Item | PropertyObject Item implementation. |
Static Methods: | |
---|---|
cipher2value(key, cipher) Inverse of value2cipher |
|
value2cipher(key, value) Encrypts the property value |
Properties: | |
---|---|
attributes | Arbitrary key/value attributes stored for this object |
base_path | Only the type portion of the path |
creation_date | Date and time when this object was created |
creator | Username that created this object |
fullpath | Complete path including name of object |
id | Database id of object |
is_global | True if this is object is not from the local system |
items | List of items associated with this object |
machineid | Deprecated method to access 'systemid' |
modification_date | Date and time when this object was last modified |
modified | Deprecated method to access 'modification_date' |
modified_by | Username that last modified this object |
name | Name of the object |
parent | id of parent object (or zero) |
path | Complete path to where the object is excluding the object name |
systemid | System ID of the PacketLogic this object belongs to |
type | Number representing the type of object |
visible | True if the object is visible in the GUI |
Add a PropertyObject Item to this PropertyObject
str
) - A string that describes the value of the PropertyObject item. Should be
formatted as property=value
Wildcards are allowed in value:
Wildcard-characters can be escaped using \ to match the literal character.
Moves a object to somewhere else in the tree
destroys the cache
str
) - a path where the new object should reside. Must start with the same
objecttype. I.e. you can't move a NetObject to VlanIdObject.
Removes an Item from this Object
str
) - Either you send in the Item class there or you send a string with the
value. The first Item that matches will be removed.
item
argument can also be an integer specifying the id
number of the item to be removed. This is usage deprecated, instead use the
remove_id method.
Removes an Item from this Object by its idnumber.
>>> i=o.add(7) >>> o.remove_id(i.id)
int
) - ID-number of the item to remove
Rename the current object
destroys netobject cache
str
) - The name that the object should have after rename process
Set or reset the visible flag on the current object.
bool
) - True or False value for the flag.
Inverse of value2cipher
Encrypts the property value. Can for example be used when filtering sensitive URLs.
You need to add the key to Realtime. Example:
>>> pl = packetlogic2.connect(...) >>> rt = pl.Realtime() >>> rt.keyvault.set(1, "password")
This will add the key "password" as key index 1.
You need to set the encrypted attribute to the key index it was encrypted with on the PropertyObject holding the encrypted PropertyObject Items:
>>> rs = pl.Ruleset() >>> o = rs.object_find("/PropertyObject/EncryptedExample" >>> o.attributes['encrypted'] = "1"
Example where an url is encrypted and added:
>>> url = "http://www.example.com/page.html" >>> cipher = o.value2cipher("password", url) >>> o.add("URL=" + cipher)
Arbitrary key/value attributes stored for this object.
Attributes stored on objects doesn't affect ruleset evaluation, and are designed to be used by integrations to assign integration specific data to objects. The client does special handling for some attributes, such as "hidden" and "automatic".
>>> o.attributes {} >>> o.attributes['test'] = "Arbitrary string value" >>> o.attributes {'test': "Arbitrary string value"}
Only the type portion of the path
Date and time when this object was created
Username that created this object
Complete path including name of object
Database id of object.
The unique (for this object type) id number used to refer to the object in rule conditions.
True if this is object is not from the local system
List of items associated with this object
Deprecated method to access 'systemid'.
Date and time when this object was last modified
Deprecated method to access 'modification_date'.
Username that last modified this object
id of parent object (or zero)
Complete path to where the object is excluding the object name.
System ID of the PacketLogic this object belongs to
Number representing the type of object
True if the object is visible in the GUI