Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cisco-ce/pyxows
Python bindings for Cisco Collaboration Endpoint XAPI over WebSockets
https://github.com/cisco-ce/pyxows
Last synced: about 2 months ago
JSON representation
Python bindings for Cisco Collaboration Endpoint XAPI over WebSockets
- Host: GitHub
- URL: https://github.com/cisco-ce/pyxows
- Owner: cisco-ce
- License: mit
- Created: 2019-04-23T08:31:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-09T09:25:30.000Z (over 2 years ago)
- Last Synced: 2024-07-07T00:38:46.125Z (2 months ago)
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 18
- Watchers: 7
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-xapi - pyxows - Python bindings for Cisco Collaboration Endpoint xAPI over WebSockets (by Cisco CE). (Building Blocks)
README
# Cisco Telepresence XAPI over WebSockets, python library.
Python version required: 3.7 or newer.
## Description
This library allows you to connect to a Cisco Telepresence endpoint running CE
software version 9.7 or later using jsonrpc over websocket. There is also a
command-line utility built on top of the library.The API itself is documented at https://www.cisco.com/c/dam/en/us/td/docs/telepresence/endpoint/api/collaboration-endpoint-software-api-transport.pdf
## Installing
From PyPi
pip install [--user] xows
From a checkout of the git repo
python setup.py install [--user]
## Requirements
Websockets should be set to `FollowHTTPService` and HTTP Mode should be set to either `HTTPS` or `HTTP/HTTPS`.
## Usage example
```py
import xows
import asyncioasync def start():
async with xows.XoWSClient('10.10.10.1', username='admin1', password='') as client:
def callback(data, id_):
print(f'Feedback (Id {id_}): {data}')print('Status Query:',
await client.xQuery(['Status', '**', 'DisplayName']))print('Get status:',
await client.xGet(['Status', 'Audio', 'Volume']))
print('Get configuration:',
await client.xGet(['Configuration', 'SIP', 'Proxy', 1, 'Address']))print('Command:',
await client.xCommand(['Audio', 'Volume', 'Set'], Level=60))print('Configuration:',
await client.xSet(['Configuration', 'Audio', 'DefaultVolume'], 50))print('Subscription 0:',
await client.subscribe(['Status', 'Audio', 'Volume'], callback, True))await client.wait_until_closed()
asyncio.run(start())
```For more usage examples, check out the clixows script. It's source is found
under `xows/__main__.py` and it can be invoked using `python3 -m xows`, or,
after install, as `clixows`Note that piping output from python scripts to other commands doesn't work well
unless you switch to unbuffered output, so e.g. if you want timestamping using
`ts(1)` you need to do e.g.python3 -u -m xows my-endpoint feedback '**' | ts