This documentation supports the 21.05 (12.2) version of BMC Discovery.To view an earlier version of the product, select the version from the Product version menu.

Importing data into the system


The REST API provides the POST /data/import endpoint as a simple way of importing data into the system from data providers. The resulting ImportRecord nodes are managed and lifecycled by the system. For more general-purpose data manipulation, see Writing and modifying data in the system.

POST /data/import

{
"source": "Source name",
"type":   "Import type",
"items": [
{
"kind": "Example",// optional CamelCase kind
"id": "1234",// optional id
"data": {
"attr_one": "value1",
"attr_two": 2,
...
}
},
{
       "kind": "Example",
"data": {
...
}
},
{// this one has no kind, so it defaults to "Item"
"data" {
"attr1": "value1",
"attr2": "value2"
}
},
],
"uuid": "uuid",
"complete": false
}


If importing multiple batches for one logical import, set complete to false on all batches before the last, then set complete to true on the last batch. The batches are linked by the uuid. The caller may choose its own uuid, in which case it must be truly globally unique. If the caller does not specify a uuid, the system generates one for it. The API call returns the uuid, so the caller can use it for subsequent batches.

kind field

The kind field is useful to distinguish multiple types of data coming from a single data source. It is not a fine-grained classification of the contents of the data, or a direct indication of the expected node kinds once the data is unified with that from other sources. For example, if a source knows about "CIs" and "Relationships", the kinds should be "CI" and "Relationship", and not a further sub-classification.

The kind is used as the node kind within the datastore, with the prefix "Imported". For example, if the kind is "CI", then the nodes will be "ImportedCI". The naming conventions for BMC Discovery node kinds are CamelCase with leading capital letter and no underscores. Data sources should adhere to that naming convention.

Data Model

POSTdataimport.png

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*