Introduction to Network Automation - REST API, RESTCONF, NETCONF, gNMI, and SNMP

Table of Contents

 

Introduction

Modern computer networks are becoming increasingly complex. Managing network devices such as switches, routers, and wireless access points manually is time-consuming and prone to human error.

For this reason, many organizations are adopting Network Automation, which enables centralized management of network infrastructure and allows configuration changes to be performed quickly, consistently, and securely.

One of the key components of network automation is the communication protocol used between management systems and network devices.

In this article, we explain:

  • what REST API, RESTCONF, NETCONF, gNMI, and SNMP are
  • how these protocols work
  • what they are commonly used for
  • their advantages and limitations
  • which protocol you should choose for network automation

 

What Is Network Automation?

Network automation is the use of software and programmable interfaces to:

  • configure network devices
  • monitor infrastructure health
  • deploy configuration changes
  • collect telemetry data
  • respond to network events and failures

Instead of manually logging into each device through SSH and entering commands one by one, administrators can use APIs and automation protocols to perform operations centrally.

 

Example

Without automation:

  • an administrator logs into 50 switches manually
  • configuration changes are applied individually on each device

With automation:

  • the system pushes the change to all devices simultaneously
  • the process takes seconds instead of hours
  • the risk of configuration mistakes is significantly reduced

     

Network Automation Protocols

The most commonly used network automation protocols include:

  • REST API
  • RESTCONF
  • NETCONF
  • gNMI
  • SNMP

Each protocol was designed for different use cases and environments.

 

What Are YANG and OpenConfig?

Modern network automation protocols such as RESTCONF, NETCONF, and gNMI commonly use YANG and OpenConfig models.

 

What Is YANG?

YANG is a data modeling language used to describe:

  • network configuration
  • operational device state
  • telemetry information

YANG defines how data should be structured and exchanged between devices and automation systems.

 

What Is OpenConfig?

OpenConfig is a vendor-neutral collection of YANG models designed for multi-vendor network automation.

OpenConfig helps standardize how network devices expose data and configuration through APIs.

This allows automation systems to work with devices from multiple vendors using similar API structures.

 

REST API RESTCONF NETCONF gNMI SNMP

What Is REST API?

REST API (Representational State Transfer Application Programming Interface) is one of the most widely used methods of communication between applications and devices.

REST API works similarly to a website:

  • a client sends a request
  • the device or application responds with data

Communication typically uses HTTP or HTTPS protocols.

 

How Does REST API Work?

REST APIs use standard HTTP methods:

Method Function
GET retrieve data
POST create data
PUT update data
DELETE remove data

 

Example

GET https://switch-ip/api/interfaces

The device may return a list of network interfaces in JSON format.

The following REST API example are simplified generic example used for educational purposes.
Modern network operating systems such as SONiC often use RESTCONF and OpenConfig models instead of traditional vendor-specific REST APIs.

 

Use case: VLAN 100 configuration on the SONiC switch

Example - Adding VLAN 100

curl -X POST http://switch-ip:8080/api/v1/vlans \
  -H "Content-Type: application/json" \
  -d '{
    "VLAN": {
      "Vlan100": {
        "vlanid": 100
      }
    }
  }'

 

Legacy REST API vs Modern RESTCONF

In older, community versions of SONiC, a dedicated REST API wrapper was available under the /api/v1/ endpoint (typically listening on port 8080 or 8000). In modern Enterprise SONiC distributions, this legacy API has been completely deprecated and replaced by the unified RESTCONF framework.

 

Advantages of REST API

  • simple to implement
  • widely supported by vendors
  • easy integration with applications
  • human-readable JSON format
  • popular in cloud and DevOps environments

     

Limitations of REST API

  • lack of standardization between vendors
  • different API implementations
  • sometimes limited configuration capabilities

     

When Should You Use REST API?

REST API is a good choice when:

  • integrating network devices with web applications
  • building custom management portals
  • working with DevOps platforms
  • requiring a simple automation interface

 

Protocol Comparison

Protocol Main Purpose Data Format Security Modernity
REST API application integration JSON high high
RESTCONF network automation JSON / XML / OpenConfig high high
NETCONF device configuration XML / OpenConfig very high high
gNMI real-time telemetry Protobuf / OpenConfig very high very high
SNMP monitoring MIB / OID medium low

 

Real-World Protocol Adoption

Environment Common Protocol
Legacy enterprise SNMP
Modern enterprise RESTCONF
Service provider NETCONF
Hyperscale datacenter gNMI
DevOps integration REST API

 

Which Protocol Should You Choose?

There is no single perfect protocol for every environment.

The right choice depends on:

  • infrastructure type
  • network scale
  • security requirements
  • automation maturity
  • device compatibility

     

Recommendations

REST API

Choose when:

  • simplicity is important
  • integrating web applications
  • building custom software platforms

RESTCONF

Choose when:

  • standardization matters
  • deploying modern automation platforms
  • using YANG models

NETCONF

Choose when:

  • reliable and secure configuration management is required
  • managing large-scale networks
  • configuration validation is important

gNMI

Choose when:

  • real-time telemetry is required
  • building cloud or hyperscale environments
  • high scalability is needed

SNMP

Choose when:

  • monitoring legacy environments
  • using existing monitoring systems
  • requiring simple infrastructure visibility

 

Summary

Network automation is becoming a standard requirement in modern IT environments.

REST API, RESTCONF, NETCONF, gNMI, and SNMP solve different problems and are often used together in the same infrastructure.

Key differences include:

  • REST API provides simple application integration
  • RESTCONF and NETCONF enable standardized configuration management
  • gNMI delivers modern real-time telemetry
  • SNMP remains widely used for traditional monitoring

Choosing the correct protocol should depend on your organization’s operational requirements and infrastructure capabilities.

If you have any questions related to this article, feel free to reach out to our technical support team.

Happy Networking!

 

Useful links

For more free resources, visit: 

https://stordis.com/free-resources/

 

Still have questions? You can find more answers in our full FAQ - just follow the link below.

STORDIS Support Portal FAQ

Comments 0

Articles in this section