Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Files for monitor-register, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size monitor_register-1.0.3-py3-none-any.whl (5.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size monitor_register-1.0.3.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page