Full CLI Script
The /files/cliScript URL provides the ability to upload or download a CLI configuration script. Uploading of a CLI script triggers device reset to activate the new configuration. Use /files/cliScript/incremental (see Incremental INI File) to apply a partial configuration that doesn’t require device reset.
The full CLI script completely overrides the current device configuration in the same manner as the copy startup-script from CLI command. The provided script must contain configuration commands only and is typically generated by the show running-config command. If you need to run show commands or update device configuration, use the incremental CLI script instead, as described in Incremental CLI Script.
URL
/api/v1/files/cliScript
HTTP Methods
GET, PUT
HTTP Responses
■ | 200 OK |
■ | 400 Bad request - provided CLI script is incorrect. |
■ | 409 Conflict – CLI script can’t be loaded due to the current device state (e.g. synchronization with the redundant device is in progress). |
Example
■ | Request: |
GET /api/v1/files/cliScript HTTP/1.1 Host: 10.4.219.229
■ | Response: |
HTTP/1.1 200 OK Content-Type: application/octet-stream <CLI script>
Example
■ | Request: |
PUT /api/v1/files/ini/incremental HTTP/1.1 Host: 10.4.219.229 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="cli.txt" Content-Type: application/octet-stream <INI File> ------WebKitFormBoundary7MA4YWxkTrZu0gW--
■ | Response: |
HTTP/1.1 200 OK Content-Type: application/json { "description": "Device will reset now to activate new configuration" }
or
HTTP/1.1 409 Conflict Content-Type: application/json { "description": "Device is currently performing HA synchronization" }
The uploaded file gets transformed by the device; therefore the file content will differ when you download it.