Skip to content

thwi/node-eAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-eAPI

Overview

node.js methods for issuing commands to the Arista EOS API (eAPI).

Requires EOS >= 4.12 and an enabled HTTP API service:

switch1(config)#management api http-commands
switch1(config-mgmt-api-http-cmds)#proto https
switch1(config-mgmt-api-http-cmds)#no shut

Installation

npm install eapi

Usage

Create instance

var eAPI = require('eapi');

var switch1 = new eAPI({
  host: 'switch1',
  proto: 'https',
  port: 443,
  user: 'admin',
  pass: 'admin',
  strict: true
});

Basic commands

eAPI.exec(cmds, callback)

switch1.exec([ 'show version' ], function(err, res) {
  // command output
});

Editing configuration

eAPI.exec([ 'enable', 'configure', ... ], callback)

switch1.exec([
  'enable',
  'configure',
  'interface Et1',
  'switchport mode access',
  'switchport access vlan 10'
], function(err, res) {
  // command output
});

See Arista eAPI documentation for detail.

Notes / Resources

About

Arista EOS API (eAPI) methods for node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published