2.0.5 • Published 4 months ago

egnyte-resellers v2.0.5

Weekly downloads
160
License
MIT
Repository
github
Last release
4 months 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.5

4 months ago

2.0.3

11 months ago

2.0.4

11 months ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.4.1

1 year ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.12

4 years ago

1.2.11

4 years ago

1.2.8

4 years ago

1.2.9

4 years ago

1.2.10

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.0

7 years ago