示例#1
0
 def get(self, request, team_name, *args, **kwargs):
     """
     获取团队未开通的数据中心
     ---
     parameters:
         - name: team_name
           description: 当前团队名字
           required: true
           type: string
           paramType: path
     """
     code = 200
     team = team_services.get_tenant_by_tenant_name(team_name)
     if not team:
         result = general_message(404, "team no found", "团队不存在")
         return Response(result, status=code)
     unopen_regions = region_services.get_team_unopen_region(team_name, team.enterprise_id)
     result = general_message(code, "query the data center is successful.", "数据中心获取成功", list=unopen_regions)
     return Response(result, status=code)
示例#2
0
 def get(self, request, team_name, *args, **kwargs):
     """
     获取团队未开通的数据中心
     ---
     parameters:
         - name: team_name
           description: 当前团队名字
           required: true
           type: string
           paramType: path
     """
     try:
         code = 200
         unopen_regions = region_services.get_team_unopen_region(team_name=team_name)
         result = general_message(code, "query the data center is successful.", "数据中心获取成功", list=unopen_regions)
     except Exception as e:
         code = 500
         logger.exception(e)
         result = error_message(e.message)
     return Response(result, status=code)