Exemple #1
0
 def get_object(self):
     try:
         # Get initial receiver information
         receiver_id = self.kwargs["receiver_id"]
         receiver = senlin.receiver_get(self.request, receiver_id)
     except Exception:
         msg = _("Unable to retrieve receiver.")
         url = reverse_lazy("horizon:cluster:receivers:index")
         exceptions.handle(self.request, msg, redirect=url)
     return receiver
Exemple #2
0
    def get(self, request, receiver_id):
        """Get a single receiver's details with the receiver id.

        The following get parameters may be passed in the GET

        :param receiver_id: the id of the receiver

        The result is a receiver object.
        """
        return senlin.receiver_get(request, receiver_id).to_dict()
 def get_object(self):
     try:
         # Get initial receiver information
         receiver_id = self.kwargs["receiver_id"]
         receiver = senlin.receiver_get(self.request, receiver_id)
     except Exception:
         msg = _("Unable to retrieve receiver.")
         url = reverse_lazy("horizon:cluster:receivers:index")
         exceptions.handle(self.request, msg, redirect=url)
     return receiver
Exemple #4
0
    def get(self, request, receiver_id):
        """Get a single receiver's details with the receiver id.

        The following get parameters may be passed in the GET

        :param receiver_id: the id of the receiver

        The result is a receiver object.
        """
        receiver = senlin.receiver_get(request, receiver_id).to_dict()
        receiver["params"] = api_utils.convert_to_yaml(receiver["params"])
        receiver["channel"] = api_utils.convert_to_yaml(receiver["channel"])
        return receiver