.. highlight:: xml
.. index:: delConfig
.. _delConfig:
``delConfig``
-------------
``delConfig`` deletes DataPower objects. Similar to :ref:`export`, it uses regular expression patterns, which match class names and object names, to determine what to delete.
It is often desirable to delete all objects related to a particular DataPower service, e.g., when deleting a Web services proxy, it may be necessary to delete the policy and the rules used by the proxy. You can accomplish this by deleting all objects prefixed with the name of the service, as this is the naming convention used by DataPower when creating services. In case there are dependencies between objects (e.g., a rule might be referenced by a policy and so the policy can be deleted only after the rule is deleted), ``delConfig`` will attempt to run the delete request multiple times until all matching objects are deleted.
Run this command in the "dry-run" mode first to see what objects will be deleted, to avoid deleting items by accident.
You can specify objects to delete using classPattern/namePattern attributes and/or using the nested ``object`` element.
Attributes/Options
^^^^^^^^^^^^^^^^^^
.. list-table ::
:widths: 20 80 8
:header-rows: 1
* - Attribute
- Description
- Required
* - classPattern
- Regular expression defining what classes (types) are to be deleted.
- No
* - namePattern
- Regular expression defining object names to be deleted.
- No
* - quiet
- If set to ``true``, do not fail if no matching object is found.
Defaults to ``false``, meaning that if any of the nested ``object`` elements did not result in a match, an exception will be thrown.
- No
* - dryRun
- If set to ``true``, do not delete anything, just print the matched objects.
Defaults to ``false``.
- No
``object`` Nested Element
^^^^^^^^^^^^^^^^^^^^^^^^^
.. list-table ::
:widths: 20 80 8
:header-rows: 1
* - Attribute
- Description
- Required
* - class
- Regular expression defining what classes (types) to be deleted.
- Yes, unless ``name`` was provided.
* - name
- Regular expression defining object names to be deleted.
- Yes, unless ``class`` was provided.
Examples
^^^^^^^^
This example deletes the Web services proxies with the name starting with "test". If no such proxy exists, the task will complete successfully because of the "quiet" setting.
.. code-block:: bat
dpbuddy delConfig -quiet -classPattern WSGateway -namePattern "test.*"
.. code-block:: xml
You can find more examples under ``samples`` in your distribution or `online `_.