RESTCONF API
RESTCONF provides a programmatic interface for reading and writing network device configurations through NSO. Platform workflows interact with the NSO RESTCONF API using the restAction task.
NSO RESTCONF support
NSO also supports JSON-RPC and NETCONF. See Cisco NSO developer documentation for Swagger API documentation and additional protocol references.
HTTP methods
Method values are case-insensitive.
The restAction task
Use the restAction task in a workflow to make RESTCONF calls to NSO. The task handles authentication and connection routing through the configured NSO adapter.
Incoming variables
Outgoing variables
params object
Examples
The following examples show complete restAction variable inputs for each HTTP method. In each example, adapterId is set to "Local NSO" — substitute the name of your configured adapter instance.
GET — read a device
Retrieve device information for C-IOS1:
PATCH — update device configuration
Add a loopback interface configuration to C-IOS1:
PUT — replace a configuration resource
Replace the IP address configuration on loopback interface 1 of C-IOS1:
POST — create a device
Add a new device named C-IOS1 to NSO:
DELETE — remove a device
Delete the C-IOS1 device from NSO:
Device lifecycle automation example
A common pattern is to chain restAction calls in a workflow to perform a full device onboarding sequence:
- Add device — POST to create the device record in NSO
- Fetch SSH host keys — POST to
/restconf/data/tailf-ncs:devices/device=C-IOS1/ssh/fetch-host-keys - Sync from device — POST to
/restconf/data/tailf-ncs:devices/device=C-IOS1/sync-from - Delete device — DELETE to remove the device when decommissioning
Each step uses a separate restAction task in the workflow, chained sequentially.
Service model example
To apply a service model using restAction with commit queue options, include the commit-queue tag in the POST body. Optional parameters such as no-out-of-sync-check and continue-on-error can be included for operational resilience during bulk deployments.
Refer to the Cisco NSO developer documentation for the YANG model paths specific to your service models.