def get_bucket_info(bucket, auth): """ Args: bucket - 存储空间名字 获取存储空间所在的存储区域 """ url = '%s/bucket/%s' % (config.BUCKET_RS_HOST, bucket) return http._post_with_auth_and_headers(url, None, auth, headers={"Content-Type": "application/x-www-form-urlencoded"})
def tool_get_task(self, request_id): req = {} req['requestId'] = request_id body = json.dumps(req) url = '{0}/v2/tune/refresh/list'.format(self.manager.server) headers = {'Content-Type': 'application/json'} ret, info = http._post_with_auth_and_headers(url, body, self.manager.auth, headers) yield QiNiuCDNTool.get_models(ret['items'][0])
def __post(self, url, data=None): headers = {'Content-Type': 'application/json'} return http._post_with_auth_and_headers(url, data, self.auth, headers)
def __post(self, url, data=None): headers = {'Content-Type': 'application/json'} return http._post_with_auth_and_headers(url, data, self.auth, headers)