Regex Pattern Searching in RAD in Python
You can also use ERE search capabilities of RAD. The following example shows how to find only zones with name test-0 or test-1.
Example 2-38 Python Language – Using Regex Patterns in RAD
>>> import rad.bindings.com.oracle.solaris.rad.zonemgr as zonemgr >>> import rad.client as radc >>> import rad.connect as radcon >>> with radcon.connect_unix() as rc: ... zonelist = rc.list_objects(zonemgr.Zone(), radc.ADRRegexPattern({"name" : "test-0|test-1"})) ... print zonelist... [Name: com.oracle.solaris.rad.zonemgr:type=Zone,name=test-0,id=-1 Version: (1.0), Name: com.oracle.solaris.rad.zonemgr:type=Zone,name=test-1,id=-1 Version: (1.0)] >>>
The key and the value must be valid EREs as determined by the instance of RAD to which you are connected. The expression is compiled and executed on the server.