Import and Export the Configuration

You can import and export the ESBC configuration to and from a Comma Separated Value (CSV) file with the Import Export SPL plug-in. The Import Export SPL plug-in is enabled by default. No configuration is required.

Import and Export Restrictions

The list describes the restrictions that the system enforces when importing and exporting the ESBC configuration.
  • Import and export occurs to and from the editing configuration.
  • The system displays all error messages on the screen where the command was issued and provides line numbers with the error, when possible.
  • The system does not allow you to set objects and attributes to inappropriate values. For example, you cannot set an IP address to "enabled". Parsing continues as normal after this error.
  • If the system cannot write an object, for example, when the key field is missing, the system discards the object and parsing continues as normal.
  • The import is additive. Each object that is imported is expected to be new to the configuration. If there is already an object with the same key present, the system generates the 409 error and discards the object. Parsing continues as normal after the error.
Importing and exporting is done to the /code/configcsv directory, which does not exist by default on a new installation. Create the /code/configcsv directory in one of two ways:
  • As the admin user, SFTP to the ESBC and use the mkdir command.
    $ sftp admin@10.0.0.3
    Connected to admin@10.0.0.3.
    sftp> cd /code/
    sftp> mkdir configcsv
    sftp> exit
  • Create a backup of the current configuration.
    ORACLE# spl save acli config-csv backupConfig.csv
    File written to /code//configcsv/backupConfig.csv

Configuration CSV Files

The ESBC import feature uses the import and export SPL plug-in. You must use a spreadsheet application, such as MS-Excel, that supports .csv files.

The following rules apply when entering configuration data into the .csv file.
  • Empty lines are ignored
  • The first non-empty line must be the keyword “object:”, followed by the configuration object name that is being configured (shown below as sip-interface).
    object:sip-interface
  • The second non-empty line must be the parameter names of the objects to be configured, each parameter name in its own column. This row defines the labels for each column for the subsequent rows. Only the attributes that you want defined need to be present. You can specify the parameter names in any order, but the data in subsequent rows must be consistent with the labels that you define in this row.
    state,realm-id,description
  • The third non-empty rows define values for the configuration object, each instance in its own column. In the following example, the third line defines a new sip-interface with state “enabled”, realm-id “public”, and description “public SIP interface”. These values are based on the labels defined in the second row.
    enabled,public,public SIP interface

    Note:

    The Description field displays all text as one continuous line, unless you insert line breaks. When you want to insert line breaks in the Description field, for example between sentences that you want displayed on separate lines, do the following:
    • From the GUI, in the Description field of a Configuration object, add Line1 to the end of the line where you want the first break to occur. Add Line2 to the end of the next line where you want a break to occur, and so on.
    • In a .csv configuration file, add \010 to the end of the line where you want the first break to occur. Add \010 to the end of the next line where you want a break to occur.
  • On all subsequent rows, you can define any number of instances.
  • The next row with an “object” keyword selects a new configuration object that is based on the previous object. You continue to input the data for this object according to the rules stated above. The following example shows a “sip-port” object added that is related to the sip-interface object.
    object:sip-port
    address,port,transport-protocol 
    192.168.1.1,5060,UDP 
    192.168.1.1,5061,TCP 
    In this example, “sip-port” is a sub-object of “sip-interface” and would create new sip-ports off of the last sip-interface instance (of realm-id public).

Create a CSV File

To create a Oracle® Enterprise Session Border Controller (ESBC) configuration using a CSV file:

  1. Open an application that supports a CSV file, for example, MS-Excel.
  2. In the first row, first column, enter object: followed by a configuration object that you want to import.
    object:sip-interface
  3. In the second row, and each in its own column, enter the parameter names of the objects to configure.
    state,realm-id,description
  4. In the third row, and each in its own column, enter the values for the configuration objects.
    enabled,public,public SIP interface
  5. In subsequent rows, define additional values, if any.
  6. In the next empty row, first column, enter another object if required, related to the first object (sip-interface).
    object:sip-port
  7. Repeat steps 3 through 5 for this object. The following is an example of a CSV file containing the “sip-interface” and sip-port objects.
    This image shows an example of a CSV file containing the sip-interface and sip-port objects.
  8. Save the file as a comma-separated value file (.csv). For example, esd-config.csv.
  9. Close the file.

Enter Configuration Data Using a Text File

You can create a configuration by entering the required data into a text file and then use an application, such as Excel, to open and save the file as a CSV file. You must enter the information in the text file in the exact format as shown in the following example so that the labels to go to the correct columns in the Excel application.

This image shows an example CSV file with the labels go to the correct columns in the Excel application.
Procedure
  1. Enter the required configuration data in a text file according to the format in the previous illustration.
  2. Save and close the file.
  3. Open an application that supports a CSV file, for example, MS-Excel.
  4. Browse for the SPL text file and open it. The configuration data opens in the correct columns within the application.
    This screenshot shows an example SPL text file.
  5. Save the file as a comma-separated value file (.csv). For example, esd-config.csv.
  6. Close the file.

Import a CSV Configuration File

After you create a CSV file that contains the ESBC configuration, you can import the file into the ESBC using the spl load acli config-csv command.

If you want to delete your current configuration and load only the contents of your CSV file, use delete-config cached, save, and activate to clear the current and editing configuration on the ESBC. Otherwise, the imported CSV configuration file will adds to the current editing configuration.
The spl load acli config-csv command loads the CSV file from the /code/configcsv directory into the editing configuration of the ESBC.
spl load acli config-csv <filename>
  1. From the ACLI, create a backup of the current editing configuration.
    backup-config backupEditingConfig editing
  2. SFTP the CSV file to the /code/configcsv directory on the ESBC.
    If this directory does not exist, create it with the comand mkdir /code/configcsv.
  3. Load the configuration file with the spl load acli config-csv <filename> command.
    ORACLE# spl load acli config-csv esd-config.csv

    The ESBC imports the CSV file containing the configuration you specified into the editing configuration.

  4. Save and activate the configuration.

Note:

If you need to undo the import, you can restore the editing configuration with the following command:
restore-backup-config backupEditingConfig.gz

Export a Configuration to a CSV File

You can export an existing configuration from the ESBC to a CSV file that you name, using the following command:

spl save acli config-csv <filename>

The ESBC saves the configuration in the /code/configcsv directory.