# conservatory-api

> conservatory API client wrapper

Latest version **1.0.3** (published 2014-05-07) · 0 weekly downloads

## Install

```sh
npm install conservatory-api
pnpm add conservatory-api
yarn add conservatory-api
bun add conservatory-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2014-05-07 |
| First published | 2013-04-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Nodejitsu |
| Maintainers | mmalecki, indexzero, bmeck, jcrugzz, chjj |

## Links

- npm: https://www.npmjs.com/package/conservatory-api
- Repository: https://github.com/opsmezzo/conservatory-api
- Homepage: https://opsmezzo.com/
- Issues: https://github.com/opsmezzo/conservatory-api/issues
- npm.io page: https://npm.io/package/conservatory-api

## Dependencies (2)

- [utile](https://npm.io/package/utile.md) ~0.2.0
- [request](https://npm.io/package/request.md) ~2.21.x

## Recent versions

- 1.0.3 (latest) — 2014-05-07
- 1.0.2 — 2013-05-14
- 1.0.1 — 2013-05-01
- 1.0.0 — 2013-04-15

## README

# conservatory-api/node.js

The node.js conservatory-api library enables access to the RESTful API for [`conservatory`](https://github.com/nodejitsu/conservatory).

## Example:

```js
var conservatory = require('conservatory-api');

var client = conservatory.createClient({
  host: 'api.nodejitsu.com',
  port: 80,
  auth: {
    username: 'charlie',
    password: 'foobar',
  }
});

client.groups.list(function (err, result) {
  if (err) {
    console.log(err);
    return;
  }
  
  console.log(JSON.stringify(result, null, 2, true));
});
```

## Usage:

### api.createClient(options)

This method sets up a client for connecting to `conservatory`. Here's a minimal example for connecting to conservatory as `charlie`:

``` js
var client = conservatory.createClient({
  host: 'api.nodejitsu.com',
  port: 80,
  auth: {
    username: 'charlie',
    password: 'foobar',
  }
});
```

The options object contains three required properties:

* `auth.username`: The username for your Nodejitsu account
* `auth.password`: The password for your Nodejitsu account
* `host`: The api host (typically http://conservatory.nodejitsu.com.

### client

Method calls are generally structured as `resource` and `action`.

``` js
client.resource.action("data", function (err, result) {
  if (err) {
    throw err;
  }

  //
  // use the result
  //
});
```

Most actions take a string argument and a callback, though a few actions only take a callback.

The client's methods are reflective of [`conservatory`](https://github.com/nodejitsu/conservatory/tree/master/lib/resources) resources. Here's a broad overview:

* **client.servers**: Manage your server instances. Methods include:
  * `servers.provision`
  * `servers.getPosition`
  * `servers.free`
  * `servers.get`
  * `servers.list`
  * `servers.list`
  * `servers.listRole`
  * `servers.update`
* **client.groups**: Manage your server groups. Methods include:
  * `groups.get`
  * `groups.list`
  * `groups.listProvider`
  * `groups.update`
  * `groups.destroy`
* **client.users**: Manage your conservatory accounts. Methods include:
  * `users.create`
  * `users.get`
  * `users.list`
  * `users.update`
  * `users.destroy`
  * `users.getKey`
  * `users.getKeys`
  * `users.addKey`
  * `users.updateKey`

## Installation

This library may be installed using npm:

``` bash
  $ npm install nodejitsu-api
```

## Tests
All tests are included in [`conservatory`](https://github.com/nodejitsu/conservatory/tree/master/tests) to facilitate integration tests and to avoid the need for complex mocking.

## License
Proprietary. Copyright (c) 2011 Nodejitsu Inc.

---
_Source: https://npm.io/package/conservatory-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
