https://github.com/internap/js-ubersmithclient
A simple js ubersmith client
https://github.com/internap/js-ubersmithclient
Last synced: 5 months ago
JSON representation
A simple js ubersmith client
- Host: GitHub
- URL: https://github.com/internap/js-ubersmithclient
- Owner: internap
- Created: 2017-02-15T21:32:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-22T21:33:20.000Z (over 9 years ago)
- Last Synced: 2025-07-07T07:50:32.754Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# js-ubersmithclient
[](https://travis-ci.org/internap/js-ubersmithclient)
Rewrite of python-ubersmithclient in everyone's favorite language
## Usage
```javascript
const UbersmithClient = require('js-ubersmithclient');
const ubClient = new UbersmithClient(url, user, password, timeout, use_http_get);
ubClient.client.list({client_id: 12345}) // returns a Promise
.then(res => {
console.log(res);
// {
// "12345": {"clientid": "12345", "first":"", "last":"", ...}
// }
})
.catch(err => {
console.log(err);
});
```
## Constructor args
- url: Ubersmith Base URL, e.g. `http://ubersmith.com`
- user: Ubersmith API username
- password: Ubersmith API password
- timeout: Request timeout length, in seconds (default: 60)
- use_http_get: Whether to GET or POST to Ubersmith (default: false, i.e. use POST)
## UB API method args
They must be passed in an Object, e.g. `client.list({client_id: 12345, brand_id: 6789})`
## TODO
- Wayyyyy moar tests
- Probably separate things into more than one file