Ejemplo n.º 1
0
 def get_variables(self, request, project_id, cluster_id):
     """获取集群下所有的变量信息"""
     variables = ClusterVariable.get_cluster_vars(cluster_id, project_id)
     return Response({
         "code": 0,
         "message": "OK",
         "count": len(variables),
         "data": variables
     })
Ejemplo n.º 2
0
def get_cluster_variables(project_id, cluster_id):
    """查询集群下的变量"""
    cluster_vars = ClusterVariable.get_cluster_vars(cluster_id, project_id)
    return {info["key"]: info["value"] for info in cluster_vars}