REST API Guide

SONIC PBNOS 1.3

This REST Application Programming Interface (API) enables you to remotely configure and manage a AVIZ OPBNOS REST, HyperText Transfer Protocol Secure(HTTPs). The REST (Representational State Transfer) architecture has six constraints - Uniform Interface, Stateless, Cacheable, Client-Server, Layered Systems, and Code on Demand. The REST API is a JavaScript Object Notation-based (JSON) wrapper around Python On-Box backend.

REST APIs can be used to perform CRUD

  • Create: This is a POST https request

  • Read: This is a GET https request

  • Update: This is a PUT https request

  • Delete: This is a DELETE https request

The table below shows the convention to map Python object API to RESTful API:

Operation

RESTful API

Create

[POST] https://<IP_addreess>/api/<resource> params={…}

Delete

[DELETE] https://<IP_addreess>/api/<resource>/<id>

Get

[GET] https://<IP_addreess>/api/info/<resource>/<id>

GetAll

[GET] https://<IP_addreess>/api/info/

Update

[PUT] https://<IP_addreess>/api/<resource>/<id> params={…}