Skip to content

Fabric Manager orchestration Sample APIs

ONES Sample REST APIs

Fabric manager Command line interface provides a network operator an interface to configure all the open standard protocols and is user-friendly. Network operators can run Fabric Manager CLI (FMCLI) commands on the device to enter into the configuration mode and can configure interfaces, protocols or other required features to bring up services over a data center fabric .

Prerequisites

  • Network operators are required to construct a complete configuration yaml file including new incremental configuration section and not only the incremental change in the fabric configuration while doing incremental configuration as a part of Day2 Operations over the ONES enrolled Data center switches
  • ONES Enrolled Devices will be on-boarded by a Fabric Manager Controller application called ONES . Following rest API is first called which ensures network operator does not share the login credentials with a re-occurrence
  • This API call is well encrypted which ensures ONES enrolled devices access credentials are not exposed in a plain text to avoid any security compromise
API addDeviceFacts
Description Allows the user to add device facts like Enrolled Device Management IP , username and Password to the Fabric Manager database. This is a one time operation and is required to be done before making any other API call. This API will add the device username, password and IP address to the Fabric Manager database and will be used for all other API calls. This API will also validate the device credentials and will return an error if the credentials are not valid.
Parameters 1. Device IP (Mgmt IP/SSH IP)
2. Userid (required for ssh)
3. Password (required for ssh)
Response true/false
Example
curl -X POST -H "Content-Type: application/json"
 -d '[{"ip":"device","user":"user","password":"pwd"}]' 
 http://server_ip:server_port/addDeviceFacts

Simplified Day 1 Orchestration

API uploadDay1Config
Description Intent Driven orchestration -Performs Day 1 fabric orchestration for various Data Center topologies.This method will initiate the Day-1 orchestration depending on the topology and intent supplied via template file. This REST API allows network operators to upload an entire intent file (yaml-based) and orchestrate the entire fabric in a desired intent based underlay and overlay. For example, if customers want to provision BGP as an underlay and VXLAN as an overlay ,they can operate the template form and provide minimum parameter inputs , with the rest of the derivation and parameters handled by the ONES application.
Parameters <Intent YAML file- Path to Template file > Output:< Intent ID> Input Parameter for the REST API call - Template file for the intent configuration for the whole fabric switches enrolled with ONES
Response Returns the intent ID which is an unique tag mapped to the specific intended input configuration desired by the network operator while defining the intended configuration with only specific desired network entities
Example
    POST /uploadDay1Config HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: 10.x.x.6:8787
    Connection: close
    User-Agent: Paw/3.4.0 (Macintosh; OS X/12.3.0) GCDHTTPRequest
    Content-Length: 61
    Input
    configure_az_1.yaml
    Response:
    configure_az_1.yaml_20230223115541

Get Day 1 Operational Status

API getDay1ConfigStatus
Description getDay1ConfigStatus- Retrieve Generic Intent Status for provisioning over SONiC enabled fabric switches . This REST API allows network operators to get the status of orchestration progress on a specific switch in a SONiC fabric enrolled with ONES application
Parameters Input: <Intent ID> Output: JSON (status) Input Parameter for the Rest API call - Intent ID for the intent configuration for the complete fabric switches enrolled with ONES
Response Return the Intent Status for the Day 1 orchestration.
Example
    GET/getDay1ConfigStatus?intentID=configure_az_1.yaml_20230223115541
    HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: 10.x.x.6:8787
    Connection: close
    User-Agent: Paw/3.4.0 (Macintosh; OS X/12.3.0) GCDHTTPRequest
    Content-Length: 61

    Response
    [
      {
        "intentName": "SNMPServer",
        "ip": "10.x.x.69",
        "verification_status": "1",
        "config_status": "1",
        "logs": ""
      },
    ]
    

Custom Upgrade SONiC NOS Image

API upgradeNOSImage
Description Custom Image Upgrade for Sonic devices . Performs custom image upgrades for specific enrolled sonic devices only.

Custom image management via ONES application. ONES application needs the following #information as the input -

- List of devices (IP address or host name) for the upgrade image operation. - Image path and user credentials to scp server
Parameters REST API Input Parameter :
Input Parameters: one or more device ip address
Response Response: True/False-

Returns True status , if image upgrade to SONiC devices is successful

Returns False Status , if Image upgrade to SONiC devices is unsuccessful

Example
   POST /upgradeNOSImage  HTTP/1.1
  Content-Type: application/json; charset=utf-8
  Host: localhost:8080
  Connection: close
  User-Agent: Paw/3.4.0 (Macintosh; OS X/12.3.0) GCDHTTPRequest
  Content-Length: 61

  [{"ip":"10.x.x.67","pathToImage":"http://10.x.x.10:8191/mnt/ws/
images/SONiC-mellanox-e8daeacd.bin"}]

Device Reboot

API rebootDevice
Description This REST API performs ONES enrolled SONiC device reboot . Network operators can reboot SONiC devices enrolled through ONES application via REST API calls
Parameters REST API Input Parameter : < List of device IPs to be rebooted>
Response Response: True/False

Returns True status , if Device reboot is successful and ONES receives an acknowledge for the same

Returns False status , if Device reboot is unsuccessful and ONES receives an acknowledge for the same

Example

    POST /rebootRequest HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: localhost:8080
    Connection: close
    User-Agent: Paw/3.4.0 (Macintosh; OS X/12.3.0) GCDHTTPRequest
    Content-Length: 61
    Input
    ["10.x.x.236"]
    Response:
    True

Show Difference between golden and running config

API getConfigDiff
Description Leveraging this REST API call, Operators get a view on difference between running configuration and applied configuration on enrolled devices
Parameters REST API Input Parameter : < List of device IPs for which Configuration difference is required >
Response API Response is the difference of running configuration vs Applied configuration through ONES fabric manager
Example
POST /getConfigDiff HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: localhost:8080
Connection: close
User-Agent: Paw/3.4.0 (Macintosh; OS X/12.3.0) GCDHTTPRequest
Content-Length: 61
Input
{ "ip": "10.x.x.66", “diff_only”: “false”}

Response: current config on device vs config done via FM
{
 "orchestrated_config": "Last login: Fri Sep 30 11:44:05 2022 
from 10.x.x.150\r\r\nsave\nsave\r\n\rSN2100-Leaf1# save\r\n\r
Saving Configuration\r\n\rSN2100-Leaf1# show run\show run\r\n\r
configure terminal\r\nrouter-id 3.0.0.2\r\nntp add 128.138.141.172\
r\nclock timezone Asia/Kolkata\r\nsyslog add 10.x.11\r\snmp-server
trap modify }

Get ONES Version

API getONESVersion
Description This REST API call enables network operators to retrieve versions of both the ONES Fabric manager application and ONES Fabric manager agent application which are running as container services on SONiC enabled fabric devices .
Parameters Input Parameters: Device ip address - List of Devices IP whose Version numbers needs to be retrieved
Response Returns the current running version of ONE'S controller as well as agent application
Example
    POST /getONESVersion HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: 10.1.1.8:8787
    Connection: close
    User-Agent: Paw/3.4.0 (Macintosh; OS X/12.3.0) GCDHTTPRequest
    Content-Length: 61


    ["10.x.x.79"]


    [
      {
        "Version": "v1.3.16/1.3.25",
        "IP": "10.x.x.61"
      }
    ]


Backup Current running Config

API backupConfig
Description After Sonic enabled DC fabric switches are orchestrated completely using Aviz’s ONES REST API , Network operators can take the backup of running configuration on SONiC switches at any time instance

ONES network operators can leverage REST API calls to validate the available configuration snapshot of specific devices at any time instance .

This REST API will list the existing backups already taken for specific devices. Operators have the option to Timestamp the label while restoring the configuration

Parameters Input Parameters: List of Device IP , User label defined by operator for each backup configure saved by ONES application
Response Response : True/false

Return True status , If backup of current running configuration goes successful by ONES

Return false status , If backup of current running configuration goes unsuccessful by ONES
Example
    POST /backupConfig HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: localhost:8080
    Connection: close
    User-Agent: Paw/3.4.0 (Macintosh; OS X/12.3.0) GCDHTTPRequest
    Content-Length: 61

    [{"ip":"10.x.x.10","label":"test label"}]


Replace Current Config for Devices

API replaceConfig
Description This Rest API client call will feed the golden configuration template as input and provides the following operational value to network operators

- Provides difference between golden configuration and running configure and accordingly do the required configure replacement operations through ONES API call also called as soft provisioning in Day 2 Operations
- PUSH - This Rest API client call also provisions and append any new Day 2 operations over existing orchestrated DC fabric Sonic switches
Parameters <List of Device IPs > with boolean flag “only diff” = TRUE/FALSE Status, If status return is true , API call returns difference between golden configuration and running configuration

If status return is false , API call returns the parity configuration
Response - Returns response - Difference between running config vs golden config when network Operator chooses Soft provisioning

- Returns Response - Returns the appended configuration to the existing running baseline configuration
Example

    POST /replaceConfig HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: 10.101.118.10:8787
    Connection: close
    User-Agent: Paw/3.4.0 (Macintosh; OS X/12.3.0) GCDHTTPRequest
    Content-Length: 61

    file: goldenconfigfile
    onlydiff: true/false

ZTP Upgrade SONiC NOS Image

API enableZTPUpgrade
Description ZTP upgrade - Perform SONiC upgrade using ZTP mechanism for a specific image and configuration file.

Use Case is to support image management for network operators running SONiC fabric

Both ZTP image upgrade enables network operators to change the version of the operating Sonic NOS during maintenance window
Parameters REST API Input parameter : `<`Input Device IPs`>` ZTP enable image upgrade by network operators use case is to change the version of the Sonic NOS during the maintenance window . Following are the REST API call signatures for the same. REST API: enableZTPUpgrade Type: POST
Response Response: true/False

Returns status true, if ZTP enabled upgrade to SONiC enrolled devices is successful

Returns status false, if ZTP enabled upgrade to SONiC enrolled devices is unsuccessful

Example
    POST /enableZTPUpgrade HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: localhost:8080
    Connection: close
    User-Agent: Paw/3.4.0 (Macintosh; OS X/12.3.0) GCDHTTPRequest
    Content-Length: 61

    ["10.x.x.10", "10.x.x.11"]