Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aviz-sonic-rbapi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aviz-sonic-rbapi

  • 0.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Aviz Networks AIMS SONIC Ruby API Library

Overview

The Ruby Client for Azure SONIC REST API provides a native Ruby implementation for programming Aviz Networks SONIC network devices using AIMS. The Ruby client provides the ability to build native applications in Ruby that can communicate with SONIC remotely over a HTTP transport protocol.

The Ruby API implemenation also provides an API layer for building native Ruby objects that allow for configuration and management of Aviz Networks SONIC switches using AIMS.

Requirements

  • Aviz Networks SONIC switches
  • Ruby 2.2.3 or later

SONIC Ruby APIs

The SONIC Ruby Client was designed to be easy to use and develop plugins or tools that interface with the Aviz Networks SONIC switches.

Using the API

See the below example for using the API. Also refer test/ directory for more details.

Switch Configuration file

This configuration file is used to define the configuration options or model for switches (switch.yml or any xxx.yml)

protocol : 'http' # protocol (HTTP)
port : '8090' # HTTP(s) port number (8090 - HTTP)
ip : 'switch ip address' # Switch IP address
user : 'username'  # Switch Credentials
password : 'password' #switch credentials 
Creating connection and sending configurations

Below demonstrates a basic connection using the API. For more examples please see the examples folder

#### import the libraries
require 'sonic-rbapi/connect'
require 'sonic-rbapi/vlan'

##### create connection to the node using the configuration file
conn = Connect.new(param) 

where param is a dictionary formed either from the config file or hardcoded 
with the following key value pairs 

protocol => 'http' # protocol (HTTP) 
port => '8090' # HTTP(s) port number (8090 - HTTP)
ip => 'switch ip address' # Switch IP address 
user => 'username' #Switch Credentials
password => 'password' #Switch Credentials
  
##### Use VLAN APIs to retrieve all VLAN information
Vlan.get_all_vlan(conn)

##### Use VLAN APIs to create VLANs
vlan_id = 10
dhcp_servers =  ["10.10.10.1", "10.10.10.2"]
resp = Vlan.create_vlan(conn, vlan_id, dhcp_servers)

##### Use VLAN APIs to retrieve specific VLAN information
resp = Vlan.get_vlan(conn, 20)

##### Use VLAN APIs to delete VLANs
Vlan.delete_vlan(conn, 20)

FAQs

Package last updated on 05 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc