Skip to content

Commit

Permalink
Merge branch 'provision263' of github.com:PlayNetwork/playnetwork-sdk…
Browse files Browse the repository at this point in the history
…-nodejs into provision263
  • Loading branch information
cmerchant committed Oct 18, 2017
2 parents 4402e86 + 4c8681d commit befb301
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ This module can be used to interact with Playnetwork's socket-io service, https:
* [emit](#emit)


- - -

### Provision

This module can be used to interact with the [Provision API](https://provision-api.apps.playnetwork.com/v1/docs) to get activation information such as clientId/sharedSecret and a list of apps needed for installation or update.

* [getApplicationsStream](#getApplicationsStream)
* [getClientCredentialsStream](#getClientCredentialsStream)

- - -

### Settings
Expand Down Expand Up @@ -213,6 +222,9 @@ The supported options are as follows:
* `player`
* `host` - the hostname of the playerservice app
* `secure` - defaults to `true`, defines when the API uses TLS
* `provision`
* `host` - the hostname of the provision API
* `secure` - defaults to `true`, defines when the API uses TLS
* `settings`
* `host` - the hostname
* `secure` -
Expand All @@ -238,6 +250,9 @@ var
player : {
host : 'https://player-svc.apps.playnetwork.com'
},
provision : {
host : 'sandbox-provision-api.apps.playnetwork.com'
},
settings : {
host : 'sandbox-settings-api.apps.playnetwork.com'
}
Expand Down Expand Up @@ -1442,6 +1457,62 @@ client

- - -

### Provision Module

The provision module is designed to simplify interaction with the [PlayNetwork Playback API](https://provision-api.apps.playnetwork.com/v1/docs). This module supports the following methods:


#### #getApplicationsStream

This method can be used to retrieve a stream that when read will contain a yml files that can be consumed by docker compose

**Usage:** `client.provision.getApplicationsStream(options)`

* `options` - _(optional)_ - can be used to supply authorization headers such as clientId/secret i.e. can override defaults

```javascript
client
.provision
.getApplicationsStream({
'x-client-id': 'test',
'x-authentication-token': 'test'
})
.then((applicaitonsYmlStream) => {
// read applications stream
}).catch((err) => {
console.error(err);
});
```

[back to top](#usage)

#### #getClientCredentialsStream

This method can be used to retrieve a stream that when read will contain a client ID and shared secret that the device can use to interact with Playnetwork APIs. The provision module will use a default credential set initially if there are no actual credentials defined.

**Usage:** `client.provision.getClientCredentialsStream(deviceId, options)`

* `deviceId` - _(required)_ - defines the device identifier, in most cases, the mac address of the device
* `options` - _(optional)_ - can be used to supply authorization headers such as clientId/secret i.e. can override defaults

```javascript
client
.provision
.getClientCredentialsStream({
'x-client-id': 'test',
'x-authentication-token': 'test'
})
.then((credentialsStream) => {
// read credentials stream
}).catch((err) => {
console.error(err);
});
```

[back to top](#usage)

- - -

### Settings Module

The settings module is designed to simplify interaction with the [PlayNetwork Settings API](https://curio-settings-api.apps.playnetwork.com/v0/docs). This module supports the following methods:
Expand Down

0 comments on commit befb301

Please sign in to comment.