# sacloud

> A Node.js Library for SAKURA Internet Cloud API.

Latest version **0.1.0** (published 2017-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install sacloud
pnpm add sacloud
yarn add sacloud
bun add sacloud
```

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-08-16 |
| First published | 2013-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | sakura-internet |
| Maintainers | kanreisa |
| Keywords | sacloud |

## Links

- npm: https://www.npmjs.com/package/sacloud
- Repository: https://github.com/sakura-internet/node-sacloud
- Homepage: https://github.com/sakura-internet/node-sacloud#readme
- Issues: https://github.com/sakura-internet/node-sacloud/issues
- npm.io page: https://npm.io/package/sacloud

## Dependencies (5)

- [tav](https://npm.io/package/tav.md) ~0.1.0
- [xhr2](https://npm.io/package/xhr2.md) 0.0.5
- [complete](https://npm.io/package/complete.md) 0.4.3
- [cli-table](https://npm.io/package/cli-table.md) git://github.com/kanreisa/cli-table.git
- [underscore](https://npm.io/package/underscore.md) ~1.4.4

## Recent versions

- 0.1.0 (latest) — 2017-08-16
- 0.0.16 — 2015-01-14
- 0.0.15 — 2014-03-26
- 0.0.14 — 2013-07-14
- 0.0.13 — 2013-06-15
- 0.0.12 — 2013-05-24
- 0.0.11 — 2013-05-21
- 0.0.10 — 2013-05-20
- 0.0.9 — 2013-05-01
- 0.0.8 — 2013-04-26
- 0.0.7 — 2013-04-25
- 0.0.6 — 2013-04-25
- 0.0.5 — 2013-04-25
- 0.0.4 — 2013-04-25
- 0.0.3 — 2013-04-24
- … 3 more at https://npm.io/package/sacloud/versions

## README

node-sacloud (sacloud)
=====================

A [node.js](http://nodejs.org) library for [SAKURA Internet Cloud](http://cloud.sakura.ad.jp/) API.

##  Install

```
npm install --save sacloud
```

## Getting started

#### Load and create a client instance:

```javascript
const sacloud = require("sacloud");

const client = sacloud.createClient({
  accessToken        : 'account_access_token_here',
  accessTokenSecret  : '********',
  disableLocalizeKeys: false,// (optional;default:false) false: lower-camelize the property names in response Object
  debug              : true// (optional;default:false) output debug requests to console.
});

// select zone
const zone = "tk1a";
client.opt.apiRoot = `https://secure.sakura.ad.jp/cloud/zone/${zone}/api/cloud/1.1/`;
```

* API-key manager: https://secure.sakura.ad.jp/cloud/iaas/#!/pref/apikey/

#### Get Servers:

```javascript
client.createRequest({
  method: 'GET',
  path  : 'server'
}).send((err, result) => {
  
  if (err) {
    throw new Error(err);
  }
  
  console.log( JSON.stringify(result, null, '  ') );
});
```

##### Create Server:

```javascript
const request = client.createRequest({
  method: 'POST',
  path  : 'server',
  body  : {
    Server: {
      Zone       : { ID: 31001 },
      ServerPlan : { ID: 1 },
      Name       : 'test-server',
      Description: 'blah blah blah...',
      Tags       : ['test']
    }
  }
});

request.send((err, result) => {
  
  if (err) {
    throw new Error(err);
  }
  
  console.log(`created successfully! serverId=${result.response.server.id}`);
});
```

## CLI

has been removed on `@0.1.0`. use [usacloud](https://github.com/sacloud/usacloud).

## API Documentation

see: http://developer.sakura.ad.jp/cloud/api/1.1/

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