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 })
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}