Skip to content

Commit

Permalink
[merge] Merge master into 1.2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Oct 1, 2015
2 parents 0d5ff1e + f7799a7 commit 7cfad69
Show file tree
Hide file tree
Showing 181 changed files with 3,449 additions and 377 deletions.
165 changes: 83 additions & 82 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,88 +1,89 @@
{
"maxerr" : 50, // {int} Maximum error before stopping
"predef" : ["-context"],
"maxerr" : 50, // {int} Maximum error before stopping

// Enforcing
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : false, // true: Require triple equals (===) for comparison
"forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
"indent" : false, // {int} Number of spaces to use for indentation
"latedef" : true, // true: Require variables/functions to be defined before being used
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty" : true, // true: Prohibit use of empty blocks
"nonbsp" : false, // true: Prohibit "non-breaking whitespace" characters.
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : false, // true: Prohibit use of `++` & `--`
"quotmark" : "single", // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : true, // true: Require all defined variables be used
"strict" : false, // true: Requires all functions run in ES5 Strict Mode
"maxparams" : false, // {int} Max number of formal params allowed per function
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
"maxstatements" : false, // {int} Max number statements per function
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
"maxlen" : false, // {int} Max number of characters per line
// Enforcing
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : false, // true: Require triple equals (===) for comparison
"forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
"immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
"indent" : false, // {int} Number of spaces to use for indentation
"latedef" : true, // true: Require variables/functions to be defined before being used
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty" : true, // true: Prohibit use of empty blocks
"nonbsp" : false, // true: Prohibit "non-breaking whitespace" characters.
"nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : false, // true: Prohibit use of `++` & `--`
"quotmark" : "single", // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : true, // true: Require all defined variables be used
"strict" : false, // true: Requires all functions run in ES5 Strict Mode
"maxparams" : false, // {int} Max number of formal params allowed per function
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
"maxstatements" : false, // {int} Max number statements per function
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
"maxlen" : false, // {int} Max number of characters per line

// Relaxing
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
"boss" : true, // true: Tolerate assignments where comparisons would be expected
"debug" : true, // true: Allow debugger statements e.g. browser breakpoints.
"eqnull" : true, // true: Tolerate use of `== null`
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
"esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`)
"moz" : true, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil" : true, // true: Tolerate use of `eval` and `new Function()`
"expr" : true, // true: Tolerate `ExpressionStatement` as Programs
"funcscope" : true, // true: Tolerate defining variables inside control statements
"globalstrict" : true, // true: Allow global "use strict" (also enables 'strict')
"iterator" : true, // true: Tolerate using the `__iterator__` property
"lastsemic" : true, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
"laxbreak" : true, // true: Tolerate possibly unsafe line breakings
"laxcomma" : true, // true: Tolerate comma-first style coding
"loopfunc" : true, // true: Tolerate functions being defined in loops
"multistr" : true, // true: Tolerate multi-line strings
"noyield" : true, // true: Tolerate generator functions with no yield statement in them.
"notypeof" : true, // true: Tolerate invalid typeof operator values
"proto" : true, // true: Tolerate using the `__proto__` property
"scripturl" : true, // true: Tolerate script-targeted URLs
"shadow" : true, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"sub" : true, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
"supernew" : true, // true: Tolerate `new function () { ... };` and `new Object;`
"validthis" : true, // true: Tolerate using this in a non-constructor function
"-W086" : true, // true: Allow fall-through; see https://github.com/jshint/jshint/issues/18
"-W008" : true, // true: Allow leading decimal point; see https://jslinterrors.com/a-leading-decimal-point-can-be-confused-with-a-dot-a
"-W041" : true, // true: Ignore strict comparison checking; see https://github.com/jshint/jshint/blob/a643f3fec0632249dcd78d0cf5f200d9166b587d/src/messages.js#L115
"-W082" : true, // true: Allow function declarations inside blocks; see https://jslinterrors.com/function-statements-should-not-be-placed-in-blocks
// Relaxing
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
"boss" : true, // true: Tolerate assignments where comparisons would be expected
"debug" : true, // true: Allow debugger statements e.g. browser breakpoints.
"eqnull" : true, // true: Tolerate use of `== null`
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
"esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`)
"moz" : true, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil" : true, // true: Tolerate use of `eval` and `new Function()`
"expr" : true, // true: Tolerate `ExpressionStatement` as Programs
"funcscope" : true, // true: Tolerate defining variables inside control statements
"globalstrict" : true, // true: Allow global "use strict" (also enables 'strict')
"iterator" : true, // true: Tolerate using the `__iterator__` property
"lastsemic" : true, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
"laxbreak" : true, // true: Tolerate possibly unsafe line breakings
"laxcomma" : true, // true: Tolerate comma-first style coding
"loopfunc" : true, // true: Tolerate functions being defined in loops
"multistr" : true, // true: Tolerate multi-line strings
"noyield" : true, // true: Tolerate generator functions with no yield statement in them.
"notypeof" : true, // true: Tolerate invalid typeof operator values
"proto" : true, // true: Tolerate using the `__proto__` property
"scripturl" : true, // true: Tolerate script-targeted URLs
"shadow" : true, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"sub" : true, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
"supernew" : true, // true: Tolerate `new function () { ... };` and `new Object;`
"validthis" : true, // true: Tolerate using this in a non-constructor function
"-W086" : true, // true: Allow fall-through; see https://github.com/jshint/jshint/issues/18
"-W008" : true, // true: Allow leading decimal point; see https://jslinterrors.com/a-leading-decimal-point-can-be-confused-with-a-dot-a
"-W041" : true, // true: Ignore strict comparison checking; see https://github.com/jshint/jshint/blob/a643f3fec0632249dcd78d0cf5f200d9166b587d/src/messages.js#L115
"-W082" : true, // true: Allow function declarations inside blocks; see https://jslinterrors.com/function-statements-should-not-be-placed-in-blocks

// Environments
"browser" : false, // Web Browser (window, document, etc)
"browserify" : false, // Browserify (node.js code in the browser)
"couch" : false, // CouchDB
"devel" : false, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jasmine" : false, // Jasmine
"jquery" : false, // jQuery
"mocha" : true, // Mocha
"mootools" : false, // MooTools
"node" : true, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"qunit" : false, // QUnit
"rhino" : false, // Rhino
"shelljs" : false, // ShellJS
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface
// Environments
"browser" : false, // Web Browser (window, document, etc)
"browserify" : false, // Browserify (node.js code in the browser)
"couch" : false, // CouchDB
"devel" : false, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jasmine" : false, // Jasmine
"jquery" : false, // jQuery
"mocha" : true, // Mocha
"mootools" : false, // MooTools
"node" : true, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"qunit" : false, // QUnit
"rhino" : false, // Rhino
"shelljs" : false, // ShellJS
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface

// Custom Globals
"globals" : {} // additional predefined global variables
// Custom Globals
"globals" : {} // additional predefined global variables
}
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011 Nodejitsu Inc.
Copyright (C) 2011 Charlie Robbins, Ken Perkins, Ross Kukulinski & the Contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ Currently there are nine service types which are handled by pkgcloud:

In our [Roadmap](#roadmap), we plan to add support for more services, such as Queueing, Monitoring, and more. Additionally, we plan to implement more providers for the *beta* services, thus moving them out of *beta*.

### User Agent

By default, all pkgcloud HTTP requests will have a user agent with the library and version: `nodejs-pkgcloud/x.y.z` where `x.y.z` is the current version.

You can get this from a client at any time by calling `client.getUserAgent();`. Some providers may have an additional suffix as a function of the underlying HTTP stacks.

You can also set a custom User Agent prefix:

```javascript
client.setCustomUserAgent('my-app/1.2.3');

// returns "my-app/1.2.3 nodejs-pkgcloud/1.1.0"
client.getUserAgent();
```

<a name="basic-apis"></a>
### Basic APIs for pkgcloud

Expand Down Expand Up @@ -586,7 +601,12 @@ Each instance of `pkgcloud.cdn.Client` returned from `pkgcloud.cdn.createClient`
```

## Tests
For run the tests you will need `mocha@1.9.x` or higher, please install it and then run:
To run the tests you will need `mocha@1.9.x` or higher. You may install all
the requirements with:
``` bash
$ npm install
```
Then run the tests:

``` bash
$ npm test
Expand Down Expand Up @@ -657,7 +677,7 @@ var client = pkgcloud.compute.createClient(options);

client.on('log::*', function(message, object) {
if (object) {
console.log(this.event.split('::')[1] + ' ' + message)
console.log(this.event.split('::')[1] + ' ' + message);
console.dir(object);
}
else {
Expand Down
6 changes: 3 additions & 3 deletions docs/providers/amazon.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ For all of the Amazon services, you create a client with the same options:
```Javascript
var client = require('pkgcloud').compute.createClient({
provider: 'amazon',
keyId: 'your-access-key-id', // access key id
key: 'your-secret-key-id', // secret key
keyId: 'your-access-key-id' // access key id
region: 'us-west-2' // region
});
```

```Javascript
var client = require('pkgcloud').storage.createClient({
provider: 'amazon',
keyId: 'your-access-key-id', // access key id
key: 'your-secret-key-id', // secret key
keyId: 'your-access-key-id' // access key id
region: 'us-west-2' // region
});
```
```
70 changes: 70 additions & 0 deletions docs/providers/hp/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,73 @@ Returns the port in the callback `f(err, port)`
Destroys the specified port

Takes port or portId as an argument and returns the id of the destroyed port in the callback `f(err, portId)`

**Security Groups**

#### client.getSecurityGroups(callback)
Lists all security groups that are available to use on your Openstack account

Callback returns `f(err, securityGroups)` where `securityGroups` is an `Array`

#### client.getSecurityGroup(securityGroup, callback)
Gets specified security group

Takes securityGroup or securityGroupId as an argument and returns the security group in the callback
`f(err, securityGroup)`

#### client.createSecurityGroup(options, callback)
Creates a security group with the options specified

Options are as follows:

```js
{
name: 'securityGroupName', // required, name of security group
description : 'security group description', // optional, description of security group
tenantId : 'tenantId' // optional, The ID of the tenant who owns the security group. Admin-only
}
```
Returns the created security group in the callback `f(err, securityGroup)`

#### client.destroySecurityGroup(securityGroup, callback)
Destroys the specified security group

Takes securityGroup or securityGroupId as an argument and returns the id of the destroyed security group in the callback `f(err, securityGroupId)`

**Security Group Rules**

#### client.getSecurityGroupRules(callback)
Lists all security group rules that are available to use on your Openstack account

Callback returns `f(err, securityGroupRules)` where `securityGroupRules` is an `Array`

#### client.getSecurityGroupRule(securityGroupRule, callback)
Gets specified security group rule

Takes securityGroupRule or securityGroupRuleId as an argument and returns the security group rule in the callback
`f(err, securityGroupRule)`

#### client.createSecurityGroupRule(options, callback)
Creates a security group rule with the options specified

Options are as follows:

```js
{
securityGroupId: 'securityGroupId', // required, The security group ID to associate with this security group rule.
direction: 'ingress|egress', // required, The direction in which the security group rule is applied.
ethertype: 'IPv4|IPv6', // optional,
portRangeMin: portNumber, // optional, The minimum port number in the range that is matched by the security group rule.
portRangeMax: portNumber, // optional, The maximum port number in the range that is matched by the security group rule.
protocol: 'tcp|udp|icmp', // optional, The protocol that is matched by the security group rule
remoteGroupId: 'remote group id', // optional, The remote group ID to be associated with this security group rule. You can specify either this or remoteIpPrefix.
remoteIpPrefix: 'remote IP prefix', // optional, The remote IP prefix to be associated with this security group rule. You can specify either this or remoteGroupId.
tenantId : 'tenantId' // optional, The ID of the tenant who owns the security group rule. Admin-only
}
```
Returns the created security group rule in the callback `f(err, securityGroupRule)`

#### client.destroySecurityGroupRule(securityGroupRule, callback)
Destroys the specified security group rule

Takes securityGroupRule or securityGroupRuleId as an argument and returns the id of the destroyed security group rule in the callback `f(err, securityGroupRuleId)`
Loading

0 comments on commit 7cfad69

Please sign in to comment.