def _get_nodes(self, marker, limit, sort_key, sort_dir): limit = utils.validate_limit(limit) sort_dir = utils.validate_sort_dir(sort_dir) marker_obj = None if marker: marker_obj = objects.sm_node.get_by_uuid( pecan.request.context, marker) nodes = pecan.request.dbapi.sm_node_get_list(limit, marker_obj, sort_key=sort_key, sort_dir=sort_dir) return nodes
def _get_service_groups(self, marker, limit, sort_key, sort_dir): limit = utils.validate_limit(limit) sort_dir = utils.validate_sort_dir(sort_dir) marker_obj = None if marker: marker_obj = objects.sm_sda.get_by_uuid(pecan.request.context, marker) sm_sdas = pecan.request.dbapi.sm_sda_get_list(limit, marker_obj, sort_key=sort_key, sort_dir=sort_dir) # Remap OpenStack_Services to Cloud_Services for sm_sda in sm_sdas: if sm_sda.service_group_name.lower() == "openstack_services": sm_sda.service_group_name = "Cloud_Services" return sm_sdas