REST vs. RPC APIs

In the post I want to breakdown REST API & RPC API and provide a brief comparison.


Let's start with REST. Restful APIs leverage HTTP/S to define the operations on the resources. An example would contain:

  • A URI that defines resources

  • Set of protocols - GET POST PUT DELETE etc.

  • Representations of the resource defined by the media type

In regard to REST, in order for a web API to be "RESTful" it must adhere to the following:

  • Client/Server architecture

  • Statelessness

  • Cacheability

  • Layered System

  • Uniform Interface

  • Code on demand

Restful APIs leverage HTTP to define the operations on the resources. An example would contain:

  • A URI that defines resources

  • Set of protocols - GET POST PUT DELETE etc.

  • Representations of the resource defined by the media type

To see examples of HTTP status codes & methods see: HTTP Methods & Status Codes Tidbit


RPC APIs are great for actions (procedures or commands). REST APIs are great for modeling your domain (resources or entities), making CRUD (create, read, update, delete) available for all of your data. REST will use HTTP methods such as GET, POST, PUT, DELETE, OPTIONS and, hopefully, PATCH to provide semantic meaning for the intention of the action being taken.


Quick comparison on HTTP request methods and how they correlate with CRUD:

  • POST = CREATE

  • GET = READ

  • PUT = UPDATE

  • DELETE = DELETE

RPC APIs are a call based remote procedure. From a high level, a client sends a call to the server, with some parameters, once the call/job is complete it awaits response with results. These types of APIs can be executed asynchronously. Two major RCP API based protocols include the following:

  • SOAP (simple object access protocol) = interface for describing functionalities offered via the web services.

  • SOAP framework is as follows:

  • Envelope: identifies the XML document as a SOAP message

  • Header: contains SOAP header

  • Body: body of message with remote call and parameters

  • Fault: provides info about errors

  • Network Configuration Protocol (NETCONF): network device configuration management protocol that provide mechanisms to install, manipulate, and delete configurations

NETCONF consists of 4 layers:

  1. Content layer = actual config

  2. Operations layer = defines set of base protocol to retrieve/edit configuration data. <get-config><edit-config><lock>

  3. Message layer = mechanism for encoding remote procedure calls

  4. Secure transport layer = ensures secure transfer between client/server

  5. gRPC: http/2 built by google; uses protocol buffers

NETConf's main purpose is to:

  • Transport config payloads to a device

  • Retrieve config data

  • Support notifications

NETConf primary features include:

  • Defines framework for session mgmt

  • RPC messages to put and get config data

  • Transaction-based comms

  • Net device activation

  • Datastores of config data

For examples & more on APIs see the <api> tag, Cheers!


0 comments

Recent Posts

See All

Linux AnyConnect Overview & Ansible Automation

"The What?" - In this blog I want to cover a brief overview of one way to install AnyConnect (AC) on a linux client running a supported OS. Once I cover the overview I intend on covering a few Ansibl

Using a Custom Ansible Module for ISE API Interaction

"The What?" - In this post I am going to provide a general understanding on how to use a custom Ansible module. A module is essentially a reusable standalone script that Ansible will run on your beha

Ansible URI Module Breakdown & ISE Example

"The What?" - In this blog I want to cover an important Ansible module for those looking to gain an understanding of how to use Ansible to consume APIs without the need for custom modules. The URI mo