예제 #1
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
예제 #2
0
    def get(self, request, profile_id):
        """Get a single profile's details with the profile id.

        The following get parameters may be passed in the GET

        :param profile_id: the id of the profile

        The result is a profile object.
        """
        profile = senlin.profile_get(request, profile_id).to_dict()
        profile["spec"] = api_utils.convert_to_yaml(profile["spec"])
        profile["metadata"] = api_utils.convert_to_yaml(profile["metadata"])
        return profile
예제 #3
0
    def get(self, request, node_id):
        """Get a single node's details with the receiver id.

        The following get parameters may be passed in the GET

        :param node_id: the id of the node

        The result is a node object.
        """
        node = senlin.node_get(request, node_id).to_dict()
        node["metadata"] = api_utils.convert_to_yaml(node["metadata"])
        return node
예제 #4
0
    def get(self, request, policy_id):
        """Get a single policy's details with the policy id.

        The following get parameters may be passed in the GET

        :param policy_id: the id of the policy

        The result is a policy object.
        """
        policy = senlin.policy_get(request, policy_id).to_dict()
        policy["spec"] = api_utils.convert_to_yaml(policy["spec"])
        return policy
예제 #5
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
예제 #6
0
    def get(self, request):
        """Get a list of receivers."""

        filters, kwargs = rest_utils.parse_filters_kwargs(
            request, CLIENT_KEYWORDS)

        receivers, has_more_data, has_prev_data = senlin.receiver_list(
            request, filters=filters, **kwargs)

        receivers_dict = []
        for r in receivers:
            r = r.to_dict()
            r["params"] = api_utils.convert_to_yaml(r["params"])
            r["channel"] = api_utils.convert_to_yaml(r["channel"])
            receivers_dict.append(r)

        return {
            'items': receivers_dict,
            'has_more_data': has_more_data,
            'has_prev_data': has_prev_data,
        }
예제 #7
0
    def get(self, request, node_id):
        """Get a single node's details with the receiver id.

        The following get parameters may be passed in the GET

        :param node_id: the id of the node

        The result is a node object.
        """
        node = senlin.node_get(request, node_id).to_dict()
        node["metadata"] = api_utils.convert_to_yaml(node["metadata"])
        return node