diff --git a/cloudkitty/api/v1/controllers/collector.py b/cloudkitty/api/v1/controllers/collector.py index a138bfbc..a4ef0316 100644 --- a/cloudkitty/api/v1/controllers/collector.py +++ b/cloudkitty/api/v1/controllers/collector.py @@ -15,6 +15,7 @@ # # @author: Stéphane Albert # +from oslo_log import log as logging import pecan from pecan import rest import six @@ -25,6 +26,8 @@ from cloudkitty.api.v1.datamodels import collector as collector_models from cloudkitty.common import policy from cloudkitty.db import api as db_api +LOG = logging.getLogger(__name__) + class MappingController(rest.RestController): """REST Controller managing service to collector mappings.""" @@ -39,6 +42,7 @@ class MappingController(rest.RestController): :param service: Name of the service to filter on. """ + LOG.warning("Collector mappings are deprecated and shouldn't be used.") policy.authorize(pecan.request.context, 'collector:get_mapping', {}) try: mapping = self._db.get_mapping(service) @@ -55,6 +59,7 @@ class MappingController(rest.RestController): :param collector: Filter on the collector name. :return: Service to collector mappings collection. """ + LOG.warning("Collector mappings are deprecated and shouldn't be used.") policy.authorize(pecan.request.context, 'collector:list_mappings', {}) mappings = [collector_models.ServiceToCollectorMapping( **mapping.as_dict()) @@ -71,6 +76,7 @@ class MappingController(rest.RestController): :param collector: Name of the collector to apply mapping on. :param service: Name of the service to apply mapping on. """ + LOG.warning("Collector mappings are deprecated and shouldn't be used.") policy.authorize(pecan.request.context, 'collector:manage_mapping', {}) new_mapping = self._db.set_mapping(service, collector) return collector_models.ServiceToCollectorMapping( @@ -85,6 +91,7 @@ class MappingController(rest.RestController): :param service: Name of the service to filter on. """ + LOG.warning("Collector mappings are deprecated and shouldn't be used.") policy.authorize(pecan.request.context, 'collector:manage_mapping', {}) try: self._db.delete_mapping(service) diff --git a/releasenotes/notes/deprecate-collector-mappings-5a69b31c8037fc01.yaml b/releasenotes/notes/deprecate-collector-mappings-5a69b31c8037fc01.yaml new file mode 100644 index 00000000..96b7b127 --- /dev/null +++ b/releasenotes/notes/deprecate-collector-mappings-5a69b31c8037fc01.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + Collector mappings have been deprecated and should not be used anymore. They + will be removed during OpenStack's S cycle.