npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cisco-tp-client

v0.1.0

Published

A node.js API client for Cisco Telepresence-enabled endpoints

Downloads

3

Readme

cisco-tp-client Build Status Coverage Status XO code style Stellaris Module

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.

Install

$ npm install --save cisco-tp-client

Usage

const ciscoTPClient = require('cisco-tp-client');

const sx20 = ciscoTpClient({
  username: 'brandon',
  password: 'password123'
}, '192.168.0.2');

sx20
  .getXml('/Status/Audio')
  .then(response => console.log); // sx20 Audio Status XML

API

ciscoTpClient(credentials, ip)

credentials

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 |

ip

Required Type: string

The IP address of the TP unit

Client Properties

credentials

Type: Object Props: user and pass

The credentials passed in, which are used for the request to authenticate with.

ip

Type: String

The IP address where request are being made to.

lastOptions

Type: Object

The last set of request options the client has executed with, this can be useful for debugging purposes.

Client Methods

getConfiguration()

Get the complete Configuration XML document.

getCommands()

Get the complete Commands XML document.

getStatus()

Get the complete Status XML document.

getValuespace()

Get the complete Valuespace XML document.

getXml(XPath)

Get a subset of a XML document per specified XPath.

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.

putXml(xmlDocument)

Set a particular setting by putting an XML document.

putXmlWithForm(xmlDocument)

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.

xmlDocument

Required Type: String (XML)

The XML document to be put.

Example XML Document: Setting a System Name
<Configuration>
	<SystemUnit>
		<Name>newName</Name>
	</SystemUnit>
</Configuration>

setHttpFeedback(settings)

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

settings

| 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 - feedbackSlot

Avoid 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."
Example: Setting Multiple Feedback Expressions
client
  .setHttpFeedback({
     feedbackSlot: 1,
     serverUrl: 'http://webhookUrl.com/test',
     expressions: [
       '/Event/CallDisconnect',
       '/Event/Reboot',
       '/Status/Call`
     ]
   })
   .then(success => console.log);

unsetHttpFeedback(feedbackSlot)

Unsets/unregister any HTTP feedback on a particular feedback slot.

feedbackSlot

Type: int

A slot to unregister the feedback expressions.

Authors

Related

This module is one out of the many modules available in the :sparkles: Stellaris Ecosystem:

  • tp-bulk-feedback - A plugin for cisco-tp-client to set HTTP Feedback expressions on a list of TelePresence units with CLI support and local file.
  • tp-json-formatter - A module that formats HTTP Feedback JSON responses from Cisco TelePresence units in a simpler, flatter JSON format.

Contribute

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 🙃!

License

MIT © Cisco Innovation Edge