• Loading...
This documentation refers to a previously released version of BMC Atrium Discovery (other versions).

Importing CSV Data

Skip to end of metadata
Go to start of metadata
Space Search

Searching TWF 7.3

Table of Contents

It is often very easy to extract information from applications and devices and store it as CSV data. Data can be exported from Tideway Foundation in this format, see the CSV API for more information. You can also import CSV data into Tideway Foundation, for example you may have information on a number of hosts that you want to import.

You can import a CSV file using the Import CSV Data page which is described below. Alternatively, if you have command line access, you can use the CSV import script.

Importing a CSV File

To import a CSV Data File:

  1. From the Model section of the Administration tab, select CSV Import. The Import CSV Data page is displayed. The figure below shows the Import CSV Data page with the Host Container node kind selected.

    The options on this page are described below:
    Field Name Details
    File To Upload The file to upload. Click the Browse... button to display a file browser window. Select the file to import and click Open.
    Update Mode Select the mode to use for updates. Choose one of the following from the drop down list:
    • Create And Update - nodes are created and updated as required.
    • Create Only – new nodes are created, existing nodes are not updated.
    • Update Only – new nodes are NOT created, existing nodes are updated.
    • Delete Only – nodes with match are deleted. No other nodes will be created or updated.
    Node Kind Choose the type of node to import from the drop down list. This may be one of any node kind defined in the taxonomy. Changing the node kind updates the Keys field dynamically.
    Keys Choose the key or keys for each entry. You must select at least one key. The taxonomy defined keys are marked with a red asterisk *. Use the checkboxes if you want to use other keys. The following quick selection links are provided at the top of the keys field:
    • Key Attributes – selects just the taxonomy defined keys.
    • None – clears any selection.
      Behaviour different to CSV import script
      The CSV import script uses the first column of the input file as the key unless others are specified. When controlling an import using the UI Import page, only the keys that are selected are used.
    Logging Level Choose the logging level from the drop-down list. This may be Debug, Info, Warning, Error, or Critical.
  2. Click Apply to import the CSV file.

See CSV Import Examples for example of using the CSV importer.

Notes on the CSV Importer

File Format

The CSV file represents a two dimensional table with rows separated by newlines, and columns separated by commas. Commas may be included in that data but must be enclosed between double quote characters.

Column names that do not begin with a hash character (#) are treated as names of attributes on the node.

Column names that begin with a hash character are treated as key expressions. Key expressions are used to create or update a relationship to another node. See Relationships for more information.

Keys

The CSV importer searches the data store for nodes of a specified kind which have a key or keys matching rows in the supplied csv data. Where the keys match, the node is updated, or deleted and recreated depending on the options selected. The first attribute column is used as a key by default. This can be overridden with the Keys option described in the table above.

Relationships

Relationship columns describe a relationship between the node being modified and one or more other nodes. Relationships are defined using a full key expression. The first example shows a link to a single node:

#role:relationship:role:kind.attribute

This example shows a link to multiple target nodes:

#role:relationship:role:kind.attribute,attribute,attribute

The first role part is the kind of the role that the node being created or updated plays in the relationship. The relationship part is the kind of the relationship being created. The second role part is the kind of role that the other node plays in the relationship. The kind part is the node kind of the other node. Finally, the attribute or attribute list is the name of the attribute used to find the other node. See the Node Lifecycle Document for information on relationships.

Only a single traversal is supported.

Type Conversion

By default, the csv importer attempts to convert attribute values to the type defined in the taxonomy. If an attribute is not defined, it is left as a string. If a conversion fails, it is also left as a string.

For list types, the value in the CSV file must be in Python list syntax.

When the CSV Import Script is used with the --force option, all attributes are left as strings.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.