User Tools

Site Tools


api:export:externalsystemcsv

ExportAPI: Destination CSV files

This destination creates CSV files from yourCMDB objects in the local filesystem.

Configuration

short information
class name ExternalSystemCsv
required destination parameternone
needed variablesnone

destination parameters

namerequireddescriptionexample
csv_filenameoptionalname of the output CSV file. Default: stdout/tmp/testfile.csv
csv_delimiteroptionalCSV delimiter. Default: “;”;
csv_enclosureoptionalCSV enclosure. Default: '“''”'

variables

Each export variable will define a row in the CSV file. The header of the row is the export variable name.

Examples

example of export task configuration:

csv-example.xml
<task name="csv-example">
    <sources>
        <source objecttype="router" status="A" />
        <source objecttype="switch" status="A" />
    </sources>
    <destination class="ExternalSystemCsv">
        <parameter key="csv_filename" value="/tmp/testexport.csv" />
        <parameter key="csv_delimiter" value=";" />
        <parameter key="csv_enclosure" value="&quot;" />
    </destination>
    <variables>
        <variable name="nodelabel">
            <value objecttype="router" fieldname="hostname" />
            <value objecttype="switch" fieldname="management-ip" />
        </variable>
        <variable name="city">
            <value objecttype="router" fieldname="location" refobjectfield="region.region-name" />
            <value objecttype="switch" fieldname="location" refobjectfield="region.region-name" />
        </variable>
        <variable name="ip">
            <value objecttype="router" fieldname="management-ip" />
            <value objecttype="switch" fieldname="management-ip" />
        </variable>
        <variable name="snmp_community">
            <value objecttype="router" fieldname="snmpCommunity" />
            <value objecttype="switch" fieldname="snmpCommunity" />
        </variable>
        <variable name="snmp_version">
            <value objecttype="router" fieldname="snmpVersion" />
            <value objecttype="switch" fieldname="snmpVersion" />
        </variable>
    </variables>
</task>
api/export/externalsystemcsv.txt · Last modified: 2019/04/08 15:26 by michael