Add a few examples to the README
diff --git a/README.md b/README.md
index e2b44fc..d627ec3 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,7 @@
*Client constructor will read values for the `apihost`, `namespace` and `api_key` options from the environment if the following parameters are set. Explicit parameter values override these values.*
- __OW_API_HOST, __OW_NAMESPACE and __OW_API_KEY.
+- These parameters are set on Bluemix.
_All methods return a Promise resolved asynchronously with the results. Failures are available through the catch method._
@@ -53,6 +54,14 @@
The following optional parameters are supported:
- `namespace` - set custom namespace for endpoint
+Example to list packages:
+
+```js
+ow.packages.list().then(function (packages) {
+ console.log(packages);
+});
+```
+
### retrieve resource
```
@@ -67,6 +76,15 @@
The following optional parameters are supported:
- `namespace` - set custom namespace for endpoint
+Example to fetch a package by name:
+
+```js
+ow.packages.get({packageName: "mypackage"})
+.then(function (pkg) {
+ console.log(pkg);
+});
+
+
### delete resource
```
@@ -140,6 +158,25 @@
- `package` - JSON object containing parameters for the package body (default: `{}`)
- `namespace` - set custom namespace for endpoint
+Example of updating a package to set parameters (overwrites existing parameters):
+
+```js
+var options = {
+ packageName: "mypackage",
+ package: {
+ parameters: [
+ {key: "colour", value: "green"},
+ {key: "name", value: "Freya"}
+ ]
+ }
+}
+
+ow.packages.update(options)
+.then(function (pkg) {
+ ...
+}
+```
+
### create & update rule
```