Skip to content

Commit 1c48f1c

Browse files
author
Younes Ouadi
committed
Merge branch 'master' of https://github.com/pkgcloud/pkgcloud
2 parents 23fe44a + 15c3615 commit 1c48f1c

65 files changed

Lines changed: 5921 additions & 518 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22
node_js:
3-
- '0.10'
3+
- '6'
4+
- '8'
45
notifications:
56
email:
67
- ken.perkins@rackspace.com

docs/README.md

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,54 @@
1-
## pkgcloud documentation
2-
3-
pkgcloud is a multi-provider cloud provisioning library for node.js that abstracts away differences among multiple cloud providers.
4-
5-
### Unified Vocabulary
6-
7-
Due to the differences between the vocabulary for each service provider, **[pkgcloud uses its own unified vocabulary](vocabulary.md).**
8-
9-
**Note:** Unified vocabularies may not yet be defined for *beta* services.
10-
11-
### Supported Providers
12-
13-
Supporting every API for every cloud service provider in Node.js is a huge undertaking, but _that is the long-term goal of `pkgcloud`_. **Special attention has been made to ensure that each service type has enough providers for a critical mass of portability between providers** (i.e. Each service implemented has multiple providers).
14-
15-
If a service does not have at least two providers, it is considered a *beta* interface; We reserve the right to improve the API as multiple providers will allow generalization to be better determined.
16-
17-
* **Compute** [*Compute Client Commonality*](providers/compute-commonality.md)
18-
* [Amazon](providers/amazon.md#using-compute)
19-
* [Azure](providers/azure.md#using-compute)
20-
* [DigitalOcean](providers/digitalocean.md#using-compute)
21-
* [HP](providers/hp/compute.md)
22-
* [Joyent](providers/joyent.md#using-compute)
23-
* [Openstack](providers/openstack/compute.md)
24-
* [Rackspace](providers/rackspace/compute.md)
25-
* **Storage**
26-
* [Amazon](providers/amazon.md#using-storage)
27-
* [Azure](providers/azure.md#using-storage)
28-
* [HP](providers/hp/storage.md)
29-
* [Openstack](providers/openstack/storage.md)
30-
* [Rackspace](providers/rackspace/storage.md)
31-
* **Databases**
32-
* [HP](providers/hp/database.md)
33-
* [IrisCouch](providers/iriscouch.md)
34-
* [MongoLab](providers/mongolab.md)
35-
* [Openstack](providers/openstack/database.md)
36-
* [Rackspace](providers/rackspace/database.md)
37-
* [MongoHQ](providers/mongohq.md)
38-
* [RedisToGo](providers/redistogo.md)
39-
* **DNS** *(beta)*
40-
* [Rackspace](providers/rackspace/dns.md)
41-
* **Block Storage** *(beta)*
42-
* [Rackspace](providers/rackspace/blockstorage.md)
43-
* [Openstack](providers/openstack/blockstorage.md)
44-
* **Orchestration** *(beta)*
45-
* [Rackspace](providers/rackspace/orchestration.md)
46-
* [Openstack](providers/openstack/orchestration.md)
47-
* **Load Balancers** *(beta)*
48-
* [Rackspace](providers/rackspace/loadbalancer.md)
49-
* **Networking** *(beta)*
50-
* [Openstack](providers/openstack/network.md)
51-
* [HP](providers/openstack/hp.md)
1+
## pkgcloud documentation
2+
3+
pkgcloud is a multi-provider cloud provisioning library for node.js that abstracts away differences among multiple cloud providers.
4+
5+
### Unified Vocabulary
6+
7+
Due to the differences between the vocabulary for each service provider, **[pkgcloud uses its own unified vocabulary](vocabulary.md).**
8+
9+
**Note:** Unified vocabularies may not yet be defined for *beta* services.
10+
11+
### Supported Providers
12+
13+
Supporting every API for every cloud service provider in Node.js is a huge undertaking, but _that is the long-term goal of `pkgcloud`_. **Special attention has been made to ensure that each service type has enough providers for a critical mass of portability between providers** (i.e. Each service implemented has multiple providers).
14+
15+
If a service does not have at least two providers, it is considered a *beta* interface; We reserve the right to improve the API as multiple providers will allow generalization to be better determined.
16+
17+
* **Compute** [*Compute Client Commonality*](providers/compute-commonality.md)
18+
* [Amazon](providers/amazon.md#using-compute)
19+
* [Azure](providers/azure.md#using-compute)
20+
* [DigitalOcean](providers/digitalocean.md#using-compute)
21+
* [HP](providers/hp/compute.md)
22+
* [Joyent](providers/joyent.md#using-compute)
23+
* [Openstack](providers/openstack/compute.md)
24+
* [Rackspace](providers/rackspace/compute.md)
25+
* [1&1 Oneandone](providers/oneandone/compute.md)
26+
* **Storage**
27+
* [Amazon](providers/amazon.md#using-storage)
28+
* [Azure](providers/azure.md#using-storage)
29+
* [HP](providers/hp/storage.md)
30+
* [Openstack](providers/openstack/storage.md)
31+
* [Rackspace](providers/rackspace/storage.md)
32+
* **Databases**
33+
* [HP](providers/hp/database.md)
34+
* [IrisCouch](providers/iriscouch.md)
35+
* [MongoLab](providers/mongolab.md)
36+
* [Openstack](providers/openstack/database.md)
37+
* [Rackspace](providers/rackspace/database.md)
38+
* [MongoHQ](providers/mongohq.md)
39+
* [RedisToGo](providers/redistogo.md)
40+
* **DNS** *(beta)*
41+
* [Rackspace](providers/rackspace/dns.md)
42+
* **Block Storage** *(beta)*
43+
* [Rackspace](providers/rackspace/blockstorage.md)
44+
* [Openstack](providers/openstack/blockstorage.md)
45+
* [1&1 Oneandone](providers/oneandone/blockstorage.md)
46+
* **Orchestration** *(beta)*
47+
* [Rackspace](providers/rackspace/orchestration.md)
48+
* [Openstack](providers/openstack/orchestration.md)
49+
* **Load Balancers** *(beta)*
50+
* [Rackspace](providers/rackspace/loadbalancer.md)
51+
* [1&1 Oneandone](providers/oneandone/loadbalancer.md)
52+
* **Networking** *(beta)*
53+
* [Openstack](providers/openstack/network.md)
54+
* [HP](providers/openstack/hp.md)

docs/providers/google.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,27 @@ var client = require('pkgcloud').storage.createClient({
2121
keyFilename: '/path/to/a/keyfile.json', // path to a JSON key file
2222
projectId: 'eco-channel-658' // project id
2323
});
24-
```
24+
```
25+
26+
27+
## Uploading a file
28+
```Javascript
29+
var readStream = fs.createReadStream(<filepath>);
30+
31+
var writeStream = client.upload({
32+
container: <CONTAINER_NAME>,
33+
remote: <filename>,
34+
contentType: 'application/pdf' // optional
35+
});
36+
37+
writeStream.on('error', function (err) {
38+
console.error(err);
39+
});
40+
41+
writeStream.on('success', function (file) {
42+
console.log("Success!");
43+
});
44+
45+
readStream.pipe(writeStream);
46+
```
47+

docs/providers/oneandone.md

Whitespace-only changes.

docs/providers/oneandone/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Using the 1&1 provider in pkgcloud
2+
3+
The 1&1 provider in pkgcloud supports the following services:
4+
5+
* [**Compute**](compute.md) (Cloud Servers)
6+
* [**Block Storage**](blockstorage.md) (Cloud Block Storage) *(beta)*
7+
* [**Load Balancers**](loadbalancer.md) (Cloud Load Balancers) *(beta)*
8+
9+
### Getting Started with Compute
10+
11+
We've provided a [simple compute example](getting-started-compute.md) where it creates a couple of compute instances.
12+
13+
### Authentication
14+
15+
For all of the Rackspace services, you create a client with the same options:
16+
17+
you can store the token in your Environment variables just like below.
18+
19+
```Javascript
20+
var client = require('pkgcloud').compute.createClient({
21+
provider: 'oneandone',
22+
token: process.env.OAO_TOKEN
23+
});
24+
```
25+
26+
27+
### Datacenters
28+
29+
All of the 1&1 Oneandone `createClient` calls have a few options that can be provided:
30+
31+
#### location
32+
33+
`location` specifies which region of a service to use. Different services have different regions enabled. The current list of regions is:
34+
35+
- `ES` (Spain)
36+
- `US` (United States of America)
37+
- `DE` (Germany)
38+
- `GB` (United Kingdom of Great Britain and Northern Ireland)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## Using the 1&1 Block Storage provider
2+
3+
#### BETA - This API may change as additional providers for block storage are added to pkgcloud
4+
5+
Creating a block-storage client is straight-forward:
6+
7+
``` js
8+
var oneandone = pkgcloud.blockstorage.createClient({
9+
provider: 'oneandone', // required
10+
token: 'apikey', // required
11+
});
12+
```
13+
14+
[More options for creating clients](README.md)
15+
16+
* Snapshot
17+
* [Model](#snapshot-model)
18+
* [APIs](#snapshot-apis)
19+
20+
21+
### Snapshot Model
22+
23+
A Snapshot for BlockStorage has the following properties:
24+
25+
```Javascript
26+
{
27+
id: '12345678-1111-2222-3333-123456789012', // id of the snapshot
28+
}
29+
```
30+
31+
### Snapshot APIs
32+
33+
#### client.getSnapshots(options, callback)
34+
Returns a list of the server's snapshots.
35+
36+
Callback returns `f(err, snapshots)` where `snapshots` is an `Array`. `options` is an optional `boolean` which will return the full snapshot details if true.
37+
38+
#### client.createSnapshot(details, callback)
39+
Creates a snapshot with the details specified
40+
41+
Options are as follows:
42+
43+
```js
44+
{
45+
server: '81504C620D98BCEBAA5202D145203B4B',//Server or Server id to create the snapshot from
46+
}
47+
48+
```
49+
Returns the new snapshot in the callback `f(err, snapshot)`
50+
51+
#### client.deleteSnapshot(snapshot, callback)
52+
Removes a snapshot
53+
54+
Takes snapshot or snapshotId as an argument and returns an error if unsuccessful `f(err)`
55+
56+
#### client.updateSnapshot(snapshot, callback)
57+
Restores a snapshot into the server.
58+
59+
Returns callback with a confirmation
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
## Using the 1&1 Compute provider
2+
3+
As of the `v0.8` release of `pkgcloud`, the Compute provider uses Next Generation Cloud Servers, meaning you'll need to use a version <=0.7.x to use First Generation Cloud Servers.
4+
5+
Creating a client is straight-forward:
6+
7+
``` js
8+
var oneandone = pkgcloud.compute.createClient({
9+
provider: 'oneandone', // required
10+
token: 'your-api-key', // required
11+
});
12+
```
13+
14+
[More options for creating clients](README.md)
15+
16+
### API Methods
17+
18+
**Servers**
19+
20+
#### client.getServers(callback)
21+
Lists all servers available to your account.
22+
23+
Callback returns `f(err, servers)` where `servers` is an `Array`
24+
25+
#### client.createServer(options, callback)
26+
Creates a server with the options specified
27+
28+
Options are as follows:
29+
30+
```js
31+
{
32+
name: 'server name',
33+
flavor: 'falvor-id',
34+
image: 'image or imageId',
35+
location: 'datacenter id'
36+
}
37+
38+
```
39+
Returns the server in the callback `f(err, server)`
40+
41+
#### client.destroyServer(server, callback)
42+
Destroys the specified server
43+
44+
Takes server or serverId as an argument and returns the id of the destroyed server in the callback `f(err, serverId)`
45+
46+
#### client.getServer(server, callback)
47+
Gets specified server
48+
49+
Takes server or serverId as an argument and returns the server in the callback
50+
`f(err, server)`
51+
52+
#### client.rebootServer(server, options, callback)
53+
Reboots the specifed server with options
54+
55+
Returns callback with a confirmation
56+
57+
#### client.getVersion(callback)
58+
59+
Get the current version of the api returned in a callback `f(err, version)`
60+
61+
**flavors**
62+
63+
#### client.getFlavors(callback)
64+
65+
Returns available flavours for fixed servers in the callback `f(err,
66+
flavors)`
67+
68+
#### client.getFlavor(flavor, callback)
69+
Returns information about one flavour in the callback `f(err, flavor)`
70+
71+
**images**
72+
73+
#### client.getImages(callback)
74+
Lists all images available to your account
75+
76+
`f(err, images)`
77+
78+
#### client.getImage(image, callback)
79+
Information about specific appliance/image
80+
81+
`f(err, image)`
82+
83+
#### client.createImage(options, callback)
84+
Adds a new image from a server
85+
86+
Options include:
87+
88+
```js
89+
{
90+
name: 'image name',
91+
server: 'server or server id'
92+
}
93+
```
94+
95+
Returns the newly created image
96+
97+
`f(err, image)`
98+
99+
#### client.destroyImage(image, callback)
100+
Destroys the specified image and returns a confirmation
101+
102+
`f(err, {ok: imageId})`

0 commit comments

Comments
 (0)