Importing & Exporting Files

Most of the files in the InterMapper_Settings folder can be accessed through the HTTP API. These include:

These folder contents may be exported, but not imported:

The contents of the following folders are not currently available:

All other files are served up as binary files with a MIME type of application/octet-stream. Each file has a corresponding URL to retrieve its contents; each folder in InterMapper_Settings also has a URL to retrieve the list of URLs for the files in that folder.

All URLs given below are relative to a URL composed of the InterMapper Server address and the webport, as defined in the server settings. For example, in the following discussion a URL of /~files would imply the full URL (either http: or https:):

http://imserver_address:webport/~files  
        

Example: The URL above produces a text listing the URLs for the folders in the InterMapper_Settings that can be accessed over HTTP; this is provided for the convenience of scripts that might want to access all files.

A request for following URLs provides a text listing of the URLs for the files within the corresponding folder in the InterMapper_Settings folder.

InterMapper_Settings folder Corresponding URL
Custom Icons /~files/icons
Extensions /~files/extensions
Fonts /~files/fonts
Maps /~files/maps
MIB Files /~files/mibs
Probes /~files/probes
Sounds /~files/sounds
Tools /~files/tools
Web Pages /~files/webpages

 

HTTP file imports

To import these files over HTTP, issue a POST request to the appropriate URL with the file contents as a payload; the MIME type should be application/octet-stream.

Icons

You can import icons via HTTP as described above. The URL should take the following form:

http://imserver:port/~files/icons/Folder/Filename.type

If the file type is a valid image file (jpeg or png), it will be available to use immediately.

A sample curl command line to use this facility should look like this (should be all on one line):

curl --data-binary  @/path/to/sample.png http://localhost:8080/~files/icons/Default/sample.png

Note about replacing icon files: If you import an icon file with the same name as an existing file, the new file is renamed to prevent overwriting the original file. InterMapper adds ".1", ".2", etc. as a filename extension, which may not be recognized as an image file.

Maps

You can import maps or map data using the HTTP API.

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

$ curl --user admin:Pa55w0rd --data-binary @/path/to/local/map_file http://imserver:port/~files/maps/map_file