示例#1
0
 def get_enterprise_region_token_from_market(self, tenant_id, enterprise_id, region_name, region_url):
     # 从云市获取数据中心访问信息
     is_pass = True
     try:
         res, data = market_api.get_region_access_token(tenant_id, enterprise_id, region_name)
         is_success = client_auth_service.save_region_access_token(
             data["eid"], region_name, region_url, data['token'], data['key'], data['crt'])
         if not is_success:
             logger.error("save region access token error")
             is_pass = False
     except Exception as e:
         logger.exception(e)
         is_pass = False
     return is_pass
示例#2
0
 def save_region_access_token(self, enterprise_id, region_name, access_url,
                              access_token, key, crt):
     return client_auth_service.save_region_access_token(
         enterprise_id, region_name, access_url, access_token, key, crt)