Saving and Resetting FlexSwitch Configurations

Use the following instructions to save, reset, your FlexSwtich configurations and clear Configuration Logs.

The Configuration commands are found in the CLI, enable mode command list. Use the reset and save command to access these functions.

Saving Your Configuration

Saving with Defaults

To save your FlexSwitch Configuration in the default location (///opt/flexswitch/startup-config) follow the example below. In this example we are accepting all the defaults.

Command:

FlexSwitch#save config

Response

Applying action:
id: 1   object: SaveConfig   status: APPLIED CONFIG  valid: True delete: False num user cmds: 0
 command    attr    value    model attr    iskey    required    userprov    time provisioned
--------------------------------------

sdk:executeSaveConfig(,Nonce=,Passphrase=,DstFileURI=///opt/flexswitch/startup-config,Timeout=30,RetryCount=3,Timestamp=disabled) result: SUCCESS: http status code: 200

Saving with Options

You have the option to save your configuration to an external server

Resetting Your Configuration

default

Using the default options brings your FlexSwitch back to factory default settings.

toFile

Using the toFile option applys a configuration stored in a file located either locally on the switch or from a file stored externally.

Clearing your Configuration Log

The Clear Configuration Log function is only available using REST.

See the REST User's Guide and the Local Objects Reference for more information.

Viewing your Configuration Log

You can view upto 1000 of your last configuration operations using the REST Interface with a state request to the ConfigLogState object.

See the REST User's Guide](../configuration_guides/rest_ref.md) and the Local Objects Reference for more information.

Example

Request:

root@FlexSwitch:/# curl -X GET http://localhost:8080/public/v1/state/configlogs | python json.tool

Response:

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 33496    0 33496    0     0   633k      0 --:--:-- --:--:-- --:--:--  641k
{
    "CurrentMarker": 0,
    "MoreExist": false,
    "NextMarker": 0,
    "ObjCount": 119,
    "Objects": [
        {
            "Object": {
                "API": "saveconfig",
                "Data": "{Nonce: , Passphrase: , Timestamp: disabled, DstFileURI: ///opt/flexswitch/startup-config, Timeout: 30, RetryCount: 3}",
                "Operation": "POST",
                "Result": "Success",
                "SeqNum": 119,
                "Time": "2017-09-15 07:54:58.567841424 -0700 PDT",
                "UserAddr": "127.0.0.1:40216",
                "UserName": ""
            },
            "ObjectId": ""
        },
        .
        .
        .
        .
        {
            "Object": {
                "API": "user",
                "Data": "{Access: CLI, Password: , Name: exampleuser, DefaultShell: CLI}",
                "Operation": "POST",
                "Result": "Success",
                "SeqNum": 1,
                "Time": "2017-08-15 12:54:36.624395141 -0700 PDT",
                "UserAddr": "127.0.0.1:60688",
                "UserName": ""
            },
            "ObjectId": ""
        }
    ]
}