.. highlight:: xml .. index:: Selecting DataPower Objects .. _use_of_regexp: Selecting DataPower Objects in DPBuddy Commands =============================================== Many DPBuddy tasks/commands can be applied to multiple DataPower configuration objects. You can see a full list of the configuration objects available in your environment by expanding "Objects" in the DataPower WebGUI. Each object has a "class" (type) and a name. Classes are defined in the :ref:`DataPower XML Management schema `. You can see the list of all classes under the definition of "AnyConfigElement" in "xml-mgmt.xsd". If you look at any DataPower configuration file created using :ref:`export`, child elements of the "configuration" element are class names. DPBuddy allows for using regular expressions to match DataPower objects. For example, :ref:`delConfig` task supports ``namePattern`` and ``classPattern`` options defining what configuration objects to delete. Similarly, the :ref:`export` command's ``objects`` option defines what objects to export. DPBuddy selects objects based on matching class names and/or object names. Only one of the two is required; you can select configuration objects based on just the class name, based on just the object name, or based on both. In the case of :ref:`export`, all objects will be selected if both class and name attributes are omitted. Note that your regular expression needs to match the entire name and not just a substring within a name, so use ".*" where needed. :ref:`assertState`, :ref:`quiesce`, :ref:`export` commands support providing a list of class/name patterns to include (``object`` option) or exclude (``exclude`` option). The list is a comma-delimited list of regexp patterns in the format "class:name, class:name". Class and name could be optional, e.g., "class, class" or ":name". You can also use regular expression to exclude objects. This can be achieved using "negative lookahead" syntax, e.g., ``(?!Crypto).*``. Examples ^^^^^^^^ Match all HTTP front side handlers: .. code-block:: xml Match all objects (irrespective of the class) with the name starting with "Test": .. code-block:: xml Match all HTTP front site handlers whose name starts with "Test": .. code-block:: xml You can use "or" regular expressions if you need to select objects matching multiple classes and/or names. The example below selects all WS proxies and firewalls: .. code-block:: xml Exclude certain classes from export, e.g., exclude all Crypto objects: .. code-block:: bat dpbuddy export -file all-objects.xml -objects ".*" -exclude "Crypto.*"