psconfig/PWA configuration parser
Project description
psconfig-client is a python library to parse perfSONAR psconfig/PWA mesh configuration files
Synopsis:
import psconfig.api
import logging
import sys
log = logging.getLogger()
if __name__ == '__main__':
log.setLevel(logging.DEBUG)
formatter = logging.Formatter(fmt='%(message)s')
fh = logging.StreamHandler(stream=sys.stdout)
fh.setFormatter(formatter)
log.addHandler(fh)
# url supports host auto-url, particular mesh or top level mesh directory
# for https you can pass hostcert/key and verify flag, which are all passed to the requests library call
x = psconfig.api.PSC('url', hostcert=None, hostkey=None, verify=False)
# get all hosts from all groups
print(x.get_all_hosts())
# get all hosts from the group X
print(x.get_hosts_by_group('X'))
# get all hosts from the groups X, Y, Z
print(x.get_hosts_by_group('X', 'Y', 'Z'))
# get all hosts from all groups except A
print(x.get_hosts_by_group(exclude='A'))
# get test types (trace, throughput, latency, etc.) per host
for h in x.get_hosts_by_group():
print(h, x.get_test_types(h))
# get site name of a host
print(x.get_site('<hostname>')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
psconfig-client-0.1.2.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for psconfig_client-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f590cad6759bcbc328322f10e25e6b5b7bec3c24e5cab8f45db24f9f0a401df4 |
|
MD5 | ecadf599038d085a651f1a938d9e77c3 |
|
BLAKE2b-256 | e095bcf9fa345585b695c7520e5470b01242f5e94e3e6990aad12539891d5ff7 |