Register to monitor server
Project description
OVERVIEW
It will help you generate and register your monitor configuration to the specific monitor server. here is the syntax of input api document: https://github.com/DaYeSquad/sakura-node-ts#doc
Install
pip install monitor-register
Develop
Dependencies
-
miniconda: download in https://conda.io/miniconda.html
-
python dependency: execute
conda env create -f conda_env/monitor-register -
pycharm setting: you need to change your interpreter to the existing conda environment: log-reigster
Directory
.
├── README.md
├── bin
│ ├── ci_lint.sh
│ ├── lint.sh # local lint tool
│ ├── release_test.sh # release to test pypi
│ └── test.sh # test tool, run all tests
├── conda_env
│ └── monitor-register.yml # conda env
├── lint.rc
├── monitor_register
│ ├── __init__.py
│ ├── api_doc
│ │ ├── __init__.py
│ │ └── api_doc.py # process api doc as monitor config
│ ├── monitor
│ │ ├── __init__.py
│ │ └── monitor_config.py # main functions
│ ├── test
│ │ ├── __init__.py
│ │ ├── api_doc_test.py
│ │ ├── const.py
│ │ ├── file_util_test.py
│ │ └── monitor_config_test.py
│ └── util
│ ├── __init__.py
│ └── file_util.py # file util
├── setup.py # setup script
└── test_data
├── apidoc.json
├── config.json
└── test_saved_config.json
Usage
generate file
import datetime
import os
from monitor_register.monitor.monitor_config import save_doc_as_monitor_config
input_file_path = os.getcwd() + '/test_data/config.json'
final_path = '/tmp/test.config.json'
host = 'http://mytest'
date = datetime.datetime(2018, 10, 29, 0, 0, 0, 0)
save_doc_as_monitor_config(input_file_path, final_path, host, 2, 3, 1, date)
register api doc file to monitor server
import datetime
import os
from monitor_register.monitor.monitor_config import register_to_monitor_server
input_file_path = os.getcwd() + '/test_data/config.json'
monitor_token = 'your_token';
url = 'https://monitor_server'
host = 'http://your_host'
date = datetime.datetime(2018, 10, 29, 0, 0, 0, 0)
res = register_to_monitor_server(input_file_path, url, monitor_token, host, 2, 3, 1, date)
if res['data']['code'] == 200:
print("success")
else:
print("failed")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file monitor_register-1.0.3.tar.gz.
File metadata
- Download URL: monitor_register-1.0.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
557e352b712238e2b7f5328f6861bf979ad0aeedaeb255f07d19d28f3a662ce7
|
|
| MD5 |
b5602456342f3ef5df2ca2b5ceef5090
|
|
| BLAKE2b-256 |
4a9ef449b099470e3595df575a80d1392b5f94f8110fb679ea36fbb46edbad78
|
File details
Details for the file monitor_register-1.0.3-py3-none-any.whl.
File metadata
- Download URL: monitor_register-1.0.3-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a515178330be79265e1e2bf289f893971217ac0df6072f1805f21774bb9ef4b1
|
|
| MD5 |
cd0f55101a19b11694b6664d56ffb928
|
|
| BLAKE2b-256 |
21cd6454f584e279309b3d15e2cf15aa2cd368ae229b2c09beb5222534716a17
|