Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetext
vyatta@R1:~$curl~$ curl -k -s -i -u vyatta:vyatta -H “content-length:0” -H “Accept: application/json” -X POST https://10.0.0.232/rest/op/clear/interfaces/dataplane/dp0p1p1/counters

...

Code Block
languagetext
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 226
Date: Thu, 06 May 2019 03:59:30 GMT
Server: lighttpd/1.4.19
{
    "session": [
        {
            "id": "F84307222F469A8A",
            "username": "vyatta",
            "description": "",
            "started": "1273085337",
            "modified": "false",
            "updated": "1273085337"
        }
    ],
    "message": " "
}

Operational mode

...

Operational mode provides the ability to run operational mode commands remotely and display their output. Each command initiates a process that may have a finite life span (for example, show version) or may run indefinitely until explicitly stopped (for example, ping address ).

Commands with finite life spans continue to consume system resources until the client either request that the resources are released (using DELETE ) or it finishes reading the output that is generated by the command. Receiving a response code of 410 (GONE) indicates that the output has been consumed. The output that is not read remains on the system until the next reboot or until the HTTPS service is restarted.

Commands with infinite life spans must be stopped explicitly (using DELETE ). The output is removed when the process is deleted or the output has been completely read.

Info

Operational mode commands that are interactive in nature (for example, add system image) are not supported in the API.

Operational mode requests use rest/op or rest/op/op-id as part of the URI (as opposed to rest/conf or rest/conf/session-id used in configuration mode).

Info

Restarting the HTTPS service invalidates operational session IDs, but does not invalidate configuration session IDs.

You can perform the following tasks:

  • POST /rest/op/<path>

    • Execute an operational mode command.

  • GET /rest/op/<path>

    • Retrieve operational mode parameter definitions.

  • GET /rest/op

    • Display a list of operational mode processes.

  • GET /rest/op/<process-id>

    • Retrieve output.

  • DELETE /rest/op/<process-id>

    • Terminate an operational mode process.