Git Product home page Git Product logo

ispmanager-python-api's Introduction

ISPManager Python API

sorry, english version is not ready yet

Реализация клиента к API панели ISPManager на языке Python. PHP версию вы можете найти тут https://github.com/StereoFlo/ispmanager-php-api. Суть работы, та же, вы добавляете в isp_manager/func/domain/ свою функцию и работаете с ней

Пример вызова приведен в файле app.py:

Необходимые импорты

from isp_manager.credentials import Credentials
from isp_manager.server import Server
from isp_manager import IspManager
from isp_manager.func.domain import Add

Создаем объекты сервера и пользователя У конструктора объекта Server могут быть дополнительные параметры: порт и схема работы (https/http)

user = Credentials('user', 'password')
server = Server('delta.hoster.net')

Создаюм объект функции (в данном случае функция это добавление домена)

func = Add()
func.set_additional({
    'name': 'domain.ru',
    'ip': '127.0.0.1',
    'ns': 'dns3.domain.net. dns1.domain.net. dns2.domain.net.',
    'ns_list': '',
    'mx': 'mail',
    'mx_list': '',
    'elid': '',
    'sok': 'ok',
})

Создаем объект класса для работы со всеми данными установленными выше, работаем с ними и получаем результат

isp_manager = IspManager()
isp_manager.set_server(server)
isp_manager.set_user(user)
isp_manager.set_func(func)
print(isp_manager.execute())

ispmanager-python-api's People

Contributors

stereoflo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

efr2et maxsoft

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.