Giter Club home page Giter Club logo

mailinabox-api-py's Introduction

mailinabox-api

Build & Publish

Python client SDK for the Mail-in-a-Box API.

  • API version: 0.51.0
  • Package version: 0.51.1

https://pypi.org/project/mailinabox-api

NOTE: This package is auto-generated from the Mail-In-A-Box OpenAPI spec.

Requirements

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/badsyntax/mailinabox-api-py.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/badsyntax/mailinabox-api-py.git)

Then import the package:

import mailinabox_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import mailinabox_api

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function

import time
import mailinabox_api
from mailinabox_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://box.example.com/admin
# See configuration.py for a list of all supported configuration parameters.
configuration = mailinabox_api.Configuration(
    host = "https://box.example.com/admin"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration = mailinabox_api.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)


# Enter a context with an instance of the API client
with mailinabox_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = mailinabox_api.DNSApi(api_client)
    qname = 'qname_example' # str | DNS query name.
    body = 1.2.3.4 # str | 

    try:
        # Add DNS custom A record
        api_response = api_instance.add_dns_custom_a_record(qname, body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DNSApi->add_dns_custom_a_record: %s\n" % e)
    

Documentation for API Endpoints

All URIs are relative to https://box.example.com/admin

Class Method HTTP request Description
DNSApi add_dns_custom_a_record POST /dns/custom/{qname} Add DNS custom A record
DNSApi add_dns_custom_record POST /dns/custom/{qname}/{rtype} Add DNS custom record
DNSApi add_dns_secondary_nameserver POST /dns/secondary-nameserver Add DNS secondary nameserver
DNSApi get_dns_custom_a_records_for_q_name GET /dns/custom/{qname} Get DNS custom A records
DNSApi get_dns_custom_records GET /dns/custom Get DNS custom records
DNSApi get_dns_custom_records_for_q_name_and_type GET /dns/custom/{qname}/{rtype} Get DNS custom records
DNSApi get_dns_dump GET /dns/dump Get DNS dump
DNSApi get_dns_secondary_nameserver GET /dns/secondary-nameserver Get DNS secondary nameserver
DNSApi get_dns_zonefile GET /dns/zonefile/{zone} Get DNS zonefile
DNSApi get_dns_zones GET /dns/zones Get DNS zones
DNSApi remove_dns_custom_a_record DELETE /dns/custom/{qname} Remove DNS custom A record
DNSApi remove_dns_custom_record DELETE /dns/custom/{qname}/{rtype} Remove DNS custom record
DNSApi update_dns POST /dns/update Update DNS
DNSApi update_dns_custom_a_record PUT /dns/custom/{qname} Update DNS custom A record
DNSApi update_dns_custom_record PUT /dns/custom/{qname}/{rtype} Update DNS custom record
MFAApi mfa_status POST /mfa/status Retrieve MFA status for you or another user
MFAApi mfa_totp_disable POST /mfa/disable Disable multi-factor authentication for you or another user
MFAApi mfa_totp_enable POST /mfa/totp/enable Enable TOTP authentication
MailApi add_mail_user POST /mail/users/add Add mail user
MailApi add_mail_user_privilege POST /mail/users/privileges/add Add mail user privilege
MailApi get_mail_aliases GET /mail/aliases Get mail aliases
MailApi get_mail_domains GET /mail/domains Get mail domains
MailApi get_mail_user_privileges GET /mail/users/privileges Get mail user privileges
MailApi get_mail_users GET /mail/users Get mail users
MailApi remove_mail_alias POST /mail/aliases/remove Remove mail alias
MailApi remove_mail_user POST /mail/users/remove Remove mail user
MailApi remove_mail_user_privilege POST /mail/users/privileges/remove Remove mail user privilege
MailApi set_mail_user_password POST /mail/users/password Set mail user password
MailApi upsert_mail_alias POST /mail/aliases/add Upsert mail alias
SSLApi generate_sslcsr POST /ssl/csr/{domain} Generate SSL CSR
SSLApi get_ssl_status GET /ssl/status Get SSL status
SSLApi install_ssl_certificate POST /ssl/install Install SSL certificate
SSLApi provision_ssl_certificates POST /ssl/provision Provision SSL certificates
SystemApi get_system_backup_config GET /system/backup/config Get system backup config
SystemApi get_system_backup_status GET /system/backup/status Get system backup status
SystemApi get_system_privacy_status GET /system/privacy Get system privacy status
SystemApi get_system_reboot_status GET /system/reboot Get system reboot status
SystemApi get_system_status POST /system/status Get system status
SystemApi get_system_updates GET /system/updates Get system updates
SystemApi get_system_upstream_version POST /system/latest-upstream-version Get system upstream version
SystemApi get_system_version GET /system/version Get system version
SystemApi reboot_system POST /system/reboot Reboot system
SystemApi update_system_backup_config POST /system/backup/config Update system backup config
SystemApi update_system_packages POST /system/update-packages Update system packages
SystemApi update_system_privacy POST /system/privacy Update system privacy
UserApi get_me GET /me Get user information
WebApi get_web_domains GET /web/domains Get web domains
WebApi update_web POST /web/update Update web

Documentation For Models

Documentation For Authorization

basicAuth

  • Type: HTTP basic authentication

mailinabox-api-py's People

Contributors

badsyntax avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mailinabox-api-py's Issues

urllib3.exceptions.MaxRetryError:

Good day,
I have been trying to solve this for a long time but I am stack on the error bellow

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "C:\Odoo\15\python\lib\site-packages\urllib3\connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "C:\Odoo\15\python\lib\site-packages\urllib3\util\connection.py", line 57, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Odoo\15\python\lib\socket.py", line 752, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Odoo\15\python\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Odoo\15\python\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "C:\Odoo\15\python\lib\site-packages\urllib3\connectionpool.py", line 839, in _validate_conn
conn.connect()
File "C:\Odoo\15\python\lib\site-packages\urllib3\connection.py", line 301, in connect
conn = self._new_conn()
File "C:\Odoo\15\python\lib\site-packages\urllib3\connection.py", line 168, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x0000020BE23EB448>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Odoo\15\server\odoo\addons\base\models\ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "C:\Odoo\15\server\odoo\http.py", line 688, in dispatch
result = self._call_function(**self.params)
File "C:\Odoo\15\server\odoo\http.py", line 360, in _call_function
return checked_call(self.db, *args, **kwargs)
File "C:\Odoo\15\server\odoo\service\model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "C:\Odoo\15\server\odoo\http.py", line 349, in checked_call
result = self.endpoint(*a, **kw)
File "C:\Odoo\15\server\odoo\http.py", line 917, in call
return self.method(*args, **kw)
File "C:\Odoo\15\server\odoo\http.py", line 536, in response_wrap
response = f(*args, **kw)
File "C:\Odoo\15\server\odoo\addons\web\controllers\main.py", line 1352, in call_button
action = self._call_kw(model, method, args, kwargs)
File "C:\Odoo\15\server\odoo\addons\web\controllers\main.py", line 1340, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "C:\Odoo\15\server\odoo\api.py", line 464, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "C:\Odoo\15\server\odoo\api.py", line 451, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "c:\users\user\documents\addons\imbra\imbra_hosting\models\host_order.py", line 377, in approve_account
self.add_mail_user_domain()
File "c:\users\user\documents\addons\imbra\imbra_hosting\models\host_order.py", line 548, in add_mail_user_domain
api_response = api_instance.add_mail_user(email, password, privileges)
File "C:\Odoo\15\python\lib\site-packages\mailinabox_api\api\mail_api.py", line 62, in add_mail_user
email, password, privileges, **kwargs
File "C:\Odoo\15\python\lib\site-packages\mailinabox_api\api\mail_api.py", line 191, in add_mail_user_with_http_info
collection_formats=collection_formats,
File "C:\Odoo\15\python\lib\site-packages\mailinabox_api\api_client.py", line 413, in call_api
_host,
File "C:\Odoo\15\python\lib\site-packages\mailinabox_api\api_client.py", line 204, in __call_api
_request_timeout=_request_timeout,
File "C:\Odoo\15\python\lib\site-packages\mailinabox_api\api_client.py", line 481, in request
body=body,
File "C:\Odoo\15\python\lib\site-packages\mailinabox_api\rest.py", line 343, in POST
body=body,
File "C:\Odoo\15\python\lib\site-packages\mailinabox_api\rest.py", line 191, in request
headers=headers,
File "C:\Odoo\15\python\lib\site-packages\urllib3\request.py", line 72, in request
**urlopen_kw)
File "C:\Odoo\15\python\lib\site-packages\urllib3\request.py", line 150, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "C:\Odoo\15\python\lib\site-packages\urllib3\poolmanager.py", line 324, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "C:\Odoo\15\python\lib\site-packages\urllib3\connectionpool.py", line 667, in urlopen
**response_kw)
File "C:\Odoo\15\python\lib\site-packages\urllib3\connectionpool.py", line 667, in urlopen
**response_kw)
File "C:\Odoo\15\python\lib\site-packages\urllib3\connectionpool.py", line 667, in urlopen
**response_kw)
File "C:\Odoo\15\python\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Odoo\15\python\lib\site-packages\urllib3\util\retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Odoo\15\server\odoo\http.py", line 644, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "C:\Odoo\15\server\odoo\http.py", line 302, in _handle_exception
raise exception.with_traceback(None) from new_cause
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='box.example.com', port=443): Max retries exceeded with url: /admin/mail/users/add (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0000020BE23EB448>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

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.