English

Importing Annotations

Contributors netapp-alavoie Download PDF of this topic

Cloud Insights includes an API for importing annotations or applications from a CSV file, and assigning them to objects you specify.

The Cloud Insights API is available in Cloud Insights Premium Edition.

Importing

The Admin > API Access links contain documentation for the Assets/Import API. This documentation contains information on the .CSV file format.

Import API

.CSV File Format

The general format of the CSV file is as follows. The first line of the file defines the import fields and specifies the order of the fields. This is followed by separate lines for each annotation or application. You do not need to define every field. However, the subsequent annotation lines must follow the same order as the definition line.

[Object Type] , [Object Name or ID] , Annotation Type [, Annotation Type,  ...] [, Application] [, Tenant] [, Line_Of_Business] [, Business_Unit] [, Project]

See the API Documentation for examples of .CSV files.

You can import and assign annotations from a .CSV file from within the API swagger itself. Simply choose the file to use and click the Execute button:

Import and Assign

Import Behavior

During the import operation, data is added, merged, or replaced, depending on the objects and object types that are being imported. While importing, keep in mind the following behaviors.

  • Adds an annotation or application if none exists with the same name in the target system.

  • Merges an annotation if the annotation type is a list, and an annotation with the same name exists in the target system.

  • Replaces an annotation if the annotation type is anything other than a list, and an annotation with the same name exists in the target system.

    Note: If an annotation with the same name but with a different type exists in the target system, the import fails. If objects depend on the failed annotation, those objects may show incorrect or unwanted information. You must check all annotation dependencies after the import operation is complete.

  • If an annotation value is empty then that annotation is removed from the object. Inherited annotations are not affected.

  • Date type annotation values must be passed in as unix time in milliseconds.

  • When annotating volumes or internal volumes, the object name is a combination of storage name and volume name using the "->" separator. For example: <Storage Name>-><Volume Name>

  • If an object name contains a comma, the whole name must be in double quotes. For example: "NetApp1,NetApp2"->023F

  • When attaching annotating to storages, switches, and ports, the 'Application' column will be ignored.

  • Tenant, Line_Of_Business, Business_Unit, and/or Project makes a business entity. As with all business entities, any of the values can be empty.

The following object types can be annotated.

OBJECT TYPE

NAME OR KEY

Host

id-><id> or <Name> or <IP>

VM

id-><id> or <Name>

StoragePool

id-><id> or <Storage Name>-><Storage Pool Name>

InternalVolume

id-><id> or <Storage Name>-><Internal Volume Name>

Volume

id-><id> or <Storage Name>-><Volume Name>

Storage

id-><id> or <Name> or <IP>

Switch

id-><id> or <Name> or <IP>

Port

id-><id> or <WWN>

Qtree

id-><id> or <Storage Name>-><Internal Volume Name>-><Qtree Name>

Share

id-><id> or <Storage Name>-><Internal Volume Name>-><Share Name>-><Protocol>[-><Qtree Name (optional in case of default Qtree)>]