Skip to content

HyperviewHQ/sample_code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a repository of API integration examples for Hyperview. The hope is that Hyperview users would find them useful.

Prerequisites

  1. A Hyperview instance.
  2. API client with the appropriate permissions. API Clients can be created by a Hyperview Administrator.

Please review the API documentation and update the code to suite your needs.

Languages

PowerShell

  • Scripts are tested with PowerShell 7.x.
  • Configuration must be kept in a conf directory next to the script. Full examples are included with the source.
  • Depending on your machine's OS and security policy you may need to to run:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

This sets the execution policy to bypass for the current PowerShell session.

Python

Code has been tested with Python 3.11.2 on Debian 12.

  1. Change directory into Python folder
cd python
  1. Initialize and activate virtual environment
python3 -m venv .hv_env
source .hv_env/bin/activate
  1. Create settings and edit setting file
cp .env.example .env

# Use your favorite editor to edit the .env file
vi .env
  1. Install requirements
pip install -r requirements.txt
  1. Run example script(s). For example
./01_query_assets_and_get_sensors.py
  1. When you are done, deactivate the virtual environment
deactivate

Java

Code has been tested with OpenJDK 21 and Gradle 8.13.

  1. Change directory into Java example folder
cd java/list_assets_and_sensors 
  1. Create settings and edit setting file
cp app/assets/.env.example app/assets/.env

# Use your favorite editor to edit the .env file
vi app/assets/.env
  1. Build and run the application
gradle run

Contribution

Contributions are welcome.

About

Hyperview API integration samples

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •