Functions to interact with the Seven2one TechStack
Project description
Usage
Connect
from seven2one import *
client = TechStack(host, user, password)
# More parameters
client = TechStack(host, user, password, copyGraphQLString=True)
Logging
By default the Python lib writes logs to console and to the server the use connects to.
Configure log levels and server endpoint by environment variables if needed:
Variable | Description | Default |
---|---|---|
LOGLEVEL | Set the log level for console output | 'INFO' |
LOGLEVEL_SERVER | Set the log level for logs sent to the server (Loki). Log levels are 'ERROR', 'WARNING', 'INFO' and 'DEBUG'. | 'ERROR' |
LOG_TO_SERVER | Disable logging to Loki server | 'TRUE' |
LOG_SERVER | Overwrite the log server endpoint if e.g. running inside the same cluster | 'https://{host}/logging/loki/api/v1/push' |
Basic read operations
client.inventories()
client.items('appartments', references=True)
client.inventoryProperties('appartments')
client.propertyList('appartments', references=True, dataTypes=True)
Write operations
Create inventory
properties = [
{
'dataType': 'DATE_TIME_OFFSET',
'name': 'fieldDATETIMEOFFSET',
'nullable': True
},
{
'dataType': 'BOOLEAN',
'name': 'fieldBOOLEAN',
'nullable': True
}
]
client.createInventory('testInventory', properties)
Add (basic) items
items = [
{
"fieldSTRING": "bla",
"fieldDECIMAL": 0,
"fieldLONG": 0,
"fieldINT": 0,
"fieldBOOLEAN": True,
"fieldDATETIME": "2021-09-14T00:00:00.000Z",
"fieldDATETIMEOFFSET": "2021-09-14T00:00:00.000Z"
}
]
addBasicItems('testInventory', items)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
seven2one-4.0.0.tar.gz
(62.5 kB
view hashes)
Built Distribution
seven2one-4.0.0-py3-none-any.whl
(70.4 kB
view hashes)
Close
Hashes for seven2one-4.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0e9fb3f6d6cdfe6ed356bbcff9c563e53b8b34b65397c520647cf8d268e57a |
|
MD5 | 8d6ed51e1e73c8a5e9b9bd5c08363ca6 |
|
BLAKE2b-256 | 3fc2a3b099c004f371ba7e8e3cb6e2ae85d5b0d24076c9b953d3893ede3d3f5a |