示例#1
0
    def get(self, request, cluster_id):
        """Get a single cluster's details with the cluster id.

        The following get parameters may be passed in the GET

        :param cluster_id: the id of the cluster

        The result is a cluster object.
        """
        return senlin.cluster_get(request, cluster_id).to_dict()
示例#2
0
 def get_object(self):
     try:
         # Get cluster information
         cluster_id = self.kwargs["cluster_id"]
         cluster = senlin.cluster_get(self.request, cluster_id)
         cluster.profile_url = reverse_lazy(self.profile_url, args=[cluster.profile_id])
     except Exception:
         msg = _("Unable to retrieve cluster.")
         url = reverse_lazy(clusters_forms.INDEX_URL)
         exceptions.handle(self.request, msg, redirect=url)
     return cluster
示例#3
0
    def get(self, request, cluster_id):
        """Get a single cluster's details with the cluster id.

        The following get parameters may be passed in the GET

        :param cluster_id: the id of the cluster

        The result is a cluster object.
        """
        cluster = senlin.cluster_get(request, cluster_id).to_dict()
        cluster["metadata"] = api_utils.convert_to_yaml(cluster["metadata"])
        return cluster
示例#4
0
 def get_object(self):
     try:
         # Get cluster information
         cluster_id = self.kwargs["cluster_id"]
         cluster = senlin.cluster_get(self.request, cluster_id)
         cluster.profile_url = reverse_lazy(self.profile_url,
                                            args=[cluster.profile_id])
     except Exception:
         msg = _("Unable to retrieve cluster.")
         url = reverse_lazy(clusters_forms.INDEX_URL)
         exceptions.handle(self.request, msg, redirect=url)
     return cluster