tw_tax_import
The tw_tax_import
utility enables you to import custom taxonomy files into the current taxonomy.
Recommendation
After you run a taxonomy import using this utility, you must restart the tideway service. Failure to do so will result in a malfunctioning user interface.
Taxonomy definitions are configured using .xml files that are stored in the following directories:
/usr/tideway/data/installed/taxonomy/
/usr/tideway/data/custom/taxonomy/
The directories are parsed in the order shown (installed files take precedence over custom files), and the files contained in these directories are parsed in alphabetical order (numbers before letters). This order is important, because any taxonomy definitions that are subsquently added override any previously loaded definitions. The standard base taxonomy file is contained in /usr/tideway/data/installed/taxonomy/00taxonomy.xml
.
There are advanced ways that the taxonomy can be updated, however you should follow these guidelines:
Create custom files with a sensible naming convention, for example
001myextensionname.xml
so that they are loaded in the correct order.- Remember to add a
<mode>merge</mode>
tag in your extension file. - Load all files using the following command:
tw_tax_import --clear
For power users a full set of options is shown below.
Command Line Option | Description |
---|---|
| Specifies to clear any existing taxonomy before importing |
| Specifies to ignore any broken extensions. If a taxonomy extension is invalid, the importer ignores it and restarts, attempting to load all other extensions. It repeats this until it has loaded the base taxonomy and has loaded or attempted to load all extensions. In this way you always finish with a valid taxonomy. Where the taxonomy importer fails to load an extension it logs a message to stdout. This option cannot be used with the files command. It is primarily intended for upgrading, but it can be used from the command line. |
| (Do Not Use) Specifies the name of the datastore service |
| Specifies to merge import data with any existing taxonomy (for advanced use, reloading all with --clear is recommended) |
| Specifies the name of the datastore partition |
| Specifies to replace data in any existing taxonomy with imported data |
| Specifies that there is no backwards compatibility for the previous format |
| (Do Not Use) Specifies the name of the taxonomy service |
| Specifies the name of the BMC Discovery user. If no user is specified, BMC Discovery uses the default, system. |
| Specifies to display informational messages |
| Specifies to verify XML data only |
User example
In the following example, type the commands on a single line. Line breaks are provided to make the example easier to read.
Importing customized taxonomy definitions
The following example illustrates how to import a custom taxonomy file and merge the imported data into the existing taxonomy.
You need to define the attributes to show in a taxonomy extension, for example:
<?xml version="1.0"?> <taxonomy> <mode>merge</mode> <node kind="BusinessApplicationInstance" super="ManagedElement"> <attr_list type="summary" mode="after"> <field name="product_version" type="attr" /> <field name="release" type="attr" /> </attr_list> </node> </taxonomy>
- which adds 'release' after 'product_version'.
Save this in an extension, for example,
/usr/tideway/data/custom/taxonomy/01baisummary.xml
and you can import all the taxonomy using:$ tw_tax_import --clear
tw_tax_import reports errors if there are invalid tags or references to undefined attributes.
To see the change reflected in the UI, you must restart at least restart the appserver:
$ sudo /sbin/service tideway restart appserver
Comments
Log in or register to comment.