Skip to content

leannmak/DisconfPythonAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disconf Python API

Build Status Coverage Status

A simple way to connect to Disconf-Web api, (c) 2017.

Prerequests

  • python 2.7
  • git
  • easy_install && pip
  • pyenv && pyenv-virtualenv

Usage

$ git clone https://github.com/leannmak/DisconfPythonAPI.git
$ cd DisconfPythonAPI
$ pip install -r requirements.txt
$ flake8
$ nosetests -v --with-coverage --cover-package=dapi --exe
$ tox

Examples

# please set your own disconf service parameters in 'constants.py' first of all
from dapi import DisconfAPI

dapi = DisconfAPI()
dapi.login()
# GET /api/app/list
app = dapi.app_list.get()['page']['result'][0]
# GET /api/env/list
env = dapi.env_list.get()['page']['result'][0]
# GET /api/web/config/versionlist
version = dapi.web_config_versionlist.get(appId=app['id'])['page']['result'][0]
# POST /api/web/config/file
with open('test', 'rb') as myfile:
    print dapi.web_config_file.post(appId=app['id'], envId=env['id'], version=version, myfilerar=myfile)

Disconf-Web API List

http://disconf.readthedocs.io/zh_CN/latest/tutorial-web/src/12-open-api-for-web.html

About

A simple way to connect to Disconf-Web api.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages