2.0.0 • Published 1 month ago

egnyte-resellers v2.0.0

Weekly downloads
160
License
MIT
Repository
github
Last release
1 month ago

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!
  })
2.0.0

1 month ago

1.4.1

2 months ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.12

3 years ago

1.2.11

3 years ago

1.2.8

3 years ago

1.2.9

3 years ago

1.2.10

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.0

6 years ago