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