def __init__(self, host, secretId, secretKey, version="SDK_Python_1.3", logger=None): self.host, self.is_https = self.process_host(host) self.secretId = secretId self.secretKey = secretKey self.version = version self.logger = CMQLogger.get_logger() if logger is None else logger self.http = CMQHttp(self.host, logger=logger, is_https=self.is_https) self.sign_method = 'sha1' if self.logger: self.logger.debug( "InitClient Host:%s Version:%s" % (host, version)) self.method = 'POST'
def __init__(self, host, secretId, secretKey, debug=False): """ @type host: string @param host: 访问的url,例如:https://cmq-queue-gz.api.qcloud.com @type secretId: string @param secretId: 用户的secretId, 腾讯云官网获取 @type secretKey: string @param secretKey: 用户的secretKey,腾讯云官网获取 @note: Exception :: CMQClientParameterException host格式错误 """ self.secretId = secretId self.secretKey = secretKey self.debug = debug self.logger = CMQLogger.get_logger() self.cmq_client = CMQClient(host, secretId, secretKey, logger=self.logger)