コード例 #1
0
ファイル: senlin.py プロジェクト: openstack/senlin-dashboard
    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
ファイル: views.py プロジェクト: openstack/senlin-dashboard
 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
ファイル: senlin.py プロジェクト: openstack/senlin-dashboard
    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