egnyte-resellers
Library for managing things against the undocumented egnyte resellers API.
Last updated 8 months ago by zenion .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install egnyte-resellers 
SYNC missed versions from official npm registry.

Egnyte Resellers API

Library for managing things against the undocumented egnyte resellers API.

All methods are implemented in async/await so use you must use async/await or promises to interact with them. Below examples show promise.then().catch() syntax for clarity

I made this to solve my own problems of automating modifications to a resellers account for egnyte. Use at your own risk.

Install with npm or yarn into your project:

npm install egnyte-resellers
yarn add egnyte-resellers

Basic usage:

const Egnyte = require('egnyte-resellers')

// create an instance of the Egnyte class
// supply username and password used to login to egnyte resellers portal (https://resellers.egnyte.com)
const egnyte = new Egnyte({
  username: 'myusername@company.com',
  password: 'mydefinitelygoodpassword'
})

// get information about your customer tenants
// returns an array like this:
//
// [
//   ...
//   {
//     "customerEgnyteId": "thecustomerid",
//     "powerUsers": {
//       "total": 5,
//       "active": 1,
//       "free": 4
//     },
//     "storageGB": {
//       "total": 500,
//       "active": 200,
//       "free": 300
//     }
//   }
// ]
//
egnyte.getAllCustomers()
  .then(result => {
    // do something with result
  })
  .catch(err => {
    // handle your errors friends!
  })

// get a single customer instead of an array of them
egnyte.getOneCustomer('thecustomerid')
  .then(result => {
    // do something with result
  })
  .catch(err => {
    // handle your errors friends!
  })

// get your resellers account license availability
// returns an object like this:
//
// {
//   powerUsersAvailable: 14,
//   storageGBAvailable: 3142
// }
//
egnyte.getAvailableLicensing()
  .then(result => {
    // do something with result
  })
  .catch(err => {
    // handle your errors friends!
  })

// updates a customer's power user count
// since egnyte doesn't do it for whatever genius reason, we'll do validation to ensure you can't set this to less than the current in-use number of users
//
// sets thecustomerid to 20 user count
egnyte.updateCustomerPowerUsers('thecustomerid', 20)
  .then(result => {
    // do something with result
  })
  .catch(err => {
    // handle your errors friends!
  })

// updates a customer's storage GB count
// since egnyte doesn't do it for whatever genius reason, we'll do validation to ensure you can't set this to less than the current in-use GB of storage
//
// sets thecustomerid to 500GB storage allocation
egnyte.updateCustomerStorage('thecustomerid', 500)
  .then(result => {
    // do something with result
  })
  .catch(err => {
    // handle your errors friends!
  })

Current Tags

  • 1.1.0                                ...           latest (8 months ago)

9 Versions

  • 1.1.0                                ...           8 months ago
  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 13
Dependencies (1)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |