Hello world

Learn how to get started with Onna and start collecting data


💡 3 min read

This article explains how to get started with Onna and start collecting data by running a Python program on Linux or macOS.

If you want to know more about how specific Onna features work, check our Help Center.

# Install requirements

To complete the tutorial, install this software on your machine:

# Create an account

Create a trial Onna account from the Sign up page.

# Create a Workspace

A Workspace is a collaboration space in Onna where data is collected. Learn how to create one by visiting our Help Center.

# Set the virtual environment

Now create a directory for your virtual environment, start the virtual environment, and then activate it.

mkdir ~/onna-six-mins
cd ~/onna-six-mins
python3 -m venv venv
source venv/bin/activate
1
2
3
4

After activating the virtual environment, install aiohttp in your virtual environment directory.

pip install aiohttp==3.6.3
1

# Create a Datasource

The script imports dependencies, declares your account information, and then generates an auth token. Finally, it creates a Datasource in your Workspace.

  1. Download the sample file to the ~/onna-six-mins directory.
  1. Edit the file to add your account information.




 
 
 
 
 
 
 

import asyncio
import aiohttp
import json

base_url = "https://enterprise.onna.com"
container = "CONTAINER"
scope = account = "MYACCOUNT"
auth_code_url = f"{base_url}/api/{container}/{account}/@oauthgetcode?client_id=canonical&scope={account}"
workspace_name = "MYWORKSPACE"
username = "YOUR@EMAIL.COM"
password = "Y0urP#ssWoRD!*"
1
2
3
4
5
6
7
8
9
10
11

Where:

  • CONTAINER is the name of your Onna account. For more info, see the glossary.
  • SCOPE is the name of your Onna account. For more info, see the glossary.
  • MYACCOUNT is the name of your Onna account
  • MYWORKSPACE is the ID of your workspace from the URL. For example, demoworkspace-ItkUJW
  • YOUR@EMAIL.COM is the email you signed up with
  • Y0urP#ssWoRD!* is your super-secret account password
  1. Run the script.
./venv/bin/python onnasixmins.py
1

Info

After running the script, remember to deactivate your virtual environment by typing deactivate in your shell.

# Check the Workspace

Once the request is processed, a new Datasource called Confluence will show in your Workspace. Open that Datasource to find the collected dummy data.

Tip

Because of the way requests are queued and processed, data may not populate your Workspace immediately. For this reason, check back at regular intervals for the data to show.

Onna demo Datasource

Last Updated: 11/13/2020, 8:17:00 AM