# Path: qiniu/http.py
# USER_AGENT = 'QiniuPython/{0} ({1}; ) Python/{2}'.format(
#     __version__, _sys_info, _python_ver)
# def __return_wrapper(resp):
# def _init():
# def _post(url, data, files, auth, headers=None):
# def _put(url, data, files, auth, headers=None):
# def _get(url, params, auth, headers=None):
#     def __init__(self, token):
#     def __call__(self, r):
# def _post_with_token(url, data, token):
# def _post_with_token_and_headers(url, data, token, headers):
# def _post_file(url, data, files):
# def _post_with_auth(url, data, auth):
# def _get_with_auth(url, data, auth):
# def _post_with_auth_and_headers(url, data, auth, headers):
# def _get_with_auth_and_headers(url, data, auth, headers):
# def _post_with_qiniu_mac_and_headers(url, data, auth, headers):
# def _put_with_auth(url, data, auth):
# def _put_with_token_and_headers(url, data, auth, headers):
# def _put_with_auth_and_headers(url, data, auth, headers):
# def _put_with_qiniu_mac_and_headers(url, data, auth, headers):
# def _post_with_qiniu_mac(url, data, auth):
# def _get_with_qiniu_mac(url, params, auth):
# def _get_with_qiniu_mac_and_headers(url, params, auth, headers):
# def _delete_with_qiniu_mac(url, params, auth):
# def _delete_with_qiniu_mac_and_headers(url, params, auth, headers):
#     def __init__(self, response, exception=None):
#     def ok(self):
#     def need_retry(self):
#     def connect_failed(self):
#     def __str__(self):
#     def __repr__(self):
#     def __check_json(self, reponse):
# class _TokenAuth(AuthBase):
# class ResponseInfo(object):


from qiniu import http
from qiniu.compat import is_py2
from qiniu.compat import is_py3
import json
import hashlib
        import urllib2
        import urllib.parse
        req = {}
        req.update({"domains": ';'.join(domains)})
        req.update({"day": log_date})

        body = json.dumps(req)
        url = '{0}/v2/tune/log/list'.format(self.server)
        return self.__post(url, body)

    def put_httpsconf(self, name, certid, forceHttps=False):
        """
        修改证书，文档 https://developer.qiniu.com/fusion/api/4246/the-domain-name#11

        Args:
           domains:     域名name
           CertID:      证书id，从上传或者获取证书列表里拿到证书id
           ForceHttps:  是否强制https跳转

        Returns:
           {}
        """
        req = {}
        req.update({"certid": certid})
        req.update({"forceHttps": forceHttps})

        body = json.dumps(req)
        url = '{0}/domain/{1}/httpsconf'.format(self.server, name)
        return self.__post(url, body)

    def __post(self, url, data=None):
        headers = {'Content-Type': 'application/json'}

# Path: qiniu/http.py
# USER_AGENT = 'QiniuPython/{0} ({1}; ) Python/{2}'.format(
#     __version__, _sys_info, _python_ver)
# def __return_wrapper(resp):
# def _init():
# def _post(url, data, files, auth, headers=None):
# def _put(url, data, files, auth, headers=None):
# def _get(url, params, auth, headers=None):
#     def __init__(self, token):
#     def __call__(self, r):
# def _post_with_token(url, data, token):
# def _post_with_token_and_headers(url, data, token, headers):
# def _post_file(url, data, files):
# def _post_with_auth(url, data, auth):
# def _get_with_auth(url, data, auth):
# def _post_with_auth_and_headers(url, data, auth, headers):
# def _get_with_auth_and_headers(url, data, auth, headers):
# def _post_with_qiniu_mac_and_headers(url, data, auth, headers):
# def _put_with_auth(url, data, auth):
# def _put_with_token_and_headers(url, data, auth, headers):
# def _put_with_auth_and_headers(url, data, auth, headers):
# def _put_with_qiniu_mac_and_headers(url, data, auth, headers):
# def _post_with_qiniu_mac(url, data, auth):
# def _get_with_qiniu_mac(url, params, auth):
# def _get_with_qiniu_mac_and_headers(url, params, auth, headers):
# def _delete_with_qiniu_mac(url, params, auth):
# def _delete_with_qiniu_mac_and_headers(url, params, auth, headers):
#     def __init__(self, response, exception=None):
#     def ok(self):
#     def need_retry(self):
#     def connect_failed(self):
#     def __str__(self):
#     def __repr__(self):
#     def __check_json(self, reponse):
# class _TokenAuth(AuthBase):
# class ResponseInfo(object):


# Path: qiniu/services/cdn/manager.py
from qiniu import http
from qiniu.compat import is_py2
from qiniu.compat import is_py3
import json
import hashlib
        import urllib2
        import urllib.parse

        req = {}
        req.update({"domains": ';'.join(domains)})
        req.update({"day": log_date})

        body = json.dumps(req)
        url = '{0}/v2/tune/log/list'.format(self.server)
        return self.__post(url, body)

    def put_httpsconf(self, name, certid, forceHttps=False):
        """
        修改证书，文档 https://developer.qiniu.com/fusion/api/4246/the-domain-name#11

        Args:
           domains:     域名name
           CertID:      证书id，从上传或者获取证书列表里拿到证书id
           ForceHttps:  是否强制https跳转

        Returns:
           {}
        """
        req = {}
        req.update({"certid": certid})
        req.update({"forceHttps": forceHttps})

        body = json.dumps(req)
        url = '{0}/domain/{1}/httpsconf'.format(self.server, name)
        return self.__post(url, body)

    def __post(self, url, data=None):
        headers = {'Content-Type': 'application/json'}

        return http._post_with_auth_and_headers(url, data, self.auth, headers)