onevizion wraps the version 3 API for a OneVizion system, and provides a few optional other utilities.
Project description
# API-v3
Version 3 API for OneVizion
This is a wrapper for simplifying API connection to a OneVizion system.
Install with
pip install onevizion
The Parameters.json file is not necessary, but we added in, since we use it for our scripts, and it keeps hardcoded logins and things our of a script.
All of our scripts use a Parameters.json file, which includes usernames and passwords along with URLs and other configuration. This lets us test locally, then copy a script up unedited, to the production server or UAT server, and it will work correctly using parameters for that system.
That file looks like this:
```python
{
"trackor.onevizion.com": {
"url":"trackor.onevizion.com",
"UserName": "jsmith",
"Password": “xxxxxxxxxxxx"
},
"Veracode": {
"UserName": "jsmith@onevizion.com",
"Password": “xxxxxxxxx"
},
"Folders": {
"Archiva": "/opt/tomcat/data/repositories/releases",
"Git": "/Users/jsmith/GitHub/IKAM/ov"
},
"SMTP_ESRI": {
"UserName": "jsmith@onevizion.com",
"Password": “xxxxxxxxxxxxx",
"Server": "smtp.office365.com",
"Port": "587",
"Security": "STARTTLS",
"To": "jsmith@onevizion.com"
},
"SMTP": {
"UserName": "jsmith@onevizion.com",
"Password": “xxxxxxxxxxxx",
"Server": "smtp.office365.com",
"Port": "587",
"Security": "STARTTLS",
"To": "jsmith@onevizion.com"
},
"AWSCredentials": {
"AccessKey": “AOJBFJQEBFJQEFJEEJBFEJF",
"SecretAccessKey”:”jlknf3kj4nr34rjnwj4nrwj4werwe"
}
}
```
The idea is that you have a token, like “STMP” , or “trackor.onevizion.com”, and it has all the relavent parameter info.
We tried to add some automatic Logging and Messaging for all API connections. It is optional, but can cut down on lines of code if you want to use it.
To implement this, we created a Config stucture so you can pass parameters to ALL instances of the classes you create. This is not elegant, but it cut down on necessary lines of code and made readability much better.
This Config structure is used for Messaging by setting the "Verbosity" item to a number. Vebosity = 0 gives only error messaging, Verbosity = 1 gives a little more information. The higher the number, the more information, although, at teh time of this writing, 2 is the highest used.
for example:
```python
onevizion.Config["Verbosity"] = 1
```
The Logging part is handled in onevizion.Config["Trace"]. Trace is an OrderedDict. This can be used however you need to get a list of Messaging that hapened during the script's run.
Version 3 API for OneVizion
This is a wrapper for simplifying API connection to a OneVizion system.
Install with
pip install onevizion
The Parameters.json file is not necessary, but we added in, since we use it for our scripts, and it keeps hardcoded logins and things our of a script.
All of our scripts use a Parameters.json file, which includes usernames and passwords along with URLs and other configuration. This lets us test locally, then copy a script up unedited, to the production server or UAT server, and it will work correctly using parameters for that system.
That file looks like this:
```python
{
"trackor.onevizion.com": {
"url":"trackor.onevizion.com",
"UserName": "jsmith",
"Password": “xxxxxxxxxxxx"
},
"Veracode": {
"UserName": "jsmith@onevizion.com",
"Password": “xxxxxxxxx"
},
"Folders": {
"Archiva": "/opt/tomcat/data/repositories/releases",
"Git": "/Users/jsmith/GitHub/IKAM/ov"
},
"SMTP_ESRI": {
"UserName": "jsmith@onevizion.com",
"Password": “xxxxxxxxxxxxx",
"Server": "smtp.office365.com",
"Port": "587",
"Security": "STARTTLS",
"To": "jsmith@onevizion.com"
},
"SMTP": {
"UserName": "jsmith@onevizion.com",
"Password": “xxxxxxxxxxxx",
"Server": "smtp.office365.com",
"Port": "587",
"Security": "STARTTLS",
"To": "jsmith@onevizion.com"
},
"AWSCredentials": {
"AccessKey": “AOJBFJQEBFJQEFJEEJBFEJF",
"SecretAccessKey”:”jlknf3kj4nr34rjnwj4nrwj4werwe"
}
}
```
The idea is that you have a token, like “STMP” , or “trackor.onevizion.com”, and it has all the relavent parameter info.
We tried to add some automatic Logging and Messaging for all API connections. It is optional, but can cut down on lines of code if you want to use it.
To implement this, we created a Config stucture so you can pass parameters to ALL instances of the classes you create. This is not elegant, but it cut down on necessary lines of code and made readability much better.
This Config structure is used for Messaging by setting the "Verbosity" item to a number. Vebosity = 0 gives only error messaging, Verbosity = 1 gives a little more information. The higher the number, the more information, although, at teh time of this writing, 2 is the highest used.
for example:
```python
onevizion.Config["Verbosity"] = 1
```
The Logging part is handled in onevizion.Config["Trace"]. Trace is an OrderedDict. This can be used however you need to get a list of Messaging that hapened during the script's run.
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
onevizion-1.0.3.tar.gz
(12.9 kB
view hashes)
Built Distribution
onevizion-1.0.3-py2-none-any.whl
(14.0 kB
view hashes)
Close
Hashes for onevizion-1.0.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9661733dad6a120ddbdacba72d339c2c0368969080296993ce4cf27e2502daad |
|
MD5 | 6e27c3adf25996db5723b2de67c3f033 |
|
BLAKE2b-256 | e1e6e2fff7dc3dcaa51e715bc8438c293eafa9139deed5d24cebdf298c286f62 |