1.0.2 • Published 5 years ago

axapi-genie v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

axapi-genie

Travis npm package Coveralls

axapi-genie is a JavaScript wrapper around A10's axapi. Genie can help you run tasks on multiple partitions in multiple devices by sequencing the asynchronous calls so you don't have to.

Installation

axapi-genie is a Node.js module available throught the npm registry. It can be installed using the npm install command.

$ npm install --save axapi-genie

Usage

var axapi = require("axapi-genie");
// or
import DeviceScheduler from "axapi-genie";
const Genie = new DeviceSchedular(switchPartition);

DeviceSchedular

MethodsParamterers
constructorswitchPartition

switchPartition(mgmtIP: string, partitionName: string): Object

ParamsDescription
mgmtIPManagement IP for the device where the parition switching has to occur.
partitionNameName of the parition which has to be switched.
ReturnsDescription
responseResponse object for /active-partition aXAPI endpoint.

DeviceSchedular.enqueOperation(mgmtIP: string, partitionName: string, task: Function): Promise

enqueOperation is a method available through DeviceSchedular's instance to schedule a task based on the device mgmtIP and partitionName.

ParamsDescription
mgmtIPManagement IP for the device where the parition switching has to occur.
partitionNameName of the parition which has to be switched.
taskA function which contains a single or multiple calls to the aXAPI; returns a Promise object when called.

All hail open source!