Importing & Exporting Tables

Table-based Import/Export

The table-based functions of the InterMapper HTTP API match the capabilities of the Import -> Data file... and Export -> Data file... commands of InterMapper RemoteAccess (available from the File menu). These import and export a number of "tables" of information about the devices being monitored. These tables include:

These tables have detailed descriptions in the Advanced Data Import/Export section of the InterMapper User Guide. The URLs for importing and exporting have the following format:

http://imserver:port/~export/tablename.format? (options)

Supported formats are:

The primary option is "fields=...." The list of valid fields are listed in the "schema" export. For example, this query:

http://imserver:port/~export/schema.html

provides a list of the supported tables and the fields for each table in an HTML format that you can view right in the browser. Other examples include:

http://imserver:port/~export/devices.tab

provides a list of all devices on active maps as a tab-delimited file. This URL:

http://imserver:port/~export/devices.tab?fields=id,name,macadress,address

provides a list of all devices on active maps, but only includes the ID, Name, MACAddress and Address fields.

Importing Table-based Data

An external program can also import table information with an HTTP POST operation by including the table data as the payload.

http://imserver:port/~import/filename

The filename in this URL is written to the log file, but is otherwise ignored. It is not used to determine the data to import, nor is it used to specify where the data goes. InterMapper examines the directive line of the attached file to determine what information is imported from the file. It follows the same logic that is used when importing data using the Import->Data File... command available from InterMapper RemoteAccess's File menu.

A sample curl command line to import map data should take this form:

$  curl --user admin:Pa55w0rd --data-binary @/path/to/import/file http://imserver:port/~import/file