A Node.js API client for Cisco TelePresence endpoints/codecs
cisco-tp-client
is a promise-based Node.js client library to interact with Cisco TelePresence endpoints/codecs (DX Series, SX Series, EX Series) HTTP supported APIs. In addition to the standard available APIs, it handles authentication, and HTTP feedback expressions. It is currently built on top of request
and request-promise-native
.
For detailed information regarding general API codec usage, visit the Cisco Support page for API reference guides on each series.
$ npm install --save cisco-tp-client
const ciscoTPClient = require('cisco-tp-client');
const sx20 = new ciscoTPClient({
username: 'brandon',
password: 'password123'
}, '192.168.0.2');
sx20
.getXml('/Status/Audio')
.then(response => console.log); // sx20 Audio Status XML
Required
Type: object
Properties | Type | Description |
---|---|---|
username OR user | string |
The username for the TP unit |
password OR pass | string |
The password for the TP unit |
Required
Type: string
The IP address of the TP unit
Type: Object
Props: user
and pass
The credentials passed in, which are used for the request to authenticate with.
Type: String
The IP address where request are being made to.
Type: Object
The last set of request options the client has executed with, this can be useful for debugging purposes.
Get the complete Configuration XML document.
Get the complete Commands XML document.
Get the complete Status XML document.
Get the complete Valuespace XML document.
Get a subset of a XML document per specified XPath
.
Required
Type: String
The XPath of the XML Document. (IE: /Status/Camera
).
NOTE: Logic for prepending slash added - if the XPath does not already contain a slash, it is prepended to the XPath.
Set a particular setting by putting an XML document.
Similar to .putXml()
, but instead uses a www-url-form-encoded
as the content-type. This is generally used for better performance when the xmlDocs are non-alphanumeric or small in nature.
Required
Type: String
(XML)
The XML document to be put.
<Configuration>
<SystemUnit>
<Name>newName</Name>
</SystemUnit>
</Configuration>
Set a HTTP feedback notification to monitor a particular XPath. The notifications are posted to the specified serverUrl
(AKA: a webhook url) that are set within the settings parameter.
Format Parameter supported for CE < Version 9.0
Properties | Type | Description | Example |
---|---|---|---|
feedbackSlot | int [1..4] |
The designated feedback slot to be used. | 1 |
serverUrl | string |
The url where the Codec will post the feedback to. | http://yourwebhook.com/feedback |
expressions | array |
A set of feedback expressions, which monitor a particular XPath. | ['/Status/Call', '/Status/Reboot'] |
format | string ["xml" OR "json"] |
The return format of the HTTP feedback payload | 'json' |
β οΈ Note - feedbackSlotAvoid using Feedback Slot 3, when a Cisco TelePresence Management Suite (TMS) is used within the infrastructure.
π« Constraints - expressions
- Codecs are only limited to 15 expressions per a slot.
- Do not register for
/Status
as this will lead to "unpreditable behavior and sluggish behavior."
client
.setHttpFeedback({
feedbackSlot: 1,
serverUrl: 'http://webhookUrl.com/test',
expressions: [
'/Event/CallDisconnect',
'/Event/Reboot',
'/Status/Call`
]
})
.then(success => console.log);
Unsets/unregister any HTTP feedback on a particular feedback slot.
Type: int
A slot to unregister the feedback expressions.
If you found this client useful, don't forget to star this repository and check other related open-source Cisco modules by the Innovation Edge team:
- webex-api-client - A node module to simplify interacting with Cisco WebEx XML-based APIs from the browser or server
- rrule-to-webex - Converts a RRULE (iCalendar RFC-5545) to Cisco's WebEx recurrence repeat XML tree.
- webex-time-zones - π An enumerated list of Cisco WebEx supported time zones
- webex-date - π° Convert a JavaScript date type, RFC 2822, ISO-8601 to the WebEx XML API supported format.
- webex-enum-types - π A JSON mapping of enumerated types for Cisco's WebEx XML API
Pull requests are welcomed and encouraged, please feel free to submit any issues on bugs, feature enhancements, etc. PRs should include associated unit-test and pass all code style requirements. Therefore, for all PRs should run $ npm test
prior to submissions.
Please do not hesistate to reach out for help π!
MIT Β© Cisco Innovation Edge