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
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
│ └── log-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
monitor_register-1.0.1.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for monitor_register-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 685d5d798831c6ddc588af92b4c614eb73cf969f792d334e707dc7e736f26b76 |
|
MD5 | 92d1c0ae1a08f1c428eaf227514fe249 |
|
BLAKE2b-256 | 962d08b619d5918421277961fba0f250753d1fab0c446a9218985409003bfa4f |